Make the use of shipping confirmating token more flexible

Created on 11 June 2023, about 1 year ago
Updated 19 June 2023, about 1 year ago

Problem

Sending the shipping confirmating using commerce-shipment-confirmation.html.twig the product title and sku is missing but the product variable title is visible. The product title is important to show the unique product because some product variable titles are the same. This can confuse customers when 2 products have the same variable title while the product tile is invisible. They also have no sku reference.
After many attempts I found no method via tokens to add the sku and product title. Those token fields appear empty.

Steps to reproduce

Add extra tokens in "commerce-shipment-confirmation.html.twig" like this and create the final shipping confirmation (td/td stripped below for clarity)

{% for shipment_item in shipment_entity.getItems() %}

{{ shipment_item.quantity|number_format }} x <--- visible in the email

{{ shipment_item.sku }} <--- no result

{{ shipment_item.product }} <--- no result

{{ shipment_item.title }} <--- visible as "product variation title in the email"

{endfor}

The result per line is "Variation Title"
It should be presented on each line as "SKU - Product Title - Variation Title"

Proposed resolution

A new configuration menu "shipping confirmation fields" and then use the new tokens in "commerce-shipment-confirmation.html.twig"
[added]
Another option isto embed more information in shipment_item.title programatically, like the sku and product title, but the token name may cause confusion. To keep it as flexible as possible they should be separate tokens, and in config->shipping a new menu "shipping confirmation" where desired items from existing orders configuration can be added, field which exists in products and product variations.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Rob-PS

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024