There is no way to override the labels of the check boxes and select lists in an add-on cart form, nor the option labels.
I'm imagining adding two items:
Configure product label ( Add {{ product.label }} )
Configure variation option ( {{ variation.label }} for {{ variation.getPrice|commerce_price_format}} )
And if you wanted to show the price in product label (because you know all are the same price...
Add {{ product.label }} for {{ product.getDefaultVariation.getPrice|commerce_price_format }}
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2905468-7.patch | 9.06 KB | mglaman |
| #4 | provide_a_way_to-2905468-4.patch | 9.24 KB | mglaman |
| #4 | Screen Shot 2017-09-01 at 1.13.50 PM.png | 57.42 KB | mglaman |
Comments
Comment #2
mglamanI'm imagining adding two items:
Configure product label ( Add {{ product.label }} )
Configure variation option ( {{ variation.label }} for {{ variation.getPrice|commerce_price_format}} )
And if you wanted to show the price in product label (because you know all are the same price...
Add {{ product.label }} for {{ product.getDefaultVariation.getPrice|commerce_price_format }}
Comment #3
mglamanActually, at that point we would still need to render the inline template. I'd rather just add a theme hook which can then have suggestions added by end users and even more flexibility than the UI.
Comment #4
mglamanWith the following patch, the attached screenshot is possible.

Comment #5
nathaniel commentedApplied the patch and copied commerce-pado-addon-product-label.html.twig to my theme. I am using the following code to display the product label and price for products with one variation:
{{ product_entity.label }} {{ product_entity.getDefaultVariation.getPrice|commerce_price_format }}Cleared all cache. Looks good!
Comment #6
hubbs commentedPatch no longer applies. Needs a reroll.
Comment #7
mglamanReroll ahoy!
Comment #9
mglamanFinally comitted!