I want to put the calculated product price between the "product variation" select widget and the "pay" button.
In commerce-product.html.twig
(my products display an add to cart form on the product itself), I have this code:
<article{{ attributes }}>
<h2>{{ product.title }}</h2>
{{ product|without('title', 'variation_price' }}
{{ product.variation_price }}
</article>
variation_price
is the calculated price.
- What is the name of the variable that contains the product variation select widget? Answer: product.variations
- How can I place the submit/pay button separately from the variation type selection widget? Answer: ??
I tried using kint to debug but it broke my site. (And then people on this site kindly explained how to fix it.) So I now understand that the variable containing the widget that shows the variations is named product.variations, and this is actually the "Add to cart" form (since that is what I set the display widget to in the UI).
So I guess I need to print the "Add to cart" form twice, and in one instance show the submit button, and in the other instance show the select widget... But how do I do that?
I looked at the twig debug theme suggestions but they don't give me a template for the "Add to cart" form:
<!-- FILE NAME SUGGESTIONS:
* field--commerce-product--variations--contenttype.html.twig
* field--commerce-product--variations.html.twig
* field--commerce-product--contenttype.html.twig
* field--variations.html.twig
* field--entity-reference.html.twig
x field.html.twig