Hello there
I realized the next: When I add a new product and I add to cart it, not show the link "view product" . But when I edit that product and modify something on product variation and save again. The link "view product" appears in Shopping cart.

Somebody could tell me what is happening? Is it a bug of the commerce kickstart ? or Am I doing something wrong?

Any help will be highly appreciated. Thanks.

Comments

jsacksick’s picture

Title: Shopping cart views are not show product links » The title of a newly created product varation is NULL

I chased the bug and it appears that we have a really tricky problem to solve.

The view product link doesn't appear because of the configuration of the view, we're rewriting the output of the title of the Line item.

We also checked the "Hide rewriting if empty" option of views which doesn't output anything if a views field is empty.
The title of the line item is populated from the product (See commerce_product_line_item_title()).

In the Kickstart configuration, we're using the "autogeneration title" functionality from Inline Entity Form which set the title property of the product.

Inline Entity form does it's job and properly set the title property value, we're using the title module which replaces the title property by the title field.
The title module is supposed to automatically populate the title field value from the title property BUT something is happening in between and wipe the title property of the product.

We're also using the Commerce AutoSKU module to autogenerate the product SKUS.
In commerce_autosku_commerce_product_presave() the module is calling the token_replace() function which finally triggers some Title module magic.
This ends by calling title_field_sync_get() which is supposed to replace the title property value by the title field value but in this case it's empty.... and the value is wiped.

jsacksick’s picture

Status: Active » Needs review

A patch has been sent to the Commerce Auto SKU issue and fixes the issue. See #1999086: Use a cloned product entity when calling token_replace to avoid entity altering during save

rbayliss’s picture

Traced this back and found it was a title module bug, since that module actually alters the original entity when you call token_replace with it. They've already fixed the issue in #1269076: Translated title_field replaces node->title with translated value, so Kickstart probably needs to pull in that change.

jsacksick’s picture

Status: Needs review » Fixed

I've decided to add the Title patch to the make file for now.

Status: Fixed » Closed (fixed)

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