Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #2245740
Woocommerce single page
Closed

Comments

  • Claudia started the conversation

    Hi, is it possible to enable/disable the related products in the single product page? And where can i set the number of related products visible?

    Thank you

  •  7,092
    Oliver replied

    Hi,

    You can remove it with this filter:

    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
    

    Or change the count with this one:

    function thegem_woocommerce_output_related_products_args_new($args) {
        $args['posts_per_page'] = 4;
        $args['columns'] = 4;
        return $args;
    }
    add_filter('woocommerce_output_related_products_args', 'thegem_woocommerce_output_related_products_args_new', 999);
    

    Add this code to the functions.php of the child theme.

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • Claudia replied

    I got it! Thank you

  •  7,092
    Oliver replied

    You're welcome!

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver