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

Recognise if Product Collection is located inside Cart or Checkout blocks #46059

Merged

Conversation

kmanijak
Copy link
Contributor

@kmanijak kmanijak commented Mar 29, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

In #43997 we implemented a location/context recognition for Product Collection block. Among others, the logic should recognize if we're in scope of Cart and Checkout. While it did a good job with templates, the logic didn't take into account if Product Collection block is placed inside Cart or Checkout blocks.
It will be a common use case for example with Upsells and Cross-Sells collections.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

Prerequisites to testing:

  1. To verify the location, go to Developer Tools -> Network tab
  2. Search for: product isproductcollection

Testing steps:

  1. Create new post
  2. Insert Cart block
  3. Somewhere inside Cart block, insert Product Collection block
  4. Choose some collection, for example, Featured
  5. Expecxted: Verify the proper payload is sent with the request by checking Payload tab.
  • location[type]: cart
image

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@kmanijak kmanijak added type: enhancement The issue is a request for an enhancement. team: Kirigami & Origami block: product collection Issues related to the Product Collection block labels Mar 29, 2024
@woocommercebot woocommercebot requested review from a team and Aljullu and removed request for a team March 29, 2024 11:21
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Mar 29, 2024
Copy link
Contributor

github-actions bot commented Mar 29, 2024

Hi @xristos3490, @Aljullu,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Member

@xristos3490 xristos3490 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, @kmanijak! Works as expected!

@kmanijak kmanijak merged commit 5d47c76 into trunk Apr 2, 2024
43 checks passed
@kmanijak kmanijak deleted the add/product-collection-location-cart-checkout-block-cases branch April 2, 2024 07:05
@github-actions github-actions bot added this to the 8.9.0 milestone Apr 2, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Apr 2, 2024
@rodelgc rodelgc added status: analysis complete Indicates if a PR has been analysed by Solaris needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Apr 2, 2024
senadir pushed a commit that referenced this pull request Apr 4, 2024
…ocks (#46059)

* Recognise if Product Collection is inside Cart or Checkout blocks

* Upgrade priority block recognition over templates

* Update the comments to better depict the flow

* Add changelog

* Simplify the logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
block: product collection Issues related to the Product Collection block needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris team: Kirigami & Origami type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants