0

I use Drupal Commerce module to build my store. There are items in this store with sets of attributes such a color, size etc. I've created a content type to render a product. When I use a built in way to render this content type I have an interactive add to cart form with select lists or radio buttons for all attributes which loads values such a photo etc depend on it's values. Please suggest an approach how can I get this form using views?

I guess it should be quite a common task.

0

Create a View of your content.

Add field "Commerce Product: Add to Cart Form" to your View.

enter image description here

| improve this answer | |
  • I wish It could be so easy. When I use views I can only have the add to cart form for one product among referenced ones. Or I can have a single add to cart for each product from product reference field. When using a builtin way there is an interactive form which affects the rest of the page via ajax. – Andriy Jul 13 '16 at 8:00
  • @Andrey you'll have to be more specific about how you built your view in order to receive further insight – oksana-c Jul 13 '16 at 9:20
  • I'm sorry if I wasn't specific enough. I have a content type with a field 'products' in it. It may contain lets say all available t-shirts. Wit all their sizes and colors. When I render this type without views, I can get a single "add to cart" button and a select list with options (color). When I select a color, form gets rebuilt and It can load a photo for example for this specific color and available sizes. And a button will add this certain t-shitrt. When I use Views, I can't get such a interactivity. – Andriy Jul 13 '16 at 9:22
  • I can only have a button for a one single product in referenced to the node. Or I can render a table or a list of all referenced products and they will have it's own add to cart button. – Andriy Jul 13 '16 at 9:30
  • @Andrey It is still unclear how you set up your view (base table, is there any relationships that you are using to render the product). If you haven't solved this yet - check these threads for more clues - Product Attributes not showing inside a Views Add to Cart form field, How do I show product attribute fields in a view? – oksana-c Jul 31 '16 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.