-
Notifications
You must be signed in to change notification settings - Fork 219
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThe
This comment was automatically generated by the TypeScript Errors Report
assets/js/blocks/add-to-cart-form/index.tsx
|
Size Change: +1.74 kB (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
@nefeline This is looking great! 🙌 Preapproving and just adding this small comment: I've been recently using the |
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.
Great job! Thank you for working on this, I'm approving this PR since everything is working as expected and the only thing we still need to discuss is about the block name
👋 LGTM! Thanks @nefeline I was thinking about the icon and the above discussion on the naming... to me, this is a CTA and it makes the most sense to use an icon that indicates that - like the core Button icon. However, I see that using the term 'button' in the description doesn't capture the full capabilities of the block. I am curious, if when we fully blockify this block we will separate it from a CTA that works for bookings, subscriptions etc.? I could see us creating variations of an |
This PR has been marked as If deemed still relevant, the pr can be kept active by ensuring it's up to date with the main branch and removing the stale label. |
Thanks!
Makes sense. Updated to match the core Button icon:
It might be too soon to define this, but I believe it makes sense to keep this block as a CTA dynamically changed depending on the product type even after "fully blockifying" it, as the action triggered by the button is directly dependent on the product type and what the user selected for the related options available. |
I'm going ahead and merging this one: there's some follow up work to do based on the most recent restructure done on #8225 (review) , opening a separate PR to handle these. |
Introduce the new Add to Cart Button block, allowing merchants to display a button in single product templates. Options are also displayed depending on product type. e.g. quantity, variation.
In this initial implementation, the block wraps the PHP equivalent for the button form by invoking
do_action( 'woocommerce_' . $product->get_type() . '_add_to_cart' );
and adding all the necessary support.Fixes #8188
Editor Preview
The editor preview is just a placeholder in this initial moment: the style will change a bit later on as @vivialice and I had a convo today, and she is actively working on a design for it. Here's the current implementation:
Update: the following screenshot now refers to the final copy/design as discussed here.
We discussed adding placeholders (gray boxes) for the additional content that may or may not be visible depending on the product type last week. As this approach was implemented, the end result was a bit polluted, so I defaulted to relying exclusively on the notice instead.
Editor Sidebar
PS: The icon for this block also needs design review/approval cc: @vivialice .
Frontend
The content displayed on the frontend is dynamically changed depending on the product type:
Simple Product
Grouped Product
Variable Product
External Product
Testing
Automated Tests
User Facing Testing
WooCommerce Visibility
Changelog