Home > Net >  display woocommerce upsells products under product gallery
display woocommerce upsells products under product gallery

Time:09-10

can you help me? We use the following codes for related products, but what do we need to do for upsells?

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_output_related_products', 25);
function woocommerce_output_related_products(){
    $args = array( 
        'posts_per_page' => 4,  
        'columns' => 4,  
        'orderby' => 'rand' 
 ); 
    woocommerce_related_products( apply_filters( 'woocommerce_output_related_products_args', $args ) ); 
}

CodePudding user response:

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_upsell_display', 24 );
  • Related