A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
Go to file
Manish Menaria e88fa94026 Product Collection - Fix undefined layout attribute issue in migration (https://github.com/woocommerce/woocommerce-blocks/pull/11196)
This commit addresses an issue where layout attributes could become undefined during the block migration process. Alongside this fix, several updates were made to align the migration logic with the new `ProductCollectionDisplayLayout` types:

- Added logic to handle `undefined` layout attributes, defaulting to `DEFAULT_ATTRIBUTES.displayLayout`.
- Removed `ProductGridLayout` and `ProductGridLayoutTypes` from the types file.
- Imported `LayoutOptions` and `ProductCollectionDisplayLayout` from the product-collection module.
- Updated the `mapLayoutType` and `mapLayoutPropertiesFrom...` functions to use the new layout types.
- Updated transformation functions like `transformProductTemplate` and `transformPostSummary` to use the new types.

These changes not only resolve the issue with undefined layout attributes but also align the codebase with the new layout options, enhancing code maintainability.
2023-10-11 11:00:26 +05:30
plugins/woocommerce-blocks Product Collection - Fix undefined layout attribute issue in migration (https://github.com/woocommerce/woocommerce-blocks/pull/11196) 2023-10-11 11:00:26 +05:30