4 replies [Last post]
harrisben's picture
Offline
Joined: 04/17/2009
Juice: 192
Was this information Helpful?

I don't know if there is functionality I'm missing, but it would be really great if it were possible to select item attributes when adding them to a kit and make it so that they cannot be selected/altered by the customer because in my case everything about the kit is predetermined and not optional. At the moment it seems that when adding items that have attributes to a kit it isn't possible to select the attribute and when viewing the node the customer is presented with a list of every item and all of the possible item attributes.

If I'm missing something please do let me know as I'd love to make use of the kit functionality, but as it is I cannot (which isn't that much of a problem.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15450
Re: Product Kits and Attributes

Your assessment is correct - there is no way to automatically select attribute options for the products included in a kit. That is a good idea, but it won't happen in Ubercart 2.x unless someone can come up with a contrib module to do it. Smiling I don't have any good alternate ideas handy, but I wanted to clear the issue up for ya.

harrisben's picture
Offline
Joined: 04/17/2009
Juice: 192
Re: Re: Product Kits and Attributes

Thanks for the quick response Ryan and sorry to take so long to respond but I've been thinking about how to approach this. I've been looking at the existing product kit module and find the table structure of uc_product_kits a little confusing. Is there somewhere to look for information about what each field is for?

I can't decide if I should rewrite the existing product_kits module, which is quite basic, or a new module that would intercept every call the existing module makes. I'm leaning towards a complete replacement at the moment as practically everything from the existing module would need replacing, but even then I'm not sure exactly how to go about it because I've never written a module or even more than a few lines of php. Luckily most of the logic I need already exists within various ubercart modules.

I'm pretty good at designing/logic, but the actual coding is another thing altogether. If anyone could point me to a good resource or two it would be much appreciated. I also apologise in advance for the hack-job I am about to do.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15450
Re: Re: Re: Product Kits and Attributes

Drupal offers a lot of tools in its API to allow you to customize the way modules work without having to hack/rewrite them, though I won't write that off as a sometimes necessary practice. I'd make sure that's what you need to do here, as the product kit module had to do some special monkeying to have the kits displayed in the shopping cart properly. If you have to go from scratch, you're going to have to understand a lot of the Drupal API and of course some PHP / MySQL. Any of the Drupal 6 module development books should do you well.

Francois's picture
Offline
Joined: 08/19/2008
Juice: 390
Workaround

I've found a workaround to this problem.

  1. Mark the attributes as not required.
  2. Select the default to be the default you use in your Kit.
  3. In your product kit node, use display:none to hide the attribute options, effectively forcing the default attribute on the customer

This will obviously not work if you have the same product with different attributes in different kits, but for a basic kit setup this will work perfectly.

Eye-wink

--------
'Twas the end of the world, and you didn't even know it.