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] Having a Post/ProductTemplate block within the Single Product breaks the expected execution for passing the context #45374

Open
1 of 5 tasks
xristos3490 opened this issue Mar 7, 2024 · 2 comments
Labels
focus: product Issues related to product or product page. team: Mothra WC Merchants activation and store management

Comments

@xristos3490
Copy link
Member

xristos3490 commented Mar 7, 2024

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

Adding a Query Loop or a Product Collection block within the Single Product container breaks the execution sequence, as expected by the Single Product's block context handler. That's because the woocommerce/product-template block's inner blocks are repeated for each query result, and these additional renders do not exist within the $this->single_product_inner_blocks_names array.

Expected behavior

The special needs of a Post/Product Template block should be utilized in the recurring process of passing the context.

Actual behavior

Currently, the Post/ProductTemplate blocks are rendering more inner blocks than whats expected when fetching the blocks inner blocks.

See
310572697-4c61194f-a7e9-4354-8009-f4f924e1680c (1)

Steps to reproduce

  1. Create a new page/post.
  2. Add a Single Product block and select a product.
  3. Add a QueryLoop block or a Product Collection block on top of the product title.
  4. Save and navigate to storefront.
  5. Notice the blocks being broken.

WordPress Environment

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.
@adimoldovan adimoldovan added focus: product Issues related to product or product page. team: Mothra WC Merchants activation and store management labels Mar 11, 2024
@jconroy
Copy link
Member

jconroy commented Mar 13, 2024

See sad

Just an FYI, that image seems to be private

@xristos3490
Copy link
Member Author

Thanks for catching this, @jconroy! Updated! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: product Issues related to product or product page. team: Mothra WC Merchants activation and store management
Projects
None yet
Development

No branches or pull requests

3 participants