-
Notifications
You must be signed in to change notification settings - Fork 219
Automatic migration path from Products to Product Collection - step 3 - allow reverting migration #10144
Automatic migration path from Products to Product Collection - step 3 - allow reverting migration #10144
Conversation
…s to Product Collection
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/shared/scripts/migration-from-product-collection-to-products.tsx
|
Size Change: +839 B (0%) Total Size: 1.36 MB
ℹ️ View Unchanged
|
… into add/migration-path-from-products-step-3-revert
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, I mentioned that in scope of: #10139:
What's your opinion? Should I add a fix within our repo? |
Thanks for the clarification! Let's merge as it is! 🚢 |
This is the third PR out of many that introduce automatic migration from Products to Product Collection blocks.
This PR adds a logic that allows to reverting automatic migration from Product (Beta) block to Product Collection.
Part of #9703
For more context, check out:
Testing
Automated Tests
User Facing Testing
Below you can find testing steps with multiple different scenarios. I didn't write detailed testing steps on how to change the settings of Products (Beta) block to keep it clean. However, if you're not familiar with these settings I recorded a video showcasing each of them, so please use it as a reference point. Video is split and attached to each section respectively.
Go to Editor and edit for example Product Catalog
Add Products (Beta) block with different settings/configurations/scenarios etc.:
PRODUCTS SET
inherits the query from the template
doesn't inherit the query from the template and has some filters applied (e.g. products on sale, handpicked products etc.). You can try multiple combinations that result in various set of product
My.Movie.mp4
LAYOUT
has "grid" layout and custom number of "columns", for example, 5
has "list" layout and custom number of "items per page", for example, 6
check with Gutenberg version below 16 (the layout was controlled on Query Loop level)
check with Gutenberg version 16+ (the layout properties were moved from Query Loop to Post Template block)
code-review-layout.mp4
PRODUCT ELEMENTS
change product template by adding additional elements and changing order (e.g. add Product Rating, Product SKU etc.) and change order of them
change "No Results" content
code-revbiew-template.mp4
STYLING
change styles on the "Product Template" level, for example color and background color
change styles of some Product Elements
styling.mp4
POSITION IN BLOCK STRUCTURE
nest Products (Beta) block inside other blocks (e.g. Group, Columns etc.)
OTHERS
Suggest your own combination or edge cases of settings that should be preserved during migration
Save the above
Change the REPLACE_PRODUCTS_WITH_PRODUCT_COLLECTION variable to
true
- replacement will be enabled for the next entries to the editorRefresh the Editor
Expected: All of the Products (Beta) blocks should be replaced with Product Collection block and preserve all of the configuration (Products Set, Layout, Product Elements, Styling, Position in blocks structure and Others)
Focus on one of the Product Collection blocks
Click "Revert to Products (Beta)"
Expected: All of the Product Collection blocks should be replaced back with Products (Beta) block and preserve all of the configuration (Products Set, Layout, Product Elements, Styling, Position in blocks structure and Others)
replacement.mp4
WooCommerce Visibility