• Resolved Remco van Essen

    (@remcovanessen)


    Hi, I’m looking to get the upsell products in the same order as that Ive listed in the related/upsells field.

    When I use the menu order, it takes the order from the menu and not in the order from how they are being displayed on the individual product pages.

    add_filter( 'woocommerce_product_related_posts','wpse_123436_change_wc_related_products_relation_to_and' );
    function wpse_123436_change_wc_related_products_relation_to_and() {
       $get_related_products_args = array(
                  'orderby' => 'menu_order', // you can place id,title over here. 
                  'order'     => 'ASC',
                );
       return $get_related_products_args;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Remco van Essen

    (@remcovanessen)

    fixed it by sorting on price as all products are zero GBP anyway. hackish but works.

    Hi

    Please try this one:

    add_filter( 'woocommerce_product_related_posts_shuffle', '__return_false' );

    Good luck

    AJ a11n

    (@amandasjackson)

    Glad to hear it – thanks for letting us know!

    I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Woocommerce related/upsell products order’ is closed to new replies.