how to move Upsells after Related products section in WooCommerce

  • Open
  • gagandeep
    Participant
    October 8, 2019 at 9:29 am #3372
    gagandeep

    How can i change order of Up-sell & Related products sections on single product. It need to show first related products and then up-sell

  1. Manik Malhotra
    Keymaster
    Posts: 38
    October 8, 2019 at 9:30 am #3373
    Manik Malhotra

    Try the following that will move upsells after related products:

    add_action( 'init', 'move_upsells_after_related' );
    function move_upsells_after_related( ) {
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
    add_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 25 );
    }