-
Notifications
You must be signed in to change notification settings - Fork 219
Interactivity API and Product Button #10006
Conversation
…erce/woocommerce-blocks into 6949-different-behavior-of-the-product-button-block-when-it-is-used-in-the-product-query-block-and-it-is-used-in-the-all-products-block
…ocks into 6949-different-behavior-of-the-product-button-block-when-it-is-used-in-the-product-query-block-and-it-is-used-in-the-all-products-block
…ocks into add/6949-interactivity-api-product-button
5f133ea
to
fa3f985
Compare
The release ZIP for this PR is accessible via:
Script Dependencies ReportThe
This comment was automatically generated by the TypeScript Errors Report
assets/js/atomic/blocks/product-elements/button/frontend.tsx
assets/js/interactivity/store.js node_modules/preact/src/jsx.d.ts |
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, outstanding work with that Luigi, Luís and David!
I left one last comment on an ongoing discussion, but besides that, everything looks good on my end.
I am going to bump this PR for the next release as it doesn't have a blocker label. |
…10338) * show notice when there is an error * Add initial implementation for store callbacks * Run `afterLoad` callbacks after `init` * Move cart state subscription to Product button * Remove cart-store from Interactivity API internals * Change callbacks with options and save only afterLoad callbacks * ProductButton: Add animation (#10351) * implement animation * improve logic * refactor logic * refactor code * address feedback about code style * add support for woocommerce_add_to_cart_quantity * Fix animation flickering * Introduce wp-effect, reduce the amount of numberOfItem variables to 2 and consolidate animation status * add support for added class * Remove unnecessary selector * Don't fetch cart if it was already fetched * remove added class --------- Co-authored-by: Luis Herranz <luisherranz@gmail.com> --------- Co-authored-by: Luigi <gigitux@gmail.com> Co-authored-by: Luis Herranz <luisherranz@gmail.com>
…ocks into add/6949-interactivity-api-product-button
…ocks into add/6949-interactivity-api-product-button
dfdc305
to
e672d85
Compare
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.
I think this is great, Luigi. Great work 🙂👏
I'd like to take a look at how we can migrate the NoticeBanner
to the Interactivity API, but we can do so in a new PR.
…ocks into add/6949-interactivity-api-product-button
* Add FrontendUtils class * fix conflicts * use locator * restore click usage * Product Button: Add E2E test * fix util * fix E2E tests * remove comment * Add E2E test to ensure that woocommerce_product_add_to_cart_text works * update sideEffects array * add zip and unzip as package * fix wp-env configuration * fix E2E test * add report * try now * try now * try now * fix E2E test * E2E: Add documentation for testing actions and filters. Fixes #10135 (#10206) * update description * fix label * rename files * make requestUtils private * remove page.goto * use toHaveCount * use productsToDisplay variable * fix E2E tests * rename class utils --------- Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
It is necessary work to a middleware to avoid this kind o...It is necessary work to a middleware to avoid this kind of code.
woocommerce-blocks/tests/e2e/utils/storeApi/store-api-utils.page.ts Lines 18 to 29 in 941e800
🚀 This comment was generated by the automations bot based on a
|
This PR adds the Interactivity API to the Product Button to improve the UX that the user has when add a product in the cart from the Product Grid. Check the video to see the differences:
Screen.Capture.on.2023-07-06.at.15-05-50.mp4
Screen.Capture.on.2023-07-28.at.12-06-26.mp4
Thanks to Interactivity API, the Product Button:
There is a follow-up PR that adds E2E tests #10036.
Testing
Automated Tests
User Facing Testing
/shop
).added
when the product is in the cart, and the button element has the classloading
while the product is added to the cart.Test ProductButton with cache plugin
WooCommerce Visibility
Performance Impact
Changelog