• Resolved jeffb502

    (@jeffb502)


    I have a website where the checkout is loading by ajax, I am simply calling the shortcode [woocommerce_checkout] and I am printing it to the screen with ajax, it works fine for everything except when stripe is activated, the js and css files are not queued and the nonce are not being generated, I think I am missing something but I’m not sure what it is, I would appreciate any information on this, thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @jeffb502,

    What nonce are you referring to?

    The plugin enqueues the JS scripts during the payment_fields() method call that should be triggered by the checkout page shortcode. Whether it’s ajax or something else shouldn’t matter.

    You are probably not triggering the print_footer_scripts action since you’re just calling the checkout shortcode via ajax. You need to make sure you are also triggering the actions that WordPress triggers during a normal checkout page load.

    Kind Regards,

    Thread Starter jeffb502

    (@jeffb502)

    This is very strange, I have checked and I see that if I use the code echo do_shortcode (‘[woocommerce_checkout]’); to add the shortcode via php the stripe checkout doesn’t work, however if I add the shortcode [woocommerce_checkout] from the wordpress editor the stripe files seem to be correctly queued, why is this, how do I make the shortcode work from php, Well I need it to make the call through ajax, in advance thanks for your help

    Plugin Author Payment Plugins

    (@mrclayton)

    @jeffb502 What you’re trying to do isn’t really related to my plug-in or the support that we provide.

    Per my previous response, by you just calling the short code via Ajax you are missing some of the required actions that print scripts in the footer.

    bensdev

    (@bensdev)

    hello there i have the same issue and i would like to know if you founded a fix for it ?
    when i put the [woocommerce_checkout] shortcode inside page with the wordpress editor it works fine and the scripts are loaded into the footer; but when i call do_shortcode(‘woocommerce_checkout]’) from my plugin the scripts arnt loaded and there for i dont have the card input in my front end …

    HELP ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Stripe is not triggered with shortcodes by ajax’ is closed to new replies.