Bedankt voor je bestelling! Maar wacht nog even met het verlaten van deze pagina! We hebben nog een speciale aanbieding voor je!

BESTEL 1 EXTRA KETO PLUS VOOR SLECHTS €19,95
EN BESPAAR €70,-

1x KETO PLUS SLECHTS €19,95

© Copyright 2021. All Rights Reserved

Scroll naar boven
add_action( 'woocommerce_thankyou', 'my_custom_tracking' ); if ( ! function_exists('custom_meta_to_order') ) { add_action( 'woocommerce_checkout_create_order', 'custom_meta_to_order', 20, 1 ); function custom_meta_to_order( $order ) { $eftid = isset( $_COOKIE['ef_tid_c_a_1'] ) ? $_COOKIE['ef_tid_c_a_1'] : ''; $order->update_meta_data( "eftid", "$eftid" ); } } function my_custom_tracking( $order_id ) { // Lets grab the order $order = wc_get_order( $order_id ); //Everflow order objects $efOrder = array(); $efOrder['items'] = array(); $efOrder['oid'] = $order_id; $efOrder['amt'] = $order->get_total(); $efOrder['bs'] = $order->get_billing_state(); $efOrder['bc'] = $order->get_billing_country(); // Determine if any coupons were used for this transaction $coupons = ""; $couponCount = 0; foreach ($order->get_used_coupons() as $coupon) { $couponCount++; if($couponCount > 1) { // do not add comma unless more than one coupon $coupons .= ','; } $coupons .= $coupon; } $efOrder['cc'] = $coupons; // This is how to grab line items from the order $line_items = $order->get_items(); // This loops over line items $efItems = array(); foreach ( $line_items as $item ) { $efItem = array(); $product = $order->get_product_from_item( $item ); $efItem['ps'] = $product->get_sku(); $efItem['qty'] = $item['qty']; $efItem['p'] = $order->get_line_total( $item, true, true ); $efItems[] = $efItem; } $efOrder['items'] = $efItems; $javascriptCode = ' '; echo $javascriptCode; }