• Resolved Meetanshi

    (@meetanshi)


    i`ve been through a lot of blogs and posts on SO before asking this question here.

    I’m using the WooCommerce plugin and was trying to get action hooks to be passed to order information.

    but inside hook code not working below is my plugin code`

    add_action( ‘woocommerce_before_checkout_form’, ‘ts_before_checkout_form’, 10 );
    function ts_before_checkout_form($product_Id){
    echo “hellos”;
    }

    but the action did not Fire at that moment but this will happen in WooCommerce Checkout Page Hooks

    before updating Woocommerce plugin it will work Fine

    • This topic was modified 3 years, 8 months ago by Meetanshi.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    I tried your code on my test site and it seems to be working properly.


    Link to image: https://snipboard.io/n68VdF.jpg

    Have you tried deactivating all plugins except WooCommerce and switch to the Storefront theme to see if the code works? If it does work in that environment, your theme or another plugins is conflicting with that code.

    You can find a more detailed explanation on how to do a conflict test here: https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Thread Starter Meetanshi

    (@meetanshi)

    I already have updated the  WooCommerce plugin and deactivated all other plugins as well but the problem still exists!
    
    However, it works fine if I deactivate the theme  "Twenty Twenty-Two Version: 1.1"
    
    Now the issue is the checkout hooks are not working if I activate the theme again. In order to find the cause, I add the code in Function.php file. Still, it doesn't show any error in a console!
    
    Please check the problem as I can't figure out whether the issue is in the theme or in the plugin.
    
    Please revert me back ASAP.
    
    Thanks in advance.
    Plugin Support Paulo P – a11n

    (@paulostp)

    Hello,

    Thanks for writing back!

    it works fine if I deactivate the theme “Twenty Twenty-Two Version: 1.1”
    Now the issue is the checkout hooks are not working if I activate the theme again.

    If that’s the case, then I suggest you report the issue in the Twenty Twenty-Two theme forum, so someone can look into fixing that issue: https://wordpress.org/support/theme/twentytwentytwo/

    In the meantime, if you’re still building your site, I would suggest you consider another theme.

    Please let us know if we can be of any further assistance.

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘WooCommerce Checkout Page Hooks Not Working’ is closed to new replies.