This topic has 2 replies, 2 voices, and was last updated 9 months, 3 weeks ago ago by Luca Rossi
Hi.
I have set up related products for my store but they are sorting randomly. Every time I refresh the page the order of the related products changes.
I would like to sort them by custom order in the WooCommerce product menu.
I don’t see this option in the related products settings of the template. I also can’t find a code snippet on the internet to modify the default order of related products.
Could you please help me?
Thank you very much.
Dear Jonathan,
We hope this message finds you well.
We kindly request that you insert the following snippet of code into the functions.php file located within your child theme directory:
add_filter('woocommerce_cross_sells_orderby', 'n2t_woocommerce_cross_sells_orderby', 100);
function n2t_woocommerce_cross_sells_orderby(){
// Options include: menu_order, title, date, price, sku
return 'menu_order';
}
We trust that this addition will be beneficial to your setup.
Should you have any further questions or require assistance, please do not hesitate to reach out.
Warm regards,
The 8Theme Team
You must be logged in to reply to this topic.Log in/Sign up