Digital experiences for all disciplines
New Landing › How can we help? › Atelier › Remove WooCommerce Action
New Landing › How can we help? › Atelier › Remove WooCommerce Action
- This topic has 11 replies, 4 voices, and was last updated 8 years by Mohammad – SUPPORT.
-
Posted in: Atelier
-
April 29, 2016 at 9:54 am #264524
Hi
I want to remove this action:
add_action( ‘woocommerce_single_product_summary’, ‘sf_product_short’, 20 );
It’s in /atelier/swift-framework/core/sf-woocommerce.php:983.
How do I remove this action from my child theme’s functions.php?
I need to be able to hook into the product excerpt, and in some cases show something else than the default excerpt.
Thanks
April 29, 2016 at 10:28 am #264543Hi,
Please paste this code at functions.php of child theme.remove_action( 'woocommerce_single_product_summary', 'sf_product_short', 20 );
Thanks
MohammadApril 29, 2016 at 12:38 pm #264577I did this… doesn’t work. That’s why I’m asking for help. ๐
I expect this to go away, https://db.tt/whB7FLBo, on this page https://www.memomiles.com/shop/hardcover-fotobog/
Maybe the remove_action is before the add_action?
Thanks
April 29, 2016 at 1:08 pm #264588Have you added that line of code to your child theme’s functions.php file?
– Kyle
April 29, 2016 at 1:37 pm #264600Are you shi***** me?! Did you read this part of my answer:
“I did this… doesn’t work. That’s why I’m asking for help. :-)”
๐
Thanks!
April 29, 2016 at 1:39 pm #264601No need to be rude, we are trying to help you.
I suggest adding your FTP details so we can see your functions file.
– David
April 29, 2016 at 1:54 pm #264603Hi David
I’m not rude – that’s why I added a ๐ in the message, and a “Thanks” in the end. ๐
I’m just a bit tired of supporters trying to reply as fast as possible instead of actually reading the question, and trying to help me. When I’m writing:“I expect this to go away, https://db.tt/whB7FLBo, on this page https://www.memomiles.com/shop/hardcover-fotobog/”
I’m trying to get you guys to tell me that my expectation is either right or wrong – not just to ignore it, and ask me if I’ve added it, when I just wrote that I did that. That’s rude! ๐
I’m a developer, and I’ve tried a lot of ways to get the remove_action to work without luck. Do you have a setup where you could try to add this to a child theme’s functions.php and see if it works? If it do, then something is wrong in my end, but if it don’t then you can debug it yourself.
Will that work?
Thanks
April 29, 2016 at 2:14 pm #264613Using a child theme is a little different when you want to remove an action.
You will want this:
function sf_unhook_atelier_functions() { remove_action( 'woocommerce_single_product_summary', 'sf_product_short', 20 ); } add_action('init','sf_unhook_atelier_functions');
April 29, 2016 at 2:26 pm #264623Tried that! ๐ Did you try this yourself in a local setup and it worked?
My question is: Are you guys 100% sure this works, because then I’ll continue to try to get it to work. ๐
And:
“I expect this to go away, https://db.tt/whB7FLBo, on this page https://www.memomiles.com/shop/hardcover-fotobog/”
I’m trying to get you guys to tell me that my expectation is either right or wrong – not just to ignore it, and ask me if I’ve added it, when I just wrote that I did that. That’s rude! ?”
Thanks
April 29, 2016 at 2:55 pm #264633The code works for me on my dev version, tried and tested before I posted.
Yes, you are correct in your thinking that the action is the right one to remove.
Add your FTP details and I’ll look at your code.
– David.
April 30, 2016 at 3:11 pm #264737Perfect! Thanks!
Knowing that this works, I went trough my code line by line, and found that my init function did fire before your add_action, so creating another init firing later did the trick!
Thanks for keeping helping me. ๐
Thanks
May 1, 2016 at 6:04 am #264761Hi,
Great thanks to David.
Mohammad -
Posted in: Atelier
You must be logged in to reply to this topic.