On product listing page I required new option in sort by section of tool bar . It will display product collection in following manner first it display the product which has position greater than one and remaining product based on most sold out.

Can anyone please guide me ?

1 Answer 1


As an ex developer, i tell You that need to overide the collection in source of your data. Select your product by filtering and sorting on position and obtain a first array, then a second array with the sold out value. Then merge the second array in the first by adding it to the end, send it as a collection.

As a functional expert, i suggest you to do it an other way: develop a cron in magento for updating the position depending on those value (your actual position + sold out). (Position is definitely the attribute to sort product the way you want)
It will easier to develop, to update and to manage.

Hope it'll help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.