Skip to content

reviews for configurable product missing in product page #3735

@undefinederror

Description

@undefinederror

Current behavior

When going from catalog to product page, reviews are not shown on product page unless the item is a simple product.
After refresh on product page, reviews are shown.

Expected behavior

Reviews should show up either way

Steps to reproduce the issue

storefront (2)

My 2 cents

AFAIK this happens because in core\modules\catalog\store\product\actions.ts list(), if the product is a configurable product it gets merged with a simple product variant.
image.
Thus losing the id of the configurable product, which is what reviews are linked to.
Product.vue loads using the provided id (variant) and tries to pass originalProduct.id to reviews, although originalProduct has been lost due to the previous merge and it's now just the same as the variant product.
image

Can you handle fixing this bug by yourself?

  • YES
  • YES BUT BADLY
  • NO

A quick fix would be to save a reference to the configurable product id before merging with the variant
image
Then pass this if it exists to the review component.
image

This doesn't feel very clean though. If it was for me I would never merge products in list() in the first place, it feels very hacky. I have tried to go through the code in actions but man... really, really hard to understand what happens there...

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Environment details

  • Browser: Chrome Version 77.0.3865.90 (Official Build) (64-bit)
  • OS: Windows 10 Pro 1809
  • Node: v10.16.3
  • Code Version: VSF 1.10.3 / VSF-API 1.10.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions