Fix 'Show Sorting Dropdown' attribute ignored in All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/2019)
* Fix 'Show Sorting Dropdown' attribute ignored in All Products block * Update snapshot
This commit is contained in:
parent
c7e20c29d9
commit
b67e5a5f10
|
@ -52,11 +52,14 @@ const blockSettings = {
|
|||
* @param {Object} attributes Attributes to save.
|
||||
*/
|
||||
save( { attributes } ) {
|
||||
const dataAttributes = {};
|
||||
Object.keys( attributes )
|
||||
.sort()
|
||||
.forEach( ( key ) => {
|
||||
dataAttributes[ key ] = attributes[ key ];
|
||||
} );
|
||||
const data = {
|
||||
'data-attributes': JSON.stringify(
|
||||
attributes,
|
||||
Object.keys( attributes ).sort()
|
||||
),
|
||||
'data-attributes': JSON.stringify( dataAttributes ),
|
||||
};
|
||||
return (
|
||||
<div
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
exports[`All Products can be created 1`] = `
|
||||
"<!-- wp:woocommerce/all-products {\\"columns\\":3,\\"rows\\":3,\\"alignButtons\\":false,\\"contentVisibility\\":{\\"orderBy\\":true},\\"orderby\\":\\"date\\",\\"layoutConfig\\":[[\\"woocommerce/product-image\\"],[\\"woocommerce/product-title\\"],[\\"woocommerce/product-price\\"],[\\"woocommerce/product-rating\\"],[\\"woocommerce/product-button\\"]]} -->
|
||||
<div class=\\"wp-block-woocommerce-all-products wc-block-all-products\\" data-attributes=\\"{"alignButtons":false,"columns":3,"contentVisibility":{},"isPreview":false,"layoutConfig":[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],"orderby":"date","rows":3}\\"></div>
|
||||
<div class=\\"wp-block-woocommerce-all-products wc-block-all-products\\" data-attributes=\\"{"alignButtons":false,"columns":3,"contentVisibility":{"orderBy":true},"isPreview":false,"layoutConfig":[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],"orderby":"date","rows":3}\\"></div>
|
||||
<!-- /wp:woocommerce/all-products -->"
|
||||
`;
|
Loading…
Reference in New Issue