Hey,
Basically i have implemented tracking pixel right after a click on "I confirm my order" button, so whenever user clicks
on "I confirm my order...", it would track that particular user purchased successfully.and for that purpose i have override OrderConfirmation Controller. Only problem is in-case of paypal i didn't receive any tracking pixel on my site (http://www.abc.com/).
So my goal is to receive tracking pixel on my site whenever user successfully purchased ,using any payment method(paypal, pay by bank-wire, pay by cheque).Below is the code snippet so you get better idea from code:
class OrderConfirmationController extends OrderConfirmationControllerCore
{
public function initHeader()
{
....
$url = "https://www.abc.com/";
$data = array(
'VoucherCode' => $VoucherCode,
'Amount' => $OrderAmount
);
$data_string = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$result = curl_exec($ch);
return parent::initHeader();
}
}
Any help would be really appreciated.