3 replies [Last post]
glennnz's picture
Offline
Joined: 01/20/2009
Juice: 451
Was this information Helpful?

Hi

I'm developing some content templates (using Contemplate 5.x-2.04, Drupal 5.16, UC 1.7) for my product nodes. How do I access attributes to include them in my product node?

I need a drop down box to select from...

Thanks

Glenn

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Attributes and Content Templates

This isn't possible, since they're a part of a single element in the node body... the add to cart form. You'd need to theme that form specifically in your theme, not in a content template.

mk31762's picture
Offline
Joined: 05/28/2009
Juice: 44
Can't theme add to cart in the usual way.

I know this is an old post, but I'm losing sleep over something similar I'm trying to do.

I keep hearing that, in order to control the rendering of attributes, I need to theme the add_to_cart form. That doesn't seem to be possible. The theme_uc_product_add_to_cart function receives a $node reference not a form reference. I admit my knowledge of the inner workings of Drupal and Ubercart is wanting. Nonetheless, it seems like some kind of magic merge happens in that theme function. A form id is constructed using the node id and it is then passed to drupal_get_form, which returns the HTML with the attributes for that node already added. There's never a chance to style the form before it's rendered.

Actually, I know I'm missing something here and I'm feeling very frustrated that I can't find the answer.

Thanks,

MK

mk31762's picture
Offline
Joined: 05/28/2009
Juice: 44
Never mind. Figured it out.

Never mind. Figured it out. Nothing like a little venting to clear the mind.

http://www.ubercart.org/forum/support/11777/themeing_attributes_uc_produ...