Uncaught Error: Call to a member function get_order_number() on bool
-
I’m getting a Woocommerce logged error: “CRITICAL Uncaught Error: Call to a member function get_order_number() on bool” for the line that contains
$order->get_order_number();I know this question also involves GA Enhanced Ecomm, but is there something obviously wrong with that line?
Thanks
<script> //Get order number from localstorage var order_view = localStorage.getItem('order_id'); //only send to GA if order_view is null if(order_view == null || order_view != '<?php echo $order->get_order_number();?>') { <?php foreach ( $order->get_items() as $item ) : ?> ga('ec:addProduct', { 'id': '<?php echo $item['product_id']; ?>', 'name': '<?php echo $item['name']; ?>', 'brand': 'The Bro Basket', 'price': '<?php echo $item['line_subtotal']; ?>', 'quantity': '<?php echo $item['qty']; ?>' }); <?php endforeach; ?> } </script>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Uncaught Error: Call to a member function get_order_number() on bool’ is closed to new replies.