Close
get_meta('_arz_click'); if (!$click) { return; } // not an affiliate sale foreach ($order->get_items() as $item) { $product = $item->get_product(); wp_remote_post('https://arizeon.sarstage.online/api/v1/track/conversion', [ 'headers' => [ 'Authorization' => 'Bearer ak_NLeLZpOWV4Sn7TkVcvyA1nPcA182KWls', 'Content-Type' => 'application/json', ], 'body' => wp_json_encode([ 'campaignId' => 'f9c7d514-ec43-4bd8-b83e-e491396afd33', 'event' => 'SALE', // Line-level id keeps each product's call distinct while still // being stable if the webhook is retried. 'orderId' => $order_id . '-' . $item->get_id(), 'amount' => (float) $item->get_total(), 'currency' => $order->get_currency(), 'sku' => $product ? $product->get_sku() : null, 'clickId' => $click, ]), 'timeout' => 15, 'blocking' => false, // never make a shopper wait on us ]); } }); ?>