Using Trusted Shops with osCommerce

Installation

The integration of the Trustbadge® in osCommerce must be done manually on the server.

The manual integration of the Trustbadge requires basic knowledge of code.

Step 1: Add Checkout Div

In order to integrate the Trustbadge into your shop, you must first insert an HTML code at the end of your order confirmation page ("Thank you page"). To do this, first log into the file system of your osCommerce installation and open the following file:

/osCommerceInstallation/catalog/checkout_success.php

Make a backup of your system before making changes to the files. Then you have the possibility to undo changes if necessary.

Scroll to the end of the file and find the </form> tag. Insert the following HTML code directly after the closing </form> tag.

<!-- Trusted Shops START-->
<?php
/********************************************
* Variables needed for Trusted Shops PopOut-Card,
* Please do not remove!
********************************************/
$ts_orders_query = tep_db_query("select orders_id,
customers_email_address,customers_id, currency,payment_method from " .
TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by
date_purchased desc limit 1");
$ts_orders_query_total = tep_db_query("select value from " .
TABLE_ORDERS_TOTAL . " where class=\"ot_total\" and orders_id = '" .
(int)$orders['orders_id']."'");
$ts_orders = tep_db_fetch_array($ts_orders_query);
$ts_orders_total = tep_db_fetch_array($ts_orders_query_total);
?>
<div id="trustedShopsCheckout" style="display: none;">
<span id="tsCheckoutOrderNr"><?php echo $ts_orders['orders_id']; ?></span>
<span id="tsCheckoutBuyerEmail"><?php echo $ts_orders['customers_email_address']; ?></span>
<span id="tsCheckoutBuyerId"><?php echo $ts_orders['customers_id']; ?></span>
<span id="tsCheckoutOrderAmount"><?php echo $ts_orders_total['value']; ?></span>
<span id="tsCheckoutOrderCurrency"><?php echo $ts_orders['currency']; ?></span>
<span id="tsCheckoutOrderPaymentType"><?php echo $ts_orders['payment_method']; ?></span>        
<!--Product review part  -->       
<?php       
//Query for product reviews.       
$orders_products_query= tep_db_query("select t1.products_id,
products_image, t1.products_name, t2.products_url from " .       
TABLE_ORDERS_PRODUCTS." t1, ".TABLE_PRODUCTS_DESCRIPTION." t2, ".
TABLE_PRODUCTS .       
" t3 where t2.products_id = t1.products_id and  t3.products_id =
t1.products_id and orders_id = '"     . (int)$orders['orders_id']."'")       
$index = 0; $products = array();       
while ($orders_products =
tep_db_fetch_array($orders_products_query)) {       
$products[$index] = array('pid' => $orders_products['products_id'],                                 
'pname' =>
$orders_products['products_name'],                                 
'pimg' =>
$orders_products['products_image'],                                 
'purl' =>
$orders_products['products_url']                              
);               
$index++;     
}       
foreach ($products as $product) {            
echo'<span class="tsCheckoutProductItem">       
<span class="tsCheckoutProductUrl">'.$product['purl'].'</span>       
<span class="tsCheckoutProductImageUrl">'.$product['pimg'].'</span>       
<span class="tsCheckoutProductName">'.$product['pname'].'</span>       
<span class="tsCheckoutProductSKU">'.$product['pid'].'</span>       
<span class="tsCheckoutProductGTIN">'.'</span>       
<span class="tsCheckoutProductMPN">'.'</span>       
<span class="tsCheckoutProductBrand">'.'</span>       
</span>';        
}       
?> 
</div>
<!-- Trusted Shops ENDE -->

Then save your changes and transfer them to the server.

ServerCheckoutDIV1.png

Step 2: Generate Trustbadge code

At this point you will need your personal Trustbadge code. First you need to generate your code on this website. Enter your Trusted Shops ID (starting with X...) in the input field provided. The code will then be generated.

You can find your Trusted Shops ID in your dashboard in the My Trusted Shops backend. To do this, first log in to My Trusted Shops here. After logging in, you will be taken directly to the dashboard. In the right column of the dashboard, your shops which are registered with Trusted Shops are listed, with their respective Trusted Shops ID.

Copy the code completely to your clipboard and switch back to the osCommerce backend.

Step 3: Integrate Trustbadge Code

Open the following file in your osCommerce file system:

/osCommerceInstallation/catalog/includes/template_bottom.php

Scroll to the end of the file and look for the closing </body> tag. Paste the Trustbadge code copied to the clipboard in step 2 into the line immediately before this tag. Now save the changes and transfer them to the server.

ServerTB.png

Once you have completed these steps, you can now test the function of your Trustbadge. To do this, place a test order in your shop. If the Trustcard (“Buyer Protection Card") appears at the end of your order, you have successfully integrated the Trustbadge into your shop, the Buyer Protection is active and shop reviews are collected.

website_integration_custom_en-GB.png

Since the way the Trustcard is displayed depends on various factors, the Trustcard displayed in your shop may differ from the one shown here. You will find an overview of the most common display formats of the Trustcard in this article.

Configuration

You have now successfully installed the Trustbadge in osCommerce. Next, we will show you how you can configure the Trustbadge® technology according to your individual requirements.

Configure Trustbadge

The unique Trustbadge® technology makes it so simple to collect, manage and display your customer reviews in your shop. You can also easily integrate your trustmark and offer the Buyer Protection.

By default the Trustbadge is displayed in the lower right corner of your shop. By entering a pixel number in the code line ˈyOffsetˈ of the Trustbadge code from step 2, you can move the Trustbadge upwards at the right edge of the screen. This makes sense, for example, if important elements of your shop would otherwise be covered by the Trustbadge.

Furthermore, you have the possibility to display the Trustbadge with or without star ratings in your shop.

trustbadge_trustmark_reviews_EN.pngtrustbadge_no_reviews_EN.png

You can determine the form of presentation you require by means of the code line ˈvariantˈ. If you want to display the Trustbadge without star ratings, replace the existing code line ˈvariantˈ by the following:

ˈvariantˈ: ˈdefaultˈ, /* default, reviews, custom, custom_reviews */

For the Trustbadge variant with star ratings, please use the following code line:

ˈvariantˈ: ˈreviewsˈ, /* default, reviews, custom, custom_reviews */

Integrate the customised code into your osCommerce file system as described in step 3.

Send review requests

After the integration of the Trustbadge, your customers will be able to activate a Buyer Protection and/or choose to be sent a review request directly after checkout. To send a review request to your existing customers as well, you can use the Review Collector. This article explains what you need to do to achieve this.


Was this article helpful?

1 out of 2 found this helpful