• Resolved pascual80

    (@pascual80)


    Hello,

    Big fan of the plugin, Condless! Thank you for all your work!

    I am sometimes getting the following error on the woocommerce checkout page. The error is: “An unexpected error has occurred, please try again. This commerceOrder (Order Number Here) has been previously paid”

    It doesn’t always happen. But here is the following nginx php error I see in my logs with private info like IP’s and website address edited out. Hopefully I can get some guidance on this, would be much appreciated! Thanks! Just a side note: the “finalizar-compra” page is my checkout page, just renamed for Spanish.

    2023/10/19 15:00:45 [error] 2313327#2313327: *112 FastCGI sent in stderr: “PHP message: PHP Warning: ?Undefined array key “billing_country” in /public_html/wp-content/plugins/cities-shipping-zones-for-woocommerce/cities-shipping-zones-for-woocommerce.php on line 898PHP message: This commerceOrder 5336 has been previously paid” while reading response header from upstream, client: 180.00.000.00, server: website.com, request: “POST /?wc-ajax=checkout HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php8.1-fpm-website.com.sock:”, host: “website.com”, referrer: “https://website.com/finalizar-compra/”

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Condless

    (@condless)

    Hi Pascual,
    Please make sure the billing and shipping country field is not removed from Checkout.

    Thread Starter pascual80

    (@pascual80)

    Thanks for the reply. I tried that but am now getting another similar error. My checkout setup is basically the following: It is a gift shop so we have the billing section only be first and last name, telephone and email. And the shipping section includes all the details of the person receiving the gift – first and last name, telephone and address fields. It seems like no fields can be hidden for the plugin to work? Would appreciate any help on this. Thanks again, condless.

    I have the following fields unset in my theme functions.php file because we don’t use them.

        unset($fields['billing_address_1']);
        unset($fields['billing_address_2']);
        unset($fields['billing_state']);
        unset($fields['billing_city']);
        unset($fields['billing_postcode']);
        unset($fields['shipping_postcode']);

    Here is the new error I am getting:

    2023/10/26 14:59:58 [error] 217877#217877: *33735 FastCGI sent in stderr: “PHP message: PHP Warning: ?Undefined array key “billing_state” in /public_html/wp-content/plugins/cities-shipping-zones-for-woocommerce/cities-shipping-zones-for-woocommerce.php on line 899PHP message: PHP Warning: ?Undefined array key “” in /public_html/wp-content/plugins/cities-shipping-zones-for-woocommerce/cities-shipping-zones-for-woocommerce.php on line 899PHP message: PHP Warning: ?Undefined array key “billing_state” in /public_html/wp-content/plugins/cities-shipping-zones-for-woocommerce/cities-shipping-zones-for-woocommerce.php on line 900PHP message: PHP Warning: ?Undefined array key “billing_state” in /public_html/wp-content/plugins/cities-shipping-zones-for-woocommerce/cities-shipping-zones-for-woocommerce.php on line 912PHP message: This commerceOrder 5487 has been previously paid” while reading response header from upstream, client: 100.000.000.01, server: website.com, request: “POST /?wc-ajax=checkout HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php8.1-fpm-website.com.sock:”, host: “website.com”, referrer: “https://website.com/finalizar-compra”

    • This reply was modified 1 year, 1 month ago by pascual80.
    • This reply was modified 1 year, 1 month ago by pascual80.
    Plugin Author Condless

    (@condless)

    Hi,
    Please try to make the following modifications in the plugin’s main file:

    Replace this:

    if ( in_array( $data['billing_country'], get_option( 'wc_csz_countries_codes' ) ) ) {

    with this:

    if ( isset( $data['billing_country'], $data['billing_state'] ) && in_array( $data['billing_country'], get_option( 'wc_csz_countries_codes' ) ) ) {

    and replace this:

    if ( in_array( $data['shipping_country'], get_option( 'wc_csz_countries_codes' ) ) ) {

    with this:

    if ( isset( $data['shipping_country'], $data['shipping_state'] ) && in_array( $data['shipping_country'], get_option( 'wc_csz_countries_codes' ) ) ) {
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘This commerceOrder has been previously paid (php Error)’ is closed to new replies.