how to change the product list Date 'asc >> desc'
Now is showing asc.
I want to change is desc is default >> ?product_list_dir=desc
using Magento Version 2.2.4
thank you!
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityhow to change the product list Date 'asc >> desc'
Now is showing asc.
I want to change is desc is default >> ?product_list_dir=desc
using Magento Version 2.2.4
thank you!
Navigate to or create the following file
app/design/frontend/vendor/theme/Magento_Catalog/layout/catalog_category_view.xml
Add following code
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<referenceBlock name="category.products.list">
<action method="setDefaultDirection">
<argument name="dir" xsi:type="string">desc</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
</page>
Reference: Magento2: Default to sort by price descending not ascending