Closed (won't fix)
Project:
Ubercart
Version:
7.x-3.0
Component:
Products
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Mar 2012 at 21:40 UTC
Updated:
2 Nov 2012 at 15:23 UTC
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
Comment #1
tr commentedIt'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.
Comment #2
tommyent commentedWhat 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
Comment #3
longwaveWithout 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.
Comment #4
tommyent commentedPretty 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
Comment #5
longwavePerhaps you could consider contributing that code back to the community so others can use it?
Comment #6
tommyent commented@sanguis should be posting something soon
Comment #7
sanguis commentedHey Guys Let me de brand this code from the original snippet that I wrote for the cleint and I will post it
Comment #8
jday commentedI'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?
Comment #9
tr commentedThe '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.
Comment #10
jday commentedPerfect! that was the function I was looking for, thank you TR.