File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ export default async function decorate(block) {
1313 }
1414
1515 if ( type === 'category' ) {
16- const categoryId = document . querySelector ( '.block.product-list-page' ) ?. dataset ?. category ;
16+ const plpBlock = document . querySelector ( '.block.product-list-page' ) ;
17+ if ( ! plpBlock ) return ;
18+
19+ let categoryId = plpBlock . dataset ?. category ;
20+ if ( ! categoryId ) {
21+ categoryId = readBlockConfig ( plpBlock ) . category ;
22+ }
1723 if ( ! categoryId ) return ;
1824 filters . categories = categoryId ;
1925 }
@@ -36,7 +42,8 @@ export default async function decorate(block) {
3642 const section = fragment . querySelector ( ':scope .section' ) ;
3743 if ( section ) {
3844 block . closest ( '.section' ) . classList . add ( ...section . classList ) ;
39- block . closest ( '.section' ) . append ( ...section . childNodes ) ;
45+ const wrapper = block . closest ( '.enrichment-wrapper' ) ;
46+ section . childNodes . forEach ( ( child ) => wrapper . parentNode . insertBefore ( child , wrapper ) ) ;
4047 }
4148 } ) ;
4249
You can’t perform that action at this time.
0 commit comments