• Resolved herculesdesign

    (@herculesdesign)


    I am encountering an issue with the WooCommerce plugin on my website. The problem seems to be related to the nonce header and payment method during the checkout process. Here are the details:

    1. When attempting to place an order, the browser console shows the following error:jsonCopy code{"code":"woocommerce_rest_missing_nonce","message":"Missing the Nonce header. This endpoint requires a valid nonce.","data":{"status":401}}
    2. To troubleshoot, I temporarily disabled the nonce check using the following filter:phpCopy codeadd_filter( 'woocommerce_store_api_disable_nonce_check', '__return_true' );
    3. After disabling the nonce check, the following message appears:jsonCopy code{"order_id":11909,"status":"checkout-draft","order_key":"wc_order_Duvi9v02ink9E","order_number":"11909","customer_note":"","customer_id":0,"billing_address":{"first_name":"Chris","last_name":"Jack","company":"","address_1":"Greater noida","address_2":"","city":"Test","state":"UP","postcode":"201306","country":"IN","email":"[email protected]","phone":""},"shipping_address":{"first_name":"Chris","last_name":"Jack","company":"","address_1":"Greater noida","address_2":"","city":"Test","state":"UP","postcode":"201306","country":"IN","phone":""},"payment_method":"","payment_result":{"payment_status":"","payment_details":[],"redirect_url":""},"additional_fields":[],"extensions":{}}
    4. This response indicates that the payment_method field is missing, even though the Cash on Delivery option is selected.

    After clicking Place Order, the order in the admin panel is visible but the loading icon spins endlessly.

    As a developer specializing in our theme, I am not in a position to make changes to the WooCommerce plugin. Therefore, I kindly request your assistance in resolving this issue.

    Could you please provide guidance on how to address the missing nonce header and ensure the payment method is correctly captured during the checkout process?

    Please note that this issue occurs only with the payment method: Cash on Delivery. I have also tested it by activating the default WordPress theme and deactivating all plugins. The problem still persists.

    Thank you for your support.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter herculesdesign

    (@herculesdesign)

    The issue was that the email address provided was a Gmail address, and the SMTP plugin was not installed. As a result, when the order confirmation email was not sent, the “Place Order” button stopped working. However, you should fix this so that the order goes through even if the email does not get sent.

    Plugin Contributor Nadir Seghir a11n

    (@assassinateur)

    Thank you for starting this thread, it’s marked as solved but it’s not clear to me if it’s fully resolved. Is it the SMTP plugin returning a fatal error? in most cases, placing an order should not spin forever, if you get a fatal, an error would be returned to your website.

    Thread Starter herculesdesign

    (@herculesdesign)

    When the recipient was set to a Gmail address in WooCommerce -> Settings -> Emails -> Email notifications -> New order, and the SMTP plugin was not configured, and the payment method selected was Cash on Delivery, clicking the Place Order button caused the loading icon to spin endlessly. However, the order was visible in the panel with a status of Pending. After setting the email address to one that belongs to the domain of the site and correctly configuring the WP Mail SMTP plugin, the Place Order button works correctly.

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @herculesdesign,

    ?After setting the email address to one that belongs to the domain of the site and correctly configuring the WP Mail SMTP plugin, the Place Order button works correctly.

    Thanks for sharing the additional details and confirming the issue has been resolved. This will help other merchants facing the same situation.

    ?However, you should fix this so that the order goes through even if the email does not get sent.

    Regarding this, it seems like a fringe case for an email configuration not properly set up, it’s best to address the root issue as you’ve done already.

    Feel free to start a new thread if you have any more questions.

    All the best,
    Omar

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.