The following code can be inserted into the checkout_process header immediately after the instruction to zen_mail the user a confirmation, but before the copy has been sent to the administrator (so that FEEFO errors can be reported to the administrator)
$feefopath = substr(HTTP_SERVER,7);//removing the 'http://' from the start
$password = "password";
$email = $order->customer['email_address'];
$username = $order->customer['firstname'] . ' ' . $order->customer['lastname'];
$desc = '';
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
if ($i)
$desc.=', ';
if ($order->products[$i]['qty'] > 1)
$desc.= $order->products[$i]['qty'].' x ';
$desc.= $order->products[$i]['name'] ;
}
$amount = $order_totals[0]['value'];
$itemref = $insert_id;
//NOTE REMOVE 'testing = true' for live sales
//$url="http://www.feefo.com/feefo/entersaleremotely.jsp?website=".urlencode($feefopath)."&password=".$password."&email=".urlencode($email)."&name=".urlencode($username)."&description=".urlencode($desc)."&amount=".$amount."&itemref=".$itemref."&testing=true";
$url="http://www.feefo.com/feefo/entersaleremotely.jsp?website=".urlencode($feefopath)."&password=".$password."&email=".urlencode($email)."&name=".urlencode($username)."&description=".urlencode($desc)."&amount=".$amount."&itemref=".$itemref;
//debug line - remove
//$email_order.="<br>FEEFO url: ".$url."<br>";
$response = fopen( $url, "r" ) ;
if ( $response ){
$responsetext .= fgets($response, 4096);
fclose($response);
}
if (substr(trim($responsetext),0,4) != "true")
$email_order.="<p>FEEFO error: ".trim($responsetext)."</p>";
//end of feefo code
Find out how it works. Take a Feefo test drive, or register now