osCommerce

osCommerce is available as a shopping cart system at Shopgate.

By setting up the Shopgate plugin for your osCommerce shop, you will get these wonderful features straight into your mobile shop and apps:

Supported Version Import to osCommerce
osCommerce 2.2 (MS2, MS2 CVS, RC1) to 2.3.4
Swisscart v4.0
  Orders
Sync Export to Shopgate Mobile Shop
Delivery Status "Shipped"
Order Status "Canceled"
Stock Quantity, on Product Detail Page


Products
Categories
Reviews


Customer Account Validate, upon Cart Changes
Login with Desktop Shop Account
Login to Desktop Shop with Mobile Account
Customer Groups / Tier Pricing
Show Desktop Orders on Mobile


✘ / ✘
Coupon
Shipping Method
Payment Method
Product Availability



Supported Payments Notes
Prepayment, Direct Debit, Cash on Delivery N/A

In this article, you will find everything you need to set up the Shopgate plugin for your osCommerce shop.

 

Install the Shopgate plugin

Upload the plugin

Simply upload the Shopgate plugin to your osCommerce folder and activate it in your osCommerce admin. To do this, please follow the steps below:

  1. Download the plugin here and extract the content of the zip file.
  2. Connect an FTP client tool (e.g. FileZilla) to your server. You will need it to copy the plugin into your osCommerce shop's root directory.
  3. Select the Shopgate plugin files you just extracted and drag them to your shop's main directory. When asked, choose to overwrite files and folders.

Set file permissions

Set permissions for the folders config and temp that are located in ext/modules/shopgate/shopgate_library to readable and writeable (774*). Click OK.

* If you cannot save your changes or configurations, set file permissions to 777.

Modify the codes

In order for the Shopgate plugin to work in your osCommerce system, a few lines of codes need to be added in your osCommerce backend - Copy the highlighted codes and paste them at the corresponding lines in your file.

Please keep in mind:

  • Line numbers shown below can be different from those in your file.
  • The paths are relative to your shop’s base folder. E.g. if your osCommerce has been installed at /public_html/catalog/, then the path of includes/filenames.php refers to /public_html/catalog/includes/filename.php.
  • The default folder name admin is used below. If you have renamed your admin folder, please locate the files in that directory.

For more detailed descriptions on how to modify codes in your shop's backend folders, click here.

File 1: includes/filenames.php
define('FILENAME_SHOPPING_CART','shopping_cart.php');
define('FILENAME_SPECIALS','specials.php');
define('FILENAME_SSL_CHECK','ssl_check.php');
define('FILENAME_TELL_A_FRIEND','tell_a_friend.php');

define('FILENAME_UPCOMING_PRODUCTS','upcoming_products.php');
/******** SHOPGATE **********/
define('FILENAME_SHOPGATE','shopgate.php');
/******** SHOPGATE **********/
File 2: admin/includes/filenames.php
define('FILENAME_TAX_CLASSES','tax_classes.php');
define('FILENAME_TAX_RATES','tax_rates.php');
define('FILENAME_VERSION_CHECK','version_check.php');
define('FILENAME_WHOS_ONLINE','whos_online.php');

define('FILENAME_ZONES','zones.php');
/******** SHOPGATE **********/
define('FILENAME_SHOPGATE','shopgate.php');
/******** SHOPGATE **********/
File 3: admin/includes/column_left.php
if(tep_session_is_registered('admin')){
$cl_box_groups=array();
include(DIR_WS_BOXES .'configuration.php');

include(DIR_WS_BOXES .'catalog.php');
include(DIR_WS_BOXES .'modules.php');
include(DIR_WS_BOXES .'customers.php');
include(DIR_WS_BOXES .'taxes.php');
include(DIR_WS_BOXES .'localization.php');
/******** SHOPGATE **********/
include(DIR_WS_BOXES .'shopgate.php');
/******** SHOPGATE **********/
include(DIR_WS_BOXES .'reports.php');
include(DIR_WS_BOXES .'tools.php');
File 4: admin/includes/languages/english.php
define('ERROR_DESTINATION_DOES_NOT_EXIST','Error: Destination does not exist.');
define('ERROR_DESTINATION_NOT_WRITEABLE','Error: Destination not writeable.');
define('ERROR_FILE_NOT_SAVED','Error: File upload not saved.');
define('ERROR_FILETYPE_NOT_ALLOWED','Error: File upload type not allowed.');

define('SUCCESS_FILE_SAVED_SUCCESSFULLY','Success: File upload saved successfully.');
define('WARNING_NO_FILE_UPLOADED','Warning: No file uploaded.');
/******** SHOPGATE **********/
include(DIR_FS_CATALOG ."ext/modules/shopgate/base/admin/includes/languages/english.php");
/******** SHOPGATE **********/
File 5: admin/orders.php
if(($check_status['orders_status']!=$status)|| tep_not_null($comments)){
tep_db_query("update ". TABLE_ORDERS ." set orders_status = '". tep_db_input($status)."', last_modified = now() where orders_id = '".(int)$oID."'");

$customer_notified='0';
if(isset($HTTP_POST_VARS['notify'])&&($HTTP_POST_VARS['notify']=='on')){
$notify_comments='';
if(isset($HTTP_POST_VARS['notify_comments'])&&($HTTP_POST_VARS['notify_comments']=='on')){
$notify_comments=sprintf(EMAIL_TEXT_COMMENTS_UPDATE,$comments)."\n\n";
}

$email= STORE_NAME ."\n". EMAIL_SEPARATOR ."\n". EMAIL_TEXT_ORDER_NUMBER .' '.$oID."\n". EMAIL_TEXT_INVOICE_URL .' '. tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO,'order_id='.$oID,'SSL')."\n". EMAIL_TEXT_DATE_ORDERED .' '. tep_date_long($check_status['date_purchased'])."\n\n".$notify_comments.sprintf(EMAIL_TEXT_STATUS_UPDATE,$orders_status_array[$status]);

tep_mail($check_status['customers_name'],$check_status['customers_email_address'], EMAIL_TEXT_SUBJECT,$email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

$customer_notified='1';
}

tep_db_query("insert into ". TABLE_ORDERS_STATUS_HISTORY ." (orders_id, orders_status_id, date_added, customer_notified, comments) values ('".(int)$oID."', '". tep_db_input($status)."', now(), '". tep_db_input($customer_notified)."', '". tep_db_input($comments) ."')");

/******** SHOPGATE **********/
include(DIR_FS_CATALOG ."ext/modules/shopgate/base/admin/orders.php");
onUpdateOrdersStatus($oID,$status);
/******** SHOPGATE **********/
$order_updated=true;
}
File 6: admin/includes/functions/general.php
function tep_remove_order($order_id,$restock=false){
if($restock=='on'){
$order_query= tep_db_query("select products_id, products_quantity from ". TABLE_ORDERS_PRODUCTS ." where orders_id = '".(int)$order_id."'");
while($order= tep_db_fetch_array($order_query)){

tep_db_query("update ". TABLE_PRODUCTS ." set products_quantity = products_quantity + ".$order['products_quantity'].", products_ordered = products_ordered - ".$order['products_quantity']." where products_id = '".(int)$order['products_id']."'");
}
}
tep_db_query("delete from ". TABLE_ORDERS ." where orders_id = '".(int)$order_id."'");
tep_db_query("delete from ". TABLE_ORDERS_PRODUCTS ." where orders_id = '".(int)$order_id."'");
tep_db_query("delete from ". TABLE_ORDERS_PRODUCTS_ATTRIBUTES ." where orders_id = '".(int)$order_id."'");
tep_db_query("delete from ". TABLE_ORDERS_STATUS_HISTORY ." where orders_id = '".(int)$order_id."'");
tep_db_query("delete from ". TABLE_ORDERS_TOTAL ." where orders_id = '".(int)$order_id."'");
/******** SHOPGATE **********/
include(DIR_FS_CATALOG ."ext/modules/shopgate/plugin.php");
tep_db_query("delete from ". TABLE_ORDERS_SHOPGATE_ORDER ." where orders_id = '".(int)$order_id."'");
/******** SHOPGATE **********/
}
File 7: includes/application_top.php
// initialize the message stack for output messages
require(DIR_WS_CLASSES .'message_stack.php');
$messageStack=new messageStack;

/******* SHOPGATE **********/
include_once DIR_FS_CATALOG.'ext/modules/shopgate/base/includes/application_top.php';
/******* SHOPGATE **********/
File 8: includes/template_top.php
Note: In osCommerce versions prior to 2.3, you need to edit the file includes/header.php instead.
<script type="text/javascript" src="ext/jquery/bxGallery/jquery.bxGallery.1.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" />
<script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="ext/960gs/<?php echo ((stripos(HTML_PARAMS, 'dir="rtl"') !== false) ? 'rtl_' : ''); ?>960_24_col.css" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<?php echo $oscTemplate->getBlocks('header_tags'); ?>
<?php
/******** SHOPGATE **********/
echo $shopgateJsHeader."\n";
/******** SHOPGATE **********/
?>
</head>
<body>
File 9: includes/languages/english.php
define('TEXT_CCVAL_ERROR_INVALID_DATE', 'The expiry date entered for the credit card is invalid. Please check the date and try again.');
define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'The credit card number entered is invalid. Please check the number and try again.');
define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'The first four digits of the number entered are: %s. If that number is correct, we do not accept that type of credit card. If it is wrong, please try again.');

define('FOOTER_TEXT_BODY', 'Copyright &copy; ' . date('Y') . ' <a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . STORE_NAME . '</a><br />Powered by <a href="http://www.oscommerce.com" target="_blank">osCommerce</a>');

/******* SHOPGATE **********/
include_once DIR_FS_CATALOG.'ext/modules/shopgate/base/includes/languages/english.php';
/******* SHOPGATE **********/
?>
(Polish, optional) File 10: admin/includes/languages/polish.php
define('ERROR_DESTINATION_DOES_NOT_EXIST', 'Błąd: Obiekt docelowy  nie istnieje %s');
define('ERROR_DESTINATION_NOT_WRITEABLE', 'Błąd: Do obiektu docelowego nie można zapisywać %s');
define('ERROR_FILE_NOT_SAVED', 'Błąd: Wgrywany plik nie został zapisany.');
define('ERROR_FILETYPE_NOT_ALLOWED', 'Błąd: Wgrywanie tego rodzaju plików jest zabronione  %s');
define('SUCCESS_FILE_SAVED_SUCCESSFULLY', 'Powiodło się: Wgrywany plik został zapisany. %s');
define('WARNING_NO_FILE_UPLOADED', 'Uwaga: Nie wgrano pliku.');
 
/******** SHOPGATE **********/
include(DIR_FS_CATALOG . "ext/modules/shopgate/base/admin/includes/languages/polish.php");
/******** SHOPGATE **********/
(German, optional) File 11: admin/includes/languages/german.php
Note: You can skip this step if you didn't install the German language pack.
define('ERROR_DESTINATION_DOES_NOT_EXIST', 'Error: Destination existiert nicht.');
define('ERROR_DESTINATION_NOT_WRITEABLE', 'Error: Destination nicht beschreibbar.');
define('ERROR_FILE_NOT_SAVED', 'Error: File upload nicht gespeichert.');
define('ERROR_FILETYPE_NOT_ALLOWED', 'Error: File upload typ nicht erlaubt.');
define('SUCCESS_FILE_SAVED_SUCCESSFULLY', 'Success: File upload erfolgreich gespeichert.');
define('WARNING_NO_FILE_UPLOADED', 'Warning: kein File uploaded.');
define('WARNING_FILE_UPLOADS_DISABLED', 'Warning: File uploads sind deaktiviert in dem php.ini konfigurations file.');
 
/******** SHOPGATE **********/
include(DIR_FS_CATALOG . "ext/modules/shopgate/base/admin/includes/languages/german.php");
/******** SHOPGATE **********/
(German, optional) File 12: includes/languages/german.php
Note: You can skip this step if you didn't install the German language pack.
define('TEXT_CCVAL_ERROR_INVALID_DATE', 'Das "G&uuml;ltig bis" Datum ist ung&uuml;ltig. Bitte korrigieren Sie Ihre Angaben.');
define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'Die "KreditkarteNummer", die Sie angegeben haben, ist ung&uuml;ltig. Bitte korrigieren Sie Ihre Angaben.');
define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'Die ersten 4 Ziffern Ihrer Kreditkarte sind: %s. Wenn diese Angaben stimmen, wird dieser Kartentyp leider nicht akzeptiert. Bitte korrigieren Sie Ihre Angaben gegebenfalls.');

define('FOOTER_TEXT_BODY', 'Copyright &copy; ' . date('Y') . ' <a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . STORE_NAME . '</a><br>Powered by <a href="http://www.oscommerce.com" target="_blank">osCommerce</a>');

/******* SHOPGATE **********/
include_once DIR_FS_CATALOG.'ext/modules/shopgate/base/includes/languages/german.php';
/******* SHOPGATE **********/
?>

Install the plugin

  1. Log into your shop’s backend and navigate to Modules → Payment on the left. Click + Install Module button to the right.
  2. In the list of modules, click on Shopgate. Click + Install Module button to the right.

Your Shopgate plugin is now installed in your osCommerce admin. If you don't see it on the menu bar to the left, reload the page.

 

Establish connections

Get API credentials

  1. Log in to your Shopgate Admin and navigate to Integration → Install Interface.
  2. In the drop-down labeled Select system, start typing "osCommerce" and select it when it appears.
  3. A popup opens. Look for Customer number, Shop number, API key, and Alias under 2. Configure. These are the API credentials the plugin needs to be authenticated at the Shopgate backend. Leave this page open - we will come back to enter the URL (explained in Establish connection)
  4. Copy Customer number, Shop number, API key, and Alias, and paste them individually onto the plugin configuration page (Shopgate  Settings). The rest of the options can be configured later (Explained here). Click Save.

Connect your shop to Shopgate

  1. Go back to the pop-up window at your Shopgate merchant page (step 4). Enter your shop's URL to the text field under 3. Enter URL. Click connect to establish the interface.
  2. If a connection is made successfully, a popup shown below will open. Here you will be able to assign jobs to your first connection. We recommend leaving all assignments to ON at this time. Click Save.

Congratulations! Now you should see the progress bar running, and the Shopgate backend automatically filling your mobile shop with your products. Depending on how many products you have, the import process can take anywhere from a few minutes to a few hours. Welcome to the mobile world 😊

 

Update an existing plugin

Use your FTP tool to update your Shopgate plugin to a newer version by following the steps here:

  1. First of all, deactivate the plugin. Log into your shop’s backend and navigate to Modules → Payment on the left. Find Shopgate in the list of modules and click "- Remove Module" on the right.
  2. Use your FTP tool like to back up your plugin configurations by downloading the folder ext/modules/shopgate
  3. Delete the folder ext/modules/shopgate by right-clicking the folder Shopgate, and selecting Delete then Yes.
  4. At the end, install the new version of the plugin by following the instructions in Chapter 1.

That's it! Now you have updated your Shopgate plugin to the latest version.

 

Configure the plugin

In this chapter, you can find the details of your Shopgate plugin setting options.

To locate the configurations in your osCommerce Admin, click Shopgate → Settings on the left.

Connection Settings
Module type Select US if your shop is based in the US. Otherwise, select Non-US. This module type determines which tax system should be applied to your shop.
Customer number Enter your Shopgate customer number here. See section 2.1
Shop number Enter your Shopgate shop number here. See section 2.1
API key Enter your Shopgate API key here. See section 2.1
Mobile Redirect
Shop alias

Your shop alias is a unique identifier of your shop at Shopgate. It is automatically generated based on the shop name you entered at registration.

To understand and find your shop alias, read Customizing mobile URL (alias) within the Shopgate domain

Custom URL to mobile webpage (CNAME)

A CNAME is a subdomain of your own domain that points to your mobile website. It could look like this http://m.myawesomeshop.com

To understand and set up CNAME, read Setting up mobile URL within your shop domain

Redirected languages Select one or more languages for your mobile shop.
Exporting Categories and Products
Language Choose the language in which categories and products should be exported.
Currency Choose the currency in which your products should be exported.
Country Choose the country for which your products should be exported.
Importing Orders
Shipping not blocked Assign a status to incoming Shopgate orders that are not blocked for shipping.
Shipping blocked Assign a status to incoming Shopgate orders that are blocked for shipping.
Shipped Assign a status to orders that have been shipped. This is used to synchronize the shipping status of orders with Shopgate.
Cancelled Assign a status to orders that have been canceled. This is used to synchronize the cancellation status of orders with Shopgate.
Cancel shipping By default, the shipping costs will not be canceled (refunded to the user) at Shopgate when an order is canceled, partially or in full, via your osCommerce admin. If you would like to cancel (refund) shipping costs at Shopgate whenever an order is canceled, partially or in full, via osCommerce, please choose 'yes'.
Display names for payment methods Now you have the option to display the payment methods in the names of your own choice. Simply specify a display name for each of your payment methods here using the formula "Codename"="your display name". Separate each payment formula with a semicolon. More details see How can I replace the code name of a payment on an order's detail page?
System Settings
Shop system encoding Choose the encoding of your system. This is “UTF-8” for osCommerce Online Merchant v2.3
Shopgate server Choose between the “Live” or the “Playground” Shopgate servers for API communication. Alternatively, you can provide a “Custom” Shopgate API URL.
Custom Shopgate server URL If you chose “Custom” in the drop-down menu box above, provide a custom URL to the Shopgate API here.

 

Frequently Asked Questions

How can I replace the code name of a payment on an order's detail page?

On an order's detail page of your mobile shop, a code name is shown for each payment method. For example, "AUTHN_CC" is shown if a customer has paid with a credit card via Authorize.net, and "COD" is shown if a customer selected "cash on delivery".

If you would prefer to display different names for your payment methods, you can now use the payment mapping feature in your osCommerce admin. To do so, follow the steps here.

  1. In your osCommerce admin, find the Shopgate entry on the left and click Settings.
  2. In the section Importing orders, find Display names for payment methods.
  3. To map your display names, enter Codename=your display name and separate each payment with a semicolon. For example, enter
    AUTHN_CC=Credit card via Authorize;COD=Cash on delivery

Use the table below to find the code names of your payments.

Codename Description Codename Description
ACCRD_INS Installment via Accarda PAYONE_IDL iDEAL via PAYONE
ACCRD_INV Invoice via Accarda PAYONE_INV Invoice via PAYONE
AUTHN_CC Credit card via Authorize.net PAYONE_KLV Klarna invoice via PAYONE
BARZAHLEN Pay in store via Barzahlen PAYONE_PP PayPal via PAYONE
BILLSAFE Invoice via Billsafe PAYONE_PRP Prepayment via PAYONE
BRAINTR_CC Credit card via Braintree PAYONE_SUE SOFORT Überweisung via PAYONE
CHASE_CC Credit card via Chase Paymentech PAYPAL PAYPAL
CMPTOP_CC Credit card via Computop PAYU PayU
CMPTOP_DBT Direct debit via Computop PP_WSPP_CC Credit card via PayPal Website Payments Pro
CMPTOP_PP PayPal via Computop PPAL_PLUS PayPal Plus
COD Cash on Delivery PREPAY Prepayment
COLL_STORE Collection at store REALEX_CC Credit card via Realex
CONCAR_CC Credit card via ConCardis (DirektLink) SAGEPAY_CC Credit card via SagePay
CYBRSRC_CC Credit card via CyberSource SAGEPAY_PP PAYPAL via SagePay
DEBIT Direct debit SHOPGATE Shopgate payments
DT_CC Credit card via DataTrans SIX_CC Credit card via SIX Saferpay (External)
DTCASH_CC Credit card via DataCash SIX_IDEAL iDEAL via SIX Saferpay
EWAY_CC Credit card via eWAY SIX_PP PayPal via SIX Saferpay
FRSTDAT_CC Credit card via FirstData US SKRILL_CC Credit card via Skrill (External)
HDLPAY_CC Credit card via HeidelPay SKRILL_DBT Direct debit via Skrill
HDLPAY_SUE HeidelPay (SOFORT Überweisung) SKRILL_IDL iDEAL via Skrill
HIPAY Credit card via HiPay (external) SKRILL_SUE SOFORT Überweisung via Skrill
INVOICE INVOICE (Own Settlement) SPONE_DBT Direct debit via SEPAone
KLARNA_INV Invoice via Klarna STRIPE_CC Credit card via Stripe
MASTPAY_CC Credit card via Masterpayment SUE SOFORT Überweisung
MASTPAY_PP PAYPAL via Masterpayment TELECSH_CC Telecash
MASTPAY_SUE Masterpayment (SOFORT Überweisung) TRNSFST_CC Credit card via TransFirst
MSTPAY_INV Invoice via Masterpayment UPAID_MCM MasterPass
MWS Amazon Payments (Own - APA) USAEPAY_CC Credit card via USA ePay
OGONE_CC Credit card via Ogone WCARD_DBT Direct debit (External) via Wirecard (Checkout Page)
PAY4ONE_CC Credit card via Pay4one WCARD_INV Invoice via Wirecard (Checkout Page)
PAYJUNC_CC Credit card via PayJunction WCARD_PP PayPal via Wirecard (Checkout Page)
PAYMRW_DBT Direct debit via Paymorrow WCARD_SUE SOFORT Überweisung via Wirecard (Checkout Page)
PAYMRW_INV Invoice via Paymorrow WCARDS_CC Credit card (External) via Wirecard (Checkout Seamless)
PAYOL_INS Installment via Payolution WCARDS_DBT Direct debit (External) via Wirecard (Checkout Seamless)
PAYOL_INV Invoice via Payolution WCARDS_PP PayPal via Wirecard (Checkout Seamless)
PAYONE_CC Credit card via PAYONE WCARDS_SUE SOFORT Überweisung via Wirecard (Checkout Seamless)
PAYONE_DBT Direct debit via PAYONE WIRECRD_CC Credit card (External) via Wirecard (Checkout Page)
PAYONE_GP Giropay via PAYONE WORLDLINE Credit card via Worldline (External)

 

Was this article helpful?
0 out of 0 found this helpful