Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reviews for configurable product missing in product page #3735

Closed
2 of 6 tasks
undefinederror opened this issue Oct 21, 2019 · 2 comments
Closed
2 of 6 tasks

reviews for configurable product missing in product page #3735

undefinederror opened this issue Oct 21, 2019 · 2 comments
Assignees
Labels
backport-to-1.10 bug Bug reports P3: Normal Priority mark - normal priority

Comments

@undefinederror
Copy link
Contributor

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
@undefinederror undefinederror added the bug Bug reports label Oct 21, 2019
@pkarw pkarw added P3: Normal Priority mark - normal priority backport-to-1.10 labels Oct 21, 2019
@andrzejewsky andrzejewsky added this to the 1.11.0-rc2 milestone Oct 21, 2019
@gibkigonzo
Copy link
Contributor

I've tested it in 1.11 and it doesn't occur. Probably it happens in 1.10 because on category page is stored wrong product in cache. I will try to fix it for 1.10

@undefinederror
Copy link
Contributor Author

Hi @gibkigonzo ,
Well in 1.11 code seems to be well refactored, also the product object isn't mutated in place, but used to extend an empty object which gets then returned.
image

If this has already been fixed in 1.11 then cool, I guess this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-1.10 bug Bug reports P3: Normal Priority mark - normal priority
Projects
None yet
Development

No branches or pull requests

4 participants