Available for the following platforms: | |||
Shopgate Connect | Shopgate Go | ✔ |
osCommerce is available as a shopping cart system at Shopgate.
By setting up the Shopgate plugin for your osCommerce shop, you will get these 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:
- To download the plugin, please click here. Select the zip file "shopgate-oscommerce-integration.zip" and extract it after downloading
- 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.
- 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.
Modify the code
In order for the Shopgate plugin to work in your osCommerce system, a few lines of code need to be added in your osCommerce backend. Copy the highlighted code 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. For example, 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 code in your shop's backend folders, click here.
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 **********/
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 **********/
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');
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 **********/
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;
}
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 **********/
}
// 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 **********/
<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>
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 © ' . 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 **********/
?>
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 **********/
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 **********/
define('TEXT_CCVAL_ERROR_INVALID_DATE', 'Das "Gültig bis" Datum ist ungültig. Bitte korrigieren Sie Ihre Angaben.');
define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'Die "KreditkarteNummer", die Sie angegeben haben, ist ungü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 © ' . 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
- Log into your shop’s backend and navigate to Modules → Payment on the left. Click + Install Module button to the right.
- 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
- Log in to your Shopgate Admin and navigate to Integration → Install Interface.
- In the drop-down labeled Select system, start typing "osCommerce" and select it when it appears.
- A pop-up will open. 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).
- 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
- 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.
- If a connection is made successfully, the pop-up 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.
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. Congratulations and 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:
- First, 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.
- Use your FTP tool like to back up your plugin configurations by downloading the folder ext/modules/shopgate
- Delete the folder ext/modules/shopgate by right-clicking the folder Shopgate, and selecting Delete, then Yes.
- At the end, install the new version of the plugin by following the instructions at the beginning of this article.
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.
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. |
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. |
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. |
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. For more details, see How can I replace the code name of a payment on an order's detail page? |
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:
- In your osCommerce admin, find the Shopgate entry on the left and click Settings.
- In the section Importing orders, find Display names for payment methods.
- 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) |
Please note:
* The plugin is no longer actively developed by Shopgate and is therefore no longer adapted to new versions. You are welcome to submit new features, changes or bug fixes via GitHub.