• Resolved BasicPro

    (@estudio-de-grabacion)


    Hello!

    Thanks for this great plugin, there’s a small glitch that happens in few occasions and makes “is_vat_exempt” post meta to be added multiple times.

    Steps to reproduce:
    Add product to cart
    Go to checkout
    Click on order on paypal (or other payment methods I guess).
    Click on the back arrow on your browser
    Click on order again.

    The last two steps can be repeated multiple times adding one more “is_vat_exempt” to the order every time. Because Woocommerce will not create a new order when this happens and only update the one created (unless there’s a total change).

    There are other glitches that happen sometimes when this situation occurs but I don’t think your plugin is responsible for them.

    Let me know if you need more information

    Regards
    Dídac

Viewing 1 replies (of 1 total)
  • Plugin Author Diego

    (@daigo75)

    The is_vat_exempt meta is added to new orders by WooCommerce, not by the EU VAT Assistant (e.g. method WC_Checkout::create_order(), which calls $order->add_meta_data( 'is_vat_exempt', $order_vat_exempt )). Our plugin doesn’t use that meta, it only uses a filter to (eventually) override its value on the fly.

    I would suggest to report the issue to the WooCommerce team. Perhaps the condition you describe (order, back, order, back) requires an extra check, so that the meta is only added once, or the call should be replaced with $order->update_meta_data() instead, to add the meta when it doesn’t exist or replace it when it exists.

Viewing 1 replies (of 1 total)
  • The topic ‘is_vat_exempt added multiple times’ is closed to new replies.