1 reply [Last post]
leenwebb's picture
Offline
Joined: 06/01/2008
Juice: 248
Was this information Helpful?

I have an attribute that contains a big long list of "Scents". But on some products, even though it's the same list, I'd rather have the label say "Flavors".

The best I've come up with is:
1) Create a CCK dropdown that has "Scents", "Flavors" and whatever other labels I might need.
2) Use CSS to hide the "label for="edit-attributes-20" "(which it seems is consistent across all products) and then display the CCK value in its place.

But I'd rather do it with PHP than CSS. Can I theme this, or otherwise program different labels for a single attribute?

Thanks!
Eileen

leenwebb's picture
Offline
Joined: 06/01/2008
Juice: 248
Re: Can I have a single attribute with multiple labels?

Apparently if you leave me alone long enough I come up with answers on my own. Who knew?

I created a CCK field called "scent_label", then went into uc_attribute.model at line 1492:

// custom attribute name
if($node->field_scent_label[0]['value'] != NULL && $attribute->name =='Fragrance'){
$attribute->name = $node->field_scent_label[0]['value'];
}

Of course, this means I can't ever change the default attribute name to something other than "Fragrance", but I'm ok with that since I can override it at the product level.