• Resolved oneteamsoftware

    (@oneteamsoftware)


    In your code you have code like that:
    $order = new WC_Order($orderId);

    it is an incorrect way of accessing orders and kills ability for woocommerce hooks to initialize different implementation of the order as well as it can cause various issues like duplicated orders and so on.

    Please change your code to use wc_get_order.

    So it will become like:
    $order = wc_get_order($orderId);

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Wrong way of accessing orders – IMPORTANT!’ is closed to new replies.