1. Create a free account on Safe.Shop/join-now, fill in the form, you will receive an email with a login invite.

2. Connect to your personal account on Safe.Shop/admin, and click on My account > Edit webshops.

3. Click on your shop and scroll down, copy paste the Client ID & Client Secret.

4. Import "install_sql.sql" SQL file. i.e. Just copy the contents of the file and paste it in the query window.

5. Go to Admin -> Configuration -> My Store

Input

Client Secret & Client Id

6. Add Safe.Shop seal in website

Open catalog/includes/template_top.php file

In head tag, add this code

<!-- Safe.shop seal start -->
<script src="http://merchant.safe.shop/widget.js"></script>
<!-- Safe.shop seal start -->

7. Add code for safe.shop invites

catalog/checkout_process.php file

after
$cart->reset(true);

add
// Safe.shop API Call Start
$orders_query_new = tep_db_query("select * from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' and orders_id='".$insert_id."' order by date_purchased desc limit 1");

$orders_query_new_reslt = tep_db_fetch_array($orders_query_new);
$custnamess= explode(" ",$orders_query_new_reslt['customers_name']);
$postdata = [
"client_secret"=>API_SECRETKEY,
"client_id"=>API_CLIENTID,
"grant_type"=>"client_credentials",
"scope"=>"invites_readwrite",
];
$cl = curl_init("https://api.safe.shop/v1/oauth/token");
curl_setopt_array($cl, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postdata,
CURLOPT_RETURNTRANSFER => true
]);
$content = curl_exec($cl);
curl_close($cl);
$json = json_decode($content);
$atoken = $json->access_token;
$data = array(
"send_datetime" => $orders_query_new_reslt['date_purchased'],
"email" => $orders_query_new_reslt['customers_email_address'],
"firstname" => $custnamess[0],
"lastname" => $custnamess[1],
"telephone" => $orders_query_new_reslt['customers_telephone'],
"gender" => "",
"order_id" => $orders_query_new_reslt['orders_id'],
"language" => $language,
"city" => $orders_query_new_reslt['customers_city'],
"country" => $orders_query_new_reslt['customers_country'],
"segment" => "",
"channel" => "Oscommerce",
"customer_id" => $orders_query_new_reslt['customers_id']
);

$data_string = json_encode($data);
$url="https://api.safe.shop/v1/invites";
$headers = array(
'Content-Type: application/json',
sprintf('Authorization: Bearer %s', $atoken)
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);

// Safe.shop API Call Start

You are done! Congratulations, you can now enjoy fully the services of Safe.Shop.

If you need any assistance, please let us know as we are always happy to help!

Phone: +31 20 238 6081
Email[email protected]

 

 

Subscribe to our monthly newsletter with the best global online deals, reports, events & developments

Loading...