Hi,

Lyle and I have discussed and agreed to add optional labels to attributes. This will allow the following attributes to both show a select list labelled Size on product Add to cart forms.

Attribute: A
Name: Dress sizes
Label: Size
Options: 6, 8, 10, 12, 14

Attribute: B
Name: Jean sizes
Label: Size
Options: 28, 29, 30, 31, 32, 34

Once one of the above attributes is added to a product the other (with the same label) will not be shown in that product's Add attribute form.

Attribute labels can be overridden per-product in the same way Required or Display can.

We've also added support for a label set to ''. This will hide the label on product Add to cart forms. In the cart (both block and page), checkout and orders, the attribute name will be used. Use this feature carefully. Most use cases are better off not using this feature.

Patch to follow.

Comments

sammys’s picture

StatusFileSize
new16.15 KB

Patch attached!

Island Usurper’s picture

Status: Active » Needs review
StatusFileSize
new14.98 KB

Okey dokey. Couple of quick things. I've changed the update function to use the Schema API for D6, and added another place to use _uc_attribute_get_name().

Since it took me a couple of tries to figure out what the $force parameter was doing, I changed it and the inline docs to say something that will hopefully be clearer.

Lastly, I fixed it so that attributes with empty labels don't exclude any others from the add attributes to products form.

Island Usurper’s picture

StatusFileSize
new15.17 KB

Going off some of Ryan's suggestions for usability, labels' default values should be the attribute's name if they are empty.

rszrama’s picture

Version: 6.x-2.x-dev » 6.x-2.0-beta6
Status: Needs review » Fixed

Fixed a bugfix and column title. Committing as is, we can refine as we go.

sammys’s picture

Status: Fixed » Reviewed & tested by the community
StatusFileSize
new1.18 KB

There's a typo that I left there when changing function name. Patch attached.

rszrama’s picture

Version: 6.x-2.0-beta6 » 6.x-2.0-rc1
Status: Reviewed & tested by the community » Fixed

Fixed! Thanks, Sammy, and thanks for rushing this patch together for us. We normally aren't so pressed for time and wouldn't force things, but we needed the morale boost of a release candidate last night. : P

sammys’s picture

All good Ryan! Thanks for accepting the patch and for all the work to get it to RC! :) You all deserve some Chick-fil-a! :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

aliak’s picture

Version: 6.x-2.0-rc1 » 6.x-2.0-rc2
StatusFileSize
new28.37 KB

hi, is the line 325 problem in ubercart-6.x-2.0-rc2 also?

I was seeing this error message, then found this thread.
Fatal error: Call to undefined function uc_attribute_get_name() in /home//sites/all/modules/ubercart/uc_attribute/uc_attribute.module on line 325

I made the change (manually) as per the patch & re-ran cron and it seems ok now
- $output .= '

'. uc_attribute_get_name($attribute) .'

';
+ $output .= '

'. _uc_attribute_get_name($attribute) .'

';

attached is the original file (broken)
uc_attribute.module_original.txt

(sorry I didn't change the version # in the bug report header)

Island Usurper’s picture

I think this was one of the things that I committed to the Bazaar repository, but didn't fix right in CVS. It should be good in the dev version.

aliak’s picture

thanks. I installed this and it doesn't have the error
(I'd installed the rc2 as it was recommended for drupal6 - didn't notice the dev version was a later date)

asak’s picture

subscribing.

Island Usurper’s picture

You subscribed to a closed thread?

Get rc3: it has the fix in it.