I am looking to pass along the WooCommerce Variables "OrderID" and "Cart_total" into our Ad Tracking platform.
I was supplied with the tracking code which needed to be implemented and am having issues getting these variables into AdForm.
Here's the snippet, which works perfectly, I think that I am not including the variables correctly.
Specifically, I was asked to provide the following variables:
sales: '$woocommerce->cart->get_cart_total();', orderid: '$order->get_id();'
But these are not working. I am unfortunately not a programmer (the programmer is on holiday). I think I need to call the variables somewhere.
There is no more cart data in Order received (thankyou) page, so you surely mean
$order->get_total(). Also there is some mistakes in your code.
So you need:
WC_Orderobject from the missing
$order_idargument in your hoked function
Try the following: