I have ticked both the "Link to Product" and "Link With Line Item" checkboxes in the "Commerce Line Item: Product Attributes" field settings on the "Shopping cart form" view (admin/structure/views/view/commerce_cart_form/edit).

If you are logged in, this causes the product title of that field being linked to the product display node path, appended by "?line_item_id=[line_item_id]", which is the expected behaviour. However, the links only appear for an authenticated user. The anonymous user will not see any links at all!

The patch attached at #1929782: Anonymous users cannot view their line item attributes. does not help, so this issue seems to be unrelated to the other one.

Comments

roball’s picture

Title: No links on the product title for the anonymous user » No link on the product title for the anonymous user
roball’s picture

Title: No link on the product title for the anonymous user » The product title may not be linked when "Link to Product" and "Link With Line Item" are enabled

I have now found that the non-linked product titles may not only appear to the anonymous user, but also for logged in users in some circumstances.

Thus, the following workaround can be applied which always works:

  1. Add the fields "(Node referencing products from field_product_reference) Content: Path" and "(Line items referenced by commerce_line_items) Commerce Line Item: Line item ID" before the "Commerce Line Item: Product Attributes" field and Exclude them from display.
  2. In the "Commerce Line Item: Product Attributes" field, within "Rewrite results", enable "Output this field as a link" and set "[path]?line_item_id=[line_item_id]" as the Link path.
roball’s picture

Issue summary: View changes
sano’s picture

Priority: Major » Normal

I do not see this problem using Commerce Product Attributes 7.x-1.0-beta3+0-dev. Tested it with authenticated as well as anonymous user in FF and Safari on Mac. The only patch I have installed in the module is https://www.drupal.org/project/commerce_product_attributes/issues/1517084 but I do not believe that should affect this issue.

sano’s picture

Maybe the @roball used the Commerce Product Option module, which could explain the observed behavior. The attached related issue has a patch that might provide a fix for this issue.