8 replies [Last post]
nickgs's picture
Offline
Joined: 02/25/2008
Juice: 113
Was this information Helpful?

Hello.

I am evaluating using ubercart for a project. This is for an e-commerce store that will be selling clothes of various sizes. I would like to use the product attributes to specify the size and possibly the color of the product. From what I am understanding the product attributes are always being displayed as a textfield.

Is there any way to specify how the attributes should be displayed with respect to UI components?

For sizes I would like a radio button group OR an ordered list of links to add that specific product/size to the customers cart. After reviewing the uc_attributes.module it looks like this is implemented in the _uc_attribute_alter_form($product) function.

Am I missing something, is this possible without altering any modules?

Thanks!

Nick

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Attributes not as a textfield

After you have attributes, you also need options for those attributes. When a product has both attributes and options assigned to it, they show up in a select box on the Add to Cart form.

I believe there is a contrib module to turn attributes into radio buttons.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Attributes not as a textfield

I've also just updated the attribute/option documentation to include a step-by-step list for assigning attributes to products. Check it out and let me know if anything is missing (besides screenshots... those will be added after a few UI updates are made Eye-wink):

http://www.ubercart.org/docs/user/3340/product_attributes_and_options

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 850
Re: Re: Attributes not as a textfield

Lyle, Drayen in IRC was asking about attributes as radio buttons as well and I suggested that he could use hook_form_ alter(). He asked me how he could make his form alter fire after uc_attribute_form_alter, and I wasn't sure about that.

Do you know if order of execution is a general problem with the hook system, or if there is a neat way around that problem?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Rescue 911. I twisted his

Rescue 911. I twisted his arm and begged him pretty please... or something unlike that.

Eye-wink

a_c_m@drupal.org's picture
Offline
Bug Finder
Joined: 01/02/2008
Juice: 288
Wow, thats service!!! I'm

Wow, thats service!!!

I'm going to fight on with my little contrib, as i dont want to use bizzar code right now + need to learn Eye-wink So any more ideas on the hook execution order?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Wow, thats service!!! I'm

I think you need to manually alter the module's weight in the system table, but don't quote me on that. Sticking out tongue

a_c_m@drupal.org's picture
Offline
Bug Finder
Joined: 01/02/2008
Juice: 288
Yeah, you were right. Got

Yeah, you were right.

Got it working, can also be done with hook_install() i think. Seems my little module was outdated before i wrote it, but works for me Smiling

nickgs's picture
Offline
Joined: 02/25/2008
Juice: 113
Re: Yeah, you were right. Got

Great, thanks for the feedback. My problem was simple, I no options selected for the specific attribute. After selecting multiple options the attributes shows up as a combobox.

Thanks again, so far Ubercart is winning me over! I look forward to participating in the community!!