Pregunta

Magento/Cataloggraphql/etc/graphql/di.xml

 <type name="Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\LayerBuilder">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="price_bucket" xsi:type="object">Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Price</item>
                <item name="category_bucket" xsi:type="object">Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Category</item>
                <item name="attribute_bucket" xsi:type="object">Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Attribute</item>
            </argument>
        </arguments>
    </type>

here based on this

filter layer (aggregations) in magento 2

showing

price

category

custom_attributes

here

i want to change the order of this

expected result (order only changed)

category

price

custom_attributes

i tried to copy to my custom module but

don't change in order

when i change order in core file it working as expected.

how i can achieve this?

¿Fue útil?

Solución

found answer

MyModule/etc/graphql/di.xml

 <type name="Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\LayerBuilder">
        <plugin name="category_aggregation_order_change" type="Vendor\Mymodule\Plugin\LayerBuilder" disabled="false"/>
    </type>

using

after plugin

to solved this problem.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange
scroll top