Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #259104

    Hi all,

    Anybody any idea why this wont work in my enfold childtheme functions.php:

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

    I think I need some code prior to this so it checks here first?

    One more question, does the enfold childtheme functions.php need to be closed at the end with ?> or explicitly not, I found that the childtheme kriesi posted is missing this php closure tag….

    Kind regards,
    Thomas

    #259163

    Overrides in functions.php work fine for me.

    You might try:

    // remove related products
    function wc_remove_related_products( $args ) {
    return array();
    }

    add_filter(‘woocommerce_related_products_args’,’wc_remove_related_products’, 10);

    • This reply was modified 10 years, 7 months ago by cryscryb.
    #259164

    Found it here (there are some other suggestions on this page also that might be better):
    http://wordpress.org/support/topic/remove-related-products-from-bottom-of-product-pages

    • This reply was modified 10 years, 7 months ago by cryscryb.
    #259247

    Hi!

    Thank you for visiting the support forum!


    @cryscryb
    : Thanks for helping out.


    @borkent
    : You can use this on the child theme’s functions.php:

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

    Cheers!
    Ismael

    #259260

    Hi both,

    Tried above and somehow its not working.
    My childtheme functions.php is now:

    <?php
    
    /*
    * Add your own functions here. You can also copy some of the theme functions into this file. 
    * WordPress will use those functions instead of the original functions then.
    */
    
    add_theme_support('avia_template_builder_custom_css');
    remove_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_output_related_products', 20);
    #259265

    Somehow it seems that my childthemes functions.php doesnt work…

    For the time being I css fixed it with:

    .single-product div#av_section_1 {
    display: none;
    }

    But ofcourse this is not a real solution here :).

    #259606

    Hey!

    Try:

    function avia_remove_func() {
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
    }
    add_action( 'init', 'avia_remove_func');

    Regards,
    Josue

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.