New Landing How can we help? Atelier Remove WooCommerce Action

Viewing 12 posts - 1 through 12 (of 12 total)
  • Posted in: Atelier
  • #264524
    nosuchagency
    Member
    Post count: 226

    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

    #264543
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of child theme.

    remove_action( 'woocommerce_single_product_summary', 'sf_product_short', 20 );

    Thanks
    Mohammad

    #264577
    nosuchagency
    Member
    Post count: 226

    I 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

    #264588
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Have you added that line of code to your child theme’s functions.php file?

    – Kyle

    #264600
    nosuchagency
    Member
    Post count: 226

    Are 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!

    #264601
    David Martin – Support
    Moderator
    Post count: 20834

    No need to be rude, we are trying to help you.

    I suggest adding your FTP details so we can see your functions file.

    – David

    #264603
    nosuchagency
    Member
    Post count: 226

    Hi 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

    #264613
    David Martin – Support
    Moderator
    Post count: 20834

    Using 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');
    #264623
    nosuchagency
    Member
    Post count: 226

    Tried 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

    #264633
    David Martin – Support
    Moderator
    Post count: 20834

    The 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.

    #264737
    nosuchagency
    Member
    Post count: 226

    Perfect! 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

    #264761
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Great thanks to David.
    Mohammad

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.