When a product's title is updated product variation titles shall do as well in case the "Generate variation titles based on attribute values" checkbox is on.

The issue right here is that when a Product Title is updated Product Variation Titles are not and causes confusion to end-users.

A workaround is to create a hook for Product Update but it will be better that this information is in the Product module directly.

Comments

RubenIbarraPastor created an issue. See original summary.

RubenIbarraPastor’s picture

In order to update the variations with the new name while the product is created. We need to save them again.

geek-merlin’s picture

Status: Active » Needs review
StatusFileSize
new2 KB

Code is trivial and exactly what i'd have coded.
A manual test succeeds.

Existing tests are green, the fails concern translated-entities and are only under D8.7 (HEAD seems not to have this), which is hopefully transitionally.

I added an explaining comment and a test.

geek-merlin’s picture

Status: Needs review » Reviewed & tested by the community

OK patch did not change, test added and pass.

https://github.com/drupalcommerce/commerce/pull/870

bojanz’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
supriya1992’s picture

My product title is updating due to variation not saved that is why old title is showing while adding to cart and even on product detail page.

I tested the patch : https://www.drupal.org/files/issues/2019-01-07/commerce-2986678-3-update... . It is working fine for me.

Reproduce the issue.
step 1 : Update the title and save the product.
step 2 : check the detail page of that product.
step 3 : Title got updated but not on showing on detail page. I added to cart and there also it was showing old one.

Once applied the above patch and follow the same steps it was working fine.