Support » Plugin: WooCommerce » Pixel – Sub-total (minus discounts)

  • Resolved todrose



    Does anyone know of a WooCommerce tag that I can use in a conversion pixel that would pull the order sub-total (minus discounts)? Here is an example of the conversion pixel, it’s using the sub-total “get_subtotal()” and I cannot find any Woo tags that calculate the sub-total minus discounts. Any help greatly appreciated!

    add_action( ‘woocommerce_thankyou’, ‘my_custom_tracking’ );
    function my_custom_tracking( $order_id ) {
    $order = wc_get_order( $order_id );
    $total = $order->get_subtotal();
    $order_email = $order->billing_email;
    $order_num = str_replace(‘#’, ”, $order->get_order_number());
    echo ‘<iframe src=”; . $total . ‘&adv_sub=’ . $order_num . ‘&adv_sub4=’ . $order_email . ‘” scrolling=”no” frameborder=”0″ width=”1″ height=”1″></iframe>’;

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.