if($currentOrder == "discount"){
     $subject->getCollection()->order('((price_index.price - price_index.final_price) / price_index.price)', 'DESC');

how i get the discounted products at sort by option.


You can choose to create a custom module to help you with custom sorting.


Here is an example of the custom sorting mode, you can use it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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