I have my products ordered by most sold, with the built in function in Woocommerce. But I want to put a few products on the top even if they are not the most sold. Can this be done with some custom code?
For example, create a custom sort by most sold, but if these products ID(s) are present, put them on top?
2
Answers
I manage to solve this by using this code:
For a specific category I change the orderby to date and then set date accordingly as the order that I want. The rest of the products in all the other categories are sorted by most sold.
Not the way I asked the question, but its another way to achieve what I want.
To arrange your product as your wish you can use plugins like:
. And also you can use WooCommerce settings too. You can change menu order as you wish.
path:
or you can
of your products..