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 }}

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Issue summary: View changes

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 }}

mglaman’s picture

Actually, 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.

mglaman’s picture

Status: Active » Needs review
StatusFileSize
new57.42 KB
new9.24 KB

With the following patch, the attached screenshot is possible.

nathaniel’s picture

Status: Needs review » Reviewed & tested by the community

Applied 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!

hubbs’s picture

Status: Reviewed & tested by the community » Needs work

Patch no longer applies. Needs a reroll.

mglaman’s picture

Status: Needs work » Needs review
StatusFileSize
new9.06 KB

Reroll ahoy!

  • mglaman committed 9de67c9 on 8.x-1.x
    Issue #2905468 by mglaman, Nathaniel: Provide a way to customize...
mglaman’s picture

Status: Needs review » Fixed

Finally comitted!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.