• Hello! I found error in code. Woocommerce integration
    on line 269 it is supposed to be $this_order_key = $order->get_order_key();

    If not like this it generates error: You are accessing order_key directly.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    Thanks for letting me know this.

    There is already a fix for this issue, if you can download and replace this one file, it should solve for your as well:
    https://raw.githubusercontent.com/duracelltomi/gtm4wp/master/integration/woocommerce.php

    Have a great day,
    Thomas Geiger

    Thread Starter jurij_c

    (@jurij_c)

    Hello!

    I could not check right now your fix and see what was changed, but what I meant that it’s possible to do like this:

    $order = new WC_Order( $order_id );
    if ( $gtm4wp_is_woocommerce3 ) {
    $this_order_key = $order->get_order_key();
    } else {
    $this_order_key = $order->get_order_key();//was just $order->order_key;
    }

    Greetings!

    Plugin Author Thomas Geiger

    (@duracelltomi)

    There was a bug at the top of this file: the $gtm4wp_is_woocommerce3 variable was not populated correctly therefore the wrong branch of if() statement was executed on WooCommerce 3

    Thread Starter jurij_c

    (@jurij_c)

    Thanks!
    Update: I compared files in wordpress repository and link you have send – and they are identical without any fixes

    • This reply was modified 6 years, 7 months ago by jurij_c.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Accessing order key directly’ is closed to new replies.