Hello,
I'm selling 2 products, a RegularSubscription and a GiftSubscription of the same product type (subscription) on a classic Drupal installation (not kickstart).
The GiftSubscription has 2 extra fields (email and message) managed by Customizable Products. These fields are 'required' and 'attached to the add to cart form'.
So RegularSubscription has a regular add to cart form, and, GiftSubscription has a custom add to cart form made of the 2 extra fields and the add to cart button.
Everything works fine on each single product display node.
But I can't get to have the dedicated add to cart form for each product when the 2 products are displayed in a single View, since only ONE of the 2 add to cart form has to be selected in View/Fields/add add-to-cart field/select line-item add-to-cart form.
I'm probably missing something, and using Views may not be the way to go...
Any idea welcome !
Thanks.
Comments
Comment #2
nvahalik commentedViews can either have a base of a commerce_product entity or a node.
If you are using using a node base, then you must set the line item type in the add to cart formatter for the commerce product field on the display node bundle. Then both products will have that new line item type. You can hide/show fields on that form based on the line item type. That is one option.
Likewise, you can use Commerce Add to Cart Extras to display simple add to cart forms to products. However, you cannot choose which line item type you want to add so this option currently does not give you that option out of the box.
I'm marking this issue as a duplicate of #1798006 since that seems to be the gist of what you are wanting and if we supported that it'd likely work for you.
Comment #3
fvince commentedThank you !
I did see #1798006, but was hoping a zero coding solution.
Plus, this post shows how to change the text button, but not how to hide line item fields attached to the add-to-cart form.
If I dig into it and find a way, I'll comment it...