Home Forums WoodMart support forum woocommerce_checkout_process hook doesnt work properly

woocommerce_checkout_process hook doesnt work properly

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #224348

    ytrofr
    Participant

    Hey,
    tried to use this hook:
    add_action(‘woocommerce_checkout_process’, function(){
    wc_add_notice( __( ‘Please enter something into this new shiny field.’ ), ‘error’ );
    });

    but the function won’t work. any idea?

    #224419

    Artem Temos
    Keymaster

    Hello,

    Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?
    It is a WooCommerce hook and our theme has no relation to it.

    Regards

    #224440

    ytrofr
    Participant

    Hey,
    It does work with default theme twenty twenty, aso the problem is embeded within woodmart them3

    #224449

    Artem Temos
    Keymaster

    Hi,

    Please, describe to us your problems in a bit more details. Attach some screenshots and provide us with a list of steps on how to reproduce it on your website. Also, keep the default theme active so we can test how it works.

    Thank you in advance.

    #224455

    ytrofr
    Participant

    I tried to add new custom checkout validation using this
    add_action(‘woocommerce_checkout_process’, function(){
    wc_add_notice( __( ‘Please enter something into this new shiny field.’ ), ‘error’ );
    });

    This little sniplet should throw out error when trying to place order, but it didn’t

    #224474

    Artem Temos
    Keymaster

    Please, send us a step by step instruction about how to see this code in action on your website. Switch to default theme so we can see how it works and provide us your admin access.

    #224507

    ytrofr
    Participant

    The issue is pretty much straightforward, the hook doesnt funxtio funxtion properly

    #224535

    Artem Temos
    Keymaster

    The link you provided is not opening at all. And please, send us a step by step instruction about how to see this code in action on your website and switch to the default theme so we can see how it works and provide us your admin access.

    #224556

    ytrofr
    Participant

    Hey,
    Sorry i’ve pasted the wrong website, fixed in this message.

    From my dev:

    I tried to add new custom checkout validation using this
    add_action(‘woocommerce_checkout_process’, function(){
    wc_add_notice( __( ‘Please enter something into this new shiny field.’ ), ‘error’ );
    });

    This little sniplet should throw out error when trying to place order, but it didn’t

    the message it should give him is that:

    https://docs.woocommerce.com/wp-content/uploads/2012/04/WooCommerce-Codex-Checkout-Field-Notice.png

    So pretty much these are the instructions:

    1) He added the hook to functions.php
    2) Tried to initiate it when going to checkout
    3) not working

    #224561

    Artem Temos
    Keymaster

    OK, please, switch to the default theme where this hook works so we can see.

    Thank you

    #224574

    ytrofr
    Participant

    Done!

    #224576

    Artem Temos
    Keymaster

    Where exactly did you place the code in our theme? Please, send us a screenshot.

    #224629

    ytrofr
    Participant

    I’m very much sorry, my dev mistaken live site with test site, that’s why we couldn’t see the notice of the hook.

    Thanks for the wonderful support!

    #224749

    Artem Temos
    Keymaster

    Great, we are glad that you sorted it out.

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