-
Notifications
You must be signed in to change notification settings - Fork 219
Allow shoppers to sign-up for an account from the Checkout block #3331
Conversation
- remove isExperimental from block/editor js (the block is already gated to plugin only) - gate entire service class to feature plugin && Woo >= 4.7 - this ensures our custom email and set password flow are only active for supported woo version, if blocks plugin is active - also refactored the gating logic so the woo version check is used to gate all code
const showCreateAccountOption = | ||
isExperimentalBuild() && compareWithWooVersion( '4.7.0', '<=' ); | ||
// Also implicitly gated to feature plugin, because Checkout | ||
// block is gated to plugin |
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 wanted a full stop on this comment, but eslint action told me to remove it cc4f7ed!
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 wonder if the lint rule got confused by the Checkout
sentence case at the end of the line. Might be a bug in the rule.
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 we need to remove isExperimentalBuild()
from these lines:
https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/assets/js/blocks/cart-checkout/checkout/form/contact-fields-step.js#L34
https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/assets/js/blocks/cart-checkout/checkout/block.js#L93
Another detail (not blocking): I saw AddressStep
doesn't have allowCreateAccount
in the propTypes, it would be nice to add it to ensure it's always a bool.
Besides that, everything was working and testing fine on my end, so pre-approving. 👍
Feature: Allow shoppers to sign-up for an account from the Checkout block (WooCommerce Blocks plugin only).
Do we need to state that it's a WC Blocks plugin only feature? Currently the Checkout block is also only available in the feature plugin so it sounds redundant.
- "Create Account?" checkbox in address/contact component - logged-out prompt logic - handle case when signup is enabled and guest checkout is not enabled, i.e. checkout requires automatic signup
Size Change: -129 B (0%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
Thanks for the review @Aljullu - good catch. I've also added to proptypes and tweaked the title/changelog since checkout block is plugin-only. I'll do another round of testing with release build and Woo 4.6.x and 4.7 RC to double-check there aren't any holes in the logic, then merge & ship 3.7.0 🚢 |
Fixes #3286
This PR removes the
isExperimental
feature flag for the checkout signup feature, so it can be launched to stores using WooCommerce Blocks feature plugin. 🎉The feature gating is implemented as follows:
allowCreateAccount
is only displayed if store is running WooCommerce 4.7 or newer.To summarise:
If a store is running WooCommerce Blocks plugin, and WooCommerce 4.7 or newer, all features will be available:
If the store is running an older version of WooCommerce, or the blocks plugin is not active, then no features should be available:
Screenshots
See related previous PRs for details of what's changed and how the feature works.
#2851
#3236
woocommerce/woocommerce#27898
How to test the changes in this Pull Request:
Note: When we next update the package included in WooCommerce Core, we'll need to confirm that checkout signup is not available (unless recent blocks plugin is active).
Changelog