I'm trying to add some simple if statements to attribute dropdowns and I can't seem to target them individually. I can either display all or none.
The link is a node dpm of the objects I'm trying to target.

Any help would be greatly appreciated as I've been stuck on this for a long time and it's the last thing I need to do to wrap up the project.

Thanks in advance

https://picasaweb.google.com/lh/photo/9fpIFmLXOH7ujX1QkPxJCtMTjNZETYmyPJ...

Comments

tr’s picture

Status: Active » Postponed (maintainer needs more info)

It's not clear to me what you're trying to do. If you're trying to implement dependent attributes, there are a couple of contributed modules that might work for you. Dependent attributes are not currently supported in Ubercart core.

tommyent’s picture

What I want to do is print a certain list of attributes based on the value of one of the product fields.
I did find 2 but either they didn't do what I wanted or they were D6

longwave’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Without posting your code so far (your "simple if statements") we still don't really know what you're trying to do, and custom code is generally not supported here. If you can give a precise example of what you want with steps to reproduce from a new install and some sample code then perhaps someone will be able to help.

tommyent’s picture

Pretty buch I just wasn't able to grab an individual atribute drop down. We did get another developer who came in and put this into a module.

Thanks

longwave’s picture

Perhaps you could consider contributing that code back to the community so others can use it?

tommyent’s picture

@sanguis should be posting something soon

sanguis’s picture

Hey Guys Let me de brand this code from the original snippet that I wrote for the cleint and I will post it

jday’s picture

I'm trying to add option specific classes to checkbox and radio options but editing the theme_uc_attribute_option function effects all attributes (like select options)

Currently option labels look like this:

If I could change that 'for' to 'class' that would work perfect, what function prints that bit of info?

tr’s picture

The 'for' attribute of the label tag is generated automatically by the Drupal Form API. You may override theme_form_element_label() if you want change this markup. I wouldn't simply rename 'for' to 'class'; instead, add a class that has the same value as the 'for' attribute.

jday’s picture

Perfect! that was the function I was looking for, thank you TR.