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

Single Product Details Block > Duplicated star ratings #42475

Open
nefeline opened this issue Feb 14, 2023 · 3 comments · May be fixed by woocommerce/woocommerce-blocks#8431
Open

Single Product Details Block > Duplicated star ratings #42475

nefeline opened this issue Feb 14, 2023 · 3 comments · May be fixed by woocommerce/woocommerce-blocks#8431
Labels
status: stale Issues that have no had any activity for some time. team: Kirigami & Origami

Comments

@nefeline
Copy link
Member

nefeline commented Feb 14, 2023

While working on the new Single Product Details block woocommerce/woocommerce-blocks#8225, we have noticed the star ratings are duplicated when this block is used in the Single Product template alongside the classic template block:

Screenshot 2023-01-31 at 20 39 50

After further discussion, the decision was to ship the block as-is if the fix requires a significant time investment. While there might be an easy workaround path to be explored, opening this issue so we can work on it independently.

Steps to Reproduce

  1. Enable a block theme in your WordPress installation (go to Appearance > Themes, and select one of the block themes options, such as Twenty-Twenty-Three);
  2. Once the theme is enabled, go to Appearance > Editor (Beta);
  3. On the left side menu, click on Templates;
  4. Select the Single Product template, and click Edit;
  5. Using the Block Inserter, type: Single Product Details and add it to the Editor while still keeping the pre-existing WooCommerce Single Product Block that comes by default with the template.
  6. Save the changes. Access your website and click on a product;
  7. Make sure the Single Product Details block appears and contains the product description (Description tab), product attributes (Additional Information tab), and product reviews (Reviews tab).
  8. On the product reviews tab, notice the star ratings are duplicated (as demonstrated on the screenshot on this issue).
@thealexandrelara
Copy link
Contributor

Thank you for opening this issue regarding the star ratings duplication. Just porting my comment from that discussion to this issue:

I was investigating the issue and I found that it seems to be caused by the selector id in the single-product-reviews.php file in WooCommerce. The id for the select element is set to 'rating':

<select name="rating" id="rating" required>

If we change that id to another thing, the issue is gone, like this:

<select name="rating" id="rating-selector" required>

It seems we are also using the same id to another select element, and it is probably causing a conflict which makes the ratings stars to appear duplicated. Do you know if we can use some kind of hook to manipulate this behavior and change the id for that select element?

@github-actions
Copy link
Contributor

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

@github-actions github-actions bot added the status: stale Issues that have no had any activity for some time. label Apr 28, 2023
@Marc-pi
Copy link

Marc-pi commented Aug 25, 2023

this issue seems to be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: stale Issues that have no had any activity for some time. team: Kirigami & Origami
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants