2
Answers
Vote up!
0
Vote down!

How to list all product variations in the product display instead of a select box?

I have a product display for a music album that contains 10 tracks. In that product display I have 12 product variations: 1 for the CD, 1 for the whole album in mp3 format, and 10 individual racks. (Am I using the right approach here?)

I would like the product display to list all variations with an add to cart button besides all items instead of having them in a select box. How can I accomplish this? Is there a way to control the output of this form via a template override?

Thanks! I love Drupal Commerce...

Asked by: bohemier
on April 9, 2013

Comments

Yes as well as the full album in both mp3 and physical CD

- bohemier on April 9, 2013

2 Answers

Vote up!
0
Vote down!

Interesting... thanks for the suggestion. I think I found the missing part in the first video. I didn't realize there was an 'Add to cart' field.

Albums are the center point to relate products. I would tend to relate them by creating a product display node which would reference all product entities for the album (CD, MP3 and individual tracks). Then use views to display all referenced products in the page instead of the default product display.

You seem to suggest that this relation should be done with taxonomy... but that would require creating one term per album ... is that what you meant?

Thanks!

Answer by: bohemier
Posted: Apr 12, 2013

Comments

Vote up!
0
Vote down!

So my solution in case it helps anyone was to create a view that displays all product variations in a table with the add to cart form (I called it all_product_variations_from_product). Then include a computed field in my product display that, through php will display my view: $display_output = views_embed_view('all_product_variations_from_product', 'default');

Cheers

Answer by: bohemier
Posted: Apr 21, 2013