Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #770200

    hi is there anything in enfold that would prevent this from working

    remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_upsell_display’, 15 );
    add_action(‘woocommerce_single_product_summary’, ‘woocommerce_upsell_display’, 35);

    The add action line works fine but the remove action doesn’t. I’m trying to place our clients upsell in a more prominent area of the single product view.

    Please advise..

    I’ve tried placing the remove line in its own function as well, such as init and plugins loads etc and no matter what i can not remove it from the original place

    #770248

    Hey codecreative,

    Please, to check some files, may you share your FTP credentials?

    Best regards,
    John Torvik

    #770317

    hi john can you confirm what files ? Does my code I provided appear correct I am using a child theme

    #770323

    provided in private section

    #771636

    hi can someone advise me why enfold theme is preventing this standard woocommerce function from working? I have provided you with everything, wp access and ftp access please advise

    #771871

    Hi,

    Please update the theme to the latest version. That should fix any issues you are currently experiencing :)

    To update to the latest version follow the simple instructions here. (Or if you want the super detailed explanation you can read this blog post)

    If that does not help, feel free to reply here and we will take a closer look at the issue.

    Best regards,
    Andy

    #772614

    hi andy updating the theme made no change
    Can someone take a closer look as this is theme specific. If you swap to twnety twelve theme the code works fine (see below).

    Product to look at http://hungry-cactus.flywheelsites.com/product/charnwood-country-4-woodburner/

    You can see that the upsell isn’t removed in the summary area below the product information. This is my code in child theme functions.php

    add_action(‘woocommerce_single_product_summary’, ‘woocommerce_upsell_display’, 35);

    function avia_remove_func() {
    remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_upsell_display’, 15);
    }
    add_action( ‘init’, ‘avia_remove_func’);

    If you switch to twnety twelve this works fine. But in enfold there is no way at all to get the line to work
    remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_upsell_display’, 15);

    I would like to report this as a possible bug

    #773424

    @codecreative please take a look at /wp-content/themes/enfold/config-woocommerce/config.php line 1045 – 1047

    
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
    remove_action( 'woocommerce_after_single_product', 'woocommerce_upsell_display',10);
    add_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_output_upsells', 21); // needs to be called after the "related product" function to inherit columns and product count
    

    as well as line 1074

    
    add_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_display_output_upsells', 30); //display the related products and upsells
    

    Enfold itself removes the upsell section and adds it again with lower priority (later). If you want to change things you need to remove enfolds custom functions first. If you add your own take care you do not use priority 15 and 10 as those will be removed by Enfold. Just take something like 14 or 11.

    #773510

    Hey!

    That is a great solution.
    Thank you very much for sharing it!

    Cheers!
    Basilis

    #774212

    Amazing what a great contribution thank you @mensmaximus

    Thanks to you I managed to remove this with the following code. It is far from obvious and you’d expect the standard woocommerce functionality to work. I should have known if it is a theme specific issue that somewhere it is rewriting the rules but I’d have never found this out and by the looks of it this had the moderators puzzled. Thank you!

    function avia_remove_func() {
    remove_action( ‘woocommerce_after_single_product_summary’, ‘avia_woocommerce_output_upsells’, 21);
    }
    add_action( ‘init’, ‘avia_remove_func’);

    #774410

    Hi!

    Happy you got it short out.

    Thanks a lot

    Regards,
    Basilis

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘enfold woocommerce hooks not doing anything’ is closed to new replies.