WooCommerce upsell position/duplication

Hi there,

Please see page: https://fabbri-racks.co.uk/product/bici-exclusive-deluxe-2-13-pin

I’ve renamed my Upsells to ‘Optional Extras’, and Related Products has become ‘You May Also Like’.

I’m using the Booster for WooCommerce plugin to place the Upsells/Optional Extras above the Related Products/You May Also Like. However, in doing so I get the same row duplicated at the bottom of the page. If I turn off the Upsells/Optional Extras option in the Pro Theme Settings, I lose both.

Looking at the WooCommerce php for Single Product pages, they should display that way around by default, which makes me think there’s something in Pro that’s overriding it.

Any help you could give me would be gratefully appreciated!

Thanks,
Shaun

Hi Shaun,

Thanks for writing in! Upon checking your referenced page, I could not find any duplicate rows. Were you able to resolve the issue? If not also try clearing your cache before testing.

If you’re still having issues, please provide us with a screenshot to understand your issue.

Thanks!

Hi,

Yes, sorry - I had to turn off the Booster module as the client didn’t want the duplicate.

As per your screenshot, what I want to do is place the Optional Extras row above the ‘You May Also Like’ row.

Is there any way to do this?

Thanks,
Shaun

Hey Shaun,

Yes, the theme does override the position of Related Products section and the Upsell section. To flip them, you can add this code in your child theme’s functions.php. Provided that you’ve copied everything and there’s no function from third party plugins that will interfere, this should work. See https://youtu.be/EO2ID7hvkwk

/*
Flip Related Products and Upsell Position
*/

add_action( 'after_setup_theme', 'flip_related_products_upsell');

function flip_related_products_upsell() {
  remove_action( 'woocommerce_after_single_product_summary', 'x_woocommerce_output_related_products', 20 );
  add_action( 'woocommerce_after_single_product_summary', 'x_woocommerce_output_related_products', 21 );
  remove_action( 'woocommerce_after_single_product_summary', 'x_woocommerce_output_upsells', 21 );
  add_action( 'woocommerce_after_single_product_summary', 'x_woocommerce_output_upsells', 20 );
}

Hope that helps.

Worked perfectly, thank you!

Glad we were able to help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.