Magento 2 - Sort by Brand and Position?
-
14-04-2021 - |
Question
Is it possible to sort by A the Brand alphabetically and then B by Position Programmatically.
No correct solution
OTHER TIPS
Yes, It is possible to sort by A the Brand alphabetically and then B by Position. As you can see this functionality is already implemented in Amasty's extension.
using collection you can sort and filter everthing. Here's the link to filter by attribute: https://www.mageplaza.com/devdocs/how-get-product-collection-magento-2.html
And here the sort by: $productCollection->addAttributeToSort('update_at', 'DESC')
Cheers
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange