This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Add to the Product Button block the support for the Product Query block #6948
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds to the Product Image Block the support for the Product Query Block #6911
…oocommerce/woocommerce-blocks into add/add-to-cart-product-query
…oocommerce/woocommerce-blocks into add/add-to-cart-product-query
rubikuserbot
requested review from
a team and
danieldudzic
and removed request for
a team
August 19, 2022 15:50
gigitux
force-pushed
the
add/add-to-cart-product-query
branch
from
August 19, 2022 15:50
57f914f
to
9274aca
Compare
The release ZIP for this PR is accessible via:
|
Size Change: +72 B (0%) Total Size: 893 kB
ℹ️ View Unchanged
|
gigitux
added
skip-changelog
PRs that you don't want to appear in the changelog.
block-type: product elements
Issues related to Product Element blocks.
type: refactor
The issue/PR is related to refactoring.
labels
Aug 19, 2022
gigitux
changed the title
Add to the Product Button Block the support for the Product Query Block
Add to the Product Button block the support for the Product Query block
Aug 19, 2022
gigitux
force-pushed
the
add/add-to-cart-product-query
branch
from
August 22, 2022 12:58
48d7914
to
a69a568
Compare
…ocks into add/product-image-product-grid
…ocks into add/product-image-product-grid
…oocommerce/woocommerce-blocks into add/add-to-cart-product-query
…ocks into add/add-to-cart-product-query
danielwrobert
approved these changes
Sep 27, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
I confirmed the following:
- On
trunk
, the All Products block to loads theproduct-button-frontend.js
on the frontend. - On
trunk
, if I add a Product Button block to the Product Query block, the script is also loaded. Note that the overall behavior is a little odd in this particular scenario but I imagine that to be expected. - On this PR branch, adding a Product Button block to the PQ block does not render the script on the frontend and the behavior / UI is as expected.
- Confirmed the Add to cart behaviour in WooCommerce > Settings behaves as expected.
Nice work! 🍻
Thanks for the review! @danielwrobert 🚀 |
dinhtungdu
reviewed
Oct 5, 2022
import { Disabled } from '@wordpress/components'; | ||
import { useBlockProps } from '@wordpress/block-editor'; | ||
import { useEffect } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why we don't use useEffect
from @wordpress/element
here?
(Came across this PR while exploring the Query Block.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 tasks
senadir
pushed a commit
to senadir/woocommerce-blocks
that referenced
this pull request
Nov 12, 2022
…ck (woocommerce#6948) * Adds to the Product Image Block the support for the Product Query Block Adds to the Product Image Block the support for the Product Query Block woocommerce#6911 * use shared config * use shared config * use shared config * Add to the Product Button Block the support for the Product Query Block * Add to the Product Image Block the support for the Product Query Block * fix lint errors * address feedback * set grid view and font-size L as default
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
block-type: product elements
Issues related to Product Element blocks.
skip-changelog
PRs that you don't want to appear in the changelog.
type: refactor
The issue/PR is related to refactoring.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is blocked by #6911
This PR adds to the Product Button block the support for the Product Query block.
Now, on the client side, when the Product Button Block is used in the Product Query block, the markup will be server side generated. Also, no javascript related to the Product Button block will be loaded.
Fixes #6785
Testing
N/A
User Facing Testing
Redirect to the cart page after successful addition
.Enable AJAX add to cart buttons on archives
.Also, consider that this block has a different behavior when it is used in the Product Query block as respect when it is used in All Products. We will address this issue in the next iteration #6949
WooCommerce Visibility