• Hi,

    do you have a tweak i can use to hide related products from the product page, when upsell products are present please?

    i do have a function i use below, but it does not work when used with your plugin.

    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
    
    add_action( 'woocommerce_after_single_product_summary', 'related_upsell_products', 15 );
    
    function related_upsell_products() {
    	global $product;
    
    	if ( isset( $product ) && is_product() ) {
    		$upsells = version_compare( WC_VERSION, '3.0', '<' ) ? $product->get_upsells() : $product->get_upsell_ids();
    
    		if ( count( $upsells ) > 0 ) {
    			woocommerce_upsell_display();
    		} else {
    			woocommerce_upsell_display();
    			woocommerce_output_related_products();
    		}
    	}
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Dan Zakirov

    (@alexodiy)

    Hello

    Explain what you want to do?

    Plugin Author Dan Zakirov

    (@alexodiy)

    I understood what you want to do. It is necessary to look, I will try to give an answer in the near future

    Thread Starter donlee101

    (@donlee101)

    I just want to hide related product slider when upsell products are set so that there are not 2 rows under each other and I use that function above to do this in woocommerce. But there is some conflict with your plugin as it doesn’t work.

    Will look forward to your answer ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide related when upsell items are present’ is closed to new replies.