-
Notifications
You must be signed in to change notification settings - Fork 219
Preparation for including Blocks as the default checkout experience in WC 8.3 #11372
Preparation for including Blocks as the default checkout experience in WC 8.3 #11372
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: 0 B Total Size: 1.54 MB ℹ️ View Unchanged
|
$pages['cart']['content'] = '<!-- wp:woocommerce/classic-shortcode {"shortcode":"cart"} /-->'; | ||
$pages['checkout']['content'] = '<!-- wp:woocommerce/classic-shortcode {"shortcode":"checkout"} /-->'; | ||
|
||
if ( '<!-- wp:shortcode -->[woocommerce_cart]<!-- /wp:shortcode -->' === $pages['cart']['content'] ) { |
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.
So we're only replacing if this is the full content of the page? not a single line jump or extra filter? Why not replace '<!-- wp:shortcode -->[woocommerce_cart]<!-- /wp:shortcode -->'
with '<!-- wp:woocommerce/classic-shortcode {"shortcode":"cart"} /-->'
?
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.
You are right, but to keep previous behaviour (and possible bugs but not introduce new ones) I chose to target that specific content (most probably coming from woocommerce_create_pages default filter value).
This won't actually run on WC activation due to it being done in a child process. Currently it only applies to Tools > Create pages.
It is important to ship this on 10.4.0 so that functionality doesn't create pages with shortcodes for users with blocks 11.4.0 but WC <8.3
That means WC 8.3 PR will only be fully testable by including this.
We can revisit this later, my plan was not to rock the boat too much right now.
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 agree this makes sense now that I reviewed the PR in core.
…fault-checkout-experience
What
This change adds a check when replacing shortcodes with classic shortcode block on default cart and checkout pages.
Why
With Blocks shipping as the default checkout experience on WC 8.3, we need to make sure users on a previous version of WC still get the classic shortcode block, but not after 8.3.
This is done by checking the filter default values for shortcodes.
Testing Instructions
Please consider any edge cases this change may have, and also other areas of the product this may impact.
WooCommerce Visibility
Required:
Checklist
Required:
[type]
label or a[skip-changelog]
label.Conditional:
[skip-changelog]
label is not present).Changelog