WooCommerce: Upsell's Duplicated

Hi there,

I have moved the position of the Upsells to below the Product Image/Description.

However, it is then duplicated at the bottom of the Single Product Page.

If I turn off Upsells under Theme Options it removes both Upsells.

Is it possible to place the Upsell via Theme Options? Or must I continue to use my functions.php to perform this action?

Hi @RSI-DEV,

Thanks for reaching out.

Looks you only added another Upsells instead of moving it, the first one should be removed first. Would you mind providing the code that you added?

Thanks!

Hi @Rad

Code below:

// ---------------------------
// 1. Remove Upsells From Their Default Position
// NOTE: please make sure your theme is not already overriding this…
// …for example, see specific Storefront Theme snippet below

remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_upsell_display’, 15 );

// ---------------------------
// 2. Echo Upsells In Another Position

add_action( ‘woocommerce_after_single_product_summary’, ‘bbloomer_woocommerce_output_upsells’, 5 );

function bbloomer_woocommerce_output_upsells() {
woocommerce_upsell_display( 4,4 ); // Display max 4 products, 4 per row
}

Hi @RSI-DEV,

Please change it to this

add_action('after_setup_theme', 'change_upsell_setup', 999999 );

function change_upsell_setup () {

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
remove_action( 'woocommerce_after_single_product', 'woocommerce_upsell_display', 10 );
remove_action( 'woocommerce_after_single_product_summary', 'x_woocommerce_output_upsells', 21 );
add_action( 'woocommerce_after_single_product_summary', 'bbloomer_woocommerce_output_upsells', 5 );

} 

function bbloomer_woocommerce_output_upsells() {
woocommerce_upsell_display( 4,4 ); // Display max 4 products, 4 per row
}

Thanks!

@Rad thank you for the help as always

Where do I find the hooks etc that X uses with WooCommerce, this would make it easier to remove or add functions?

Also WooCommerce has a Carousel for both Upsells & Cross Sells and also for Thumbnails. Has this been turned off by X, I need to bring back that functionality due to the number of thumbnails and products?

Hi There,

All the hooks are located in this file: x/framework/functions/plugins/woocommerce.php.

It’s supported by WooCommerce plugin by default. You need to use the 3rd party plugin like this:

Regards!

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