2Hats . 1 minute

How to Show the Latest Products first in the list for selected Categories – Shopware 6?

In this article, we will discuss how to show the latest products first in the list of products in a category.

We need to add a custom subscriber for ProductEvents

 

Here we are using the SystemConfigService to get the plugin configuration. By using that the selected category or categories in the plugin configuration are fetched.

Then we need to sort the list by the created date.

Here are the services.xml and config.xml so it makes your life easier.

Hope it helps

blog
Greetings! I'm Aneesh Sreedharan, CEO of 2Hats Logic Solutions. At 2Hats Logic Solutions, we are dedicated to providing technical expertise and resolving your concerns in the world of technology. Our blog page serves as a resource where we share insights and experiences, offering valuable perspectives on your queries.
Aneesh ceo
Aneesh Sreedharan
Founder & CEO, 2Hats Logic Solutions
Subscribe to our Newsletter
Aneesh ceo

    Stay In The Loop!

    Subscribe to our newsletter and learn about the latest digital trends.