-
AuthorPosts
-
March 31, 2017 at 11:05 pm #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
April 1, 2017 at 7:15 am #770248Hey codecreative,
Please, to check some files, may you share your FTP credentials?
Best regards,
John TorvikApril 1, 2017 at 2:23 pm #770317hi john can you confirm what files ? Does my code I provided appear correct I am using a child theme
April 1, 2017 at 2:40 pm #770323provided in private section
April 4, 2017 at 10:45 am #771636hi 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
April 4, 2017 at 5:00 pm #771871Hi,
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,
AndyApril 5, 2017 at 3:28 pm #772614hi 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
April 6, 2017 at 7:25 pm #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.
April 6, 2017 at 9:22 pm #773510Hey!
That is a great solution.
Thank you very much for sharing it!Cheers!
BasilisApril 7, 2017 at 9:46 pm #774212Amazing 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’);April 8, 2017 at 9:37 am #774410Hi!
Happy you got it short out.
Thanks a lot
Regards,
Basilis -
AuthorPosts
- The topic ‘enfold woocommerce hooks not doing anything’ is closed to new replies.