-
Notifications
You must be signed in to change notification settings - Fork 221
Migrate Cart and Checkout Pages to the Template Editor when using a FSE theme #9339
Migrate Cart and Checkout Pages to the Template Editor when using a FSE theme #9339
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
assets/js/blocks/classic-template/constants.ts
assets/js/blocks/classic-template/test/utils.ts |
Size Change: 0 B Total Size: 1.11 MB ℹ️ View Unchanged
|
@@ -13,8 +12,14 @@ class CartTemplate { | |||
|
|||
/** | |||
* Constructor. | |||
* | |||
* Templates require FSE theme support, so this will only init if a FSE theme is active. |
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.
Let's use the term "Block theme" as it is the "official term" now. WP community is moving away from "FSE theme" (or FSE anything for that matter)
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.
While having the redirects is good to catch things like bookmarked items, or links added in ways we might forget, I think we should also consider filtering the page list table to remove the pages from any display.
That could be done in a followup though.
@nerrad one thing it does catch is the "edit page" link in the admin toolbar. So I agree it might be worth having both. Although...if we hide it, the user won't be able to remove that page manually. New users won't be affected if we find a way to prevent page creation on install. |
Well, I think we need to keep the page in the short term in case the user switches back to a classic theme... which is also a scenario we might need to account for in terms of behaviour. The primary value I see for hiding the page from the list table is to reduce confusion when people visit there as the entry point to view/edit their pages. While the redirect mitigates that confusion, the quick edit functionality is still there. |
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.
Just wow, this is great 🤩
…to add/page-migration
…SE theme (#9339) * Introduce woocommerce_blocks_template_content hook * Migrate cart and checkout page content to the template editor * Add redirection from edit page to edit template --------- Co-authored-by: Paulo Arromba <[email protected]>
…SE theme (#9339) * Introduce woocommerce_blocks_template_content hook * Migrate cart and checkout page content to the template editor * Add redirection from edit page to edit template --------- Co-authored-by: Paulo Arromba <[email protected]>
…SE theme (#9339) * Introduce woocommerce_blocks_template_content hook * Migrate cart and checkout page content to the template editor * Add redirection from edit page to edit template --------- Co-authored-by: Paulo Arromba <[email protected]>
* WIP: dirty attempt to dry run Cart & Checkout templates * Added Cart and Checkout to the template hierarchies * Merge branch 'trunk' into poc/cart_and_checkout_fse_templates * Updated cart & Checkout templates * Order Received FSE template (#8937) * Order Received template bootstrap * typo * WIP: new block * add logic here * Order received classic template * reverted constants.ts * Added the post title (buggy) * Corrected page title * Updated constants.ts * Fixed template typo * removed placeholder for order received block * add order-received template description * updated placeholder description * Formatting fixes * Template description. * replaced hardcoded string with OrderReceivedTemplate::SLUG --------- Co-authored-by: Luigi <[email protected]> * Code formatting (#8350) * Code formatting * page_template_hierarchy priority to 1 (#9323) Co-authored-by: Paulo Arromba <[email protected]> * Migrate Cart and Checkout Pages to the Template Editor when using a FSE theme (#9339) * Introduce woocommerce_blocks_template_content hook * Migrate cart and checkout page content to the template editor * Add redirection from edit page to edit template --------- Co-authored-by: Paulo Arromba <[email protected]> * Removed header and footer from checkout template. (#9378) * Removed header and footer from checkout template. * Removed header and footer from checkout template migration * Permalink solution for the checkout endpoint/template (#9406) * Checkout endpoint work * Move setting field to util * Include link to edit the template * Remove todo * Refactor checkout templates to share logic (#9411) * Sync endpoints with pages (#9426) * Switch to page syncing * Update settings descriptions --------- Co-authored-by: Paulo Arromba <[email protected]> * Migrate pages to templates once (#9488) * Migrate content on init, once * Skip migration if page does not exist * Put back HTML for header and footer parts * Fix page redirect due to wrong ID * fix loading template part * Removed unnecessary var * update cart and checkout html templates --------- Co-authored-by: Paulo Arromba <[email protected]> * Include a notice to redirect user to template editor (#9508) * Template Placeholder Design for the Order Received Template (#9602) * Load frontend styles in editor iframe * Update placeholder to include skeleton and updated icons * Update classic template configs * 1px border for .wp-block-woocommerce-classic-template__placeholder-copy * Show copy on focus * Sample data --------- Co-authored-by: Paulo Arromba <[email protected]> * Add simplified header on checkout template (#9607) * Added simplified header on checkout template * Moved simplified header to template part * updated constants.ts * added template part to checkout.html * Add missing translation * frontpage_template_hierarchy no longer needed * Allow plugin based template parts (#9667) * Merge branch 'trunk' into add/9288_cart-checkout-order-received_fse_templates * Synced templates on blockified folder * Add blockified order-received.html * removed WooCommerce prefix * Refactor/rebrand order received template to order confirmation (#9734) * rebrand order received to order confirmation * updated descriptions for templates * updated descriptions for order confirmation placeholder * Resolve merge conflict * Resolve merge conflicts * Resolve more merge conflicts after rebase * Fix formatting * Use patterns for localisation (#9883) * e2e tests for cart and checkout templates (#9939) * Merge branch 'trunk' into poc/cart_and_checkout_fse_templates * Merge branch 'trunk' into add/9288_cart-checkout-order-received_fse_templates * Resolve merge conflicts * Add e2e for permalink settings * Test that templates exist * Add test to check that templates can be edited * Add tests to confirm templates can be edited * Ensure cart has contents before running tests on frontend views * Commend out problem test * Make sure search has multiple results * Remove useThrottle - bad rebase * Revert changes to docs after rebase * Revert function call for noReviewsPlaceholder * Bad rebase * Reverts * Remove revertTemplate * Spacing * Wait for networkidle after navigation * Always wait for network * Use button roles in site editor * More specific button locator * Update option comparison * Fix template content * Disable failing tests * Disable failing classic template tests * Use enterEditMode * More enterEditMode usage * enterEditMode * Use test.skip * More robust selectors * Alt iframe selector --------- Co-authored-by: Paulo Arromba <[email protected]> * Skip flakey test --------- Co-authored-by: Luigi <[email protected]> Co-authored-by: Mike Jolley <[email protected]>
Adds a mechanism to migrate pages to the template editor by:
Default content is generated from the page content and the page title. This means if you're using a shortcode, or a block, on your cart/checkout page, it will automatically copy across to the FSE template.
Fixes #9334
Testing