Support Center

Connecting to xt:Commerce 3

Follow

 

xt:Commerce is available as a shopping cart system at Shopgate.

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

Supported Version Import to xt:Commerce

3.0.4 +

  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, Invoice, Cash on Delivery, Direct Debit, PayPal

Customized text option is available upon configuration.

Product and brand searches done in a search engine on a mobile device are now redirected to the shop's mobile website.

 

In this article, you will find everything you need to set up the Shopgate plugin for your xt:Commerce 3 shop.

 

Topics covered in this article:

 

1. Installing the Shopgate plugin

The Shopgate plugin for xt:Commerce 3 can be installed in all xt:Commerce shops starting from version 3.0.4. Simply upload the plugin to your xt:Commerce 3 folder and activate it in your xt:Commerce 3 admin page. To do this, please follow the steps below:

1.1 Downloading the plugin

Download the plugin via this link: http://files.shopgate.com/plugins/xtcommerce3.zip and extract the contents of the zip file. (Link: how to extract a zip file on Windows?) This should give you 4 folders:

  • admin
  • includes
  • lang
  • shopgate

 

1.2 Uploading the plugin to your server

You need an FTP client tool to copy the plugin into your xt:Commerce shop. Plenty of FTP programs can be found on the internet. If you don’t know which one to use, we recommend FileZilla. (Link to download FileZilla)

  1. Connect FileZilla or another FTP program to your server.
  2. Navigate to the Shopgate plugin you just extracted from the previous step. Mark the files and drag them to your shop's main directory.



  3. In case a dialog appears asking you to overwrite files, select overwrite, check all checkboxes (marked as [2] on the image), and click OK.

1.3 Setting file permissions in your xt:Commerce backend

It’s necessary so set file permissions to the "temp" and "config" folders on your server.

  1. To do this, navigate to the "/shopgate/shopgate_library" folder on your server and select both "temp" and "config" folders. Right click on your selection and open the "Change file attributes" dialog by clicking on "File permissions...".



  2. Enter the numeric value "774*" into the input field. Make sure the checkbox "Recurse into subdirectories" is enabled and "Apply to all files and directories" is selected as the option. Click OK to finish the upload.
    * If you cannot save your changes or configurations, set file permissions to 777.

 

1.4 Adjusting codes

In order for the Shopgate plugin to work in your xt:Commerce system, a few lines of codes need to be added to 9 files in your xt:Commerce backend. For detailed descriptions on how to modify codes in your shop's backend folders, click here.

Please modify all files listed below. Copy the marked codes, and paste them at the corresponding lines in your file. Line numbers in the following code snippets, however, refer to an "unmodified" version of files. If you already modified your files, the line numbers may vary. Only the highlighted parts need to be added into the files.

The paths are relative to your shop’s base folder. E.g. if your xt:Commerce has been installed at /public_html/catalog/, then the path of includes/filenames.php refers to /public_html/catalog/includes/filename.php.

Also keep in mind that the default folder name admin is used below. If you have renamed your admin folder, please locate the files in that directory.

 

----------------------------------- part 1 -----------------------------------

  • Open the file lang/german/admin/german.php
  • Copy the marked codes below, and paste them at the corresponding position in your file.
define('TXT_GROUPS','Gruppen:');
define('TXT_SYSTEM','System');
define('TXT_CUSTOMERS','Kunden/Bestellungen');
define('TXT_PRODUCTS','Artikel/Kategorien');
define('TXT_STATISTICS','Statistiktools');
define('TXT_TOOLS','Zusatzprogramme');
define('TEXT_ACCOUNTING','Zugriffseinstellungen für:');
/******* SHOPGATE **********/
include_once rtrim(DIR_FS_CATALOG,"/").'/shopgate/base/lang/german/admin/german.php';
/******* SHOPGATE **********/
//Dividers text for menu
define('BOX_HEADING_MODULES','Module');
define('BOX_HEADING_LOCALIZATION','Sprachen/Währungen');
define('BOX_HEADING_TEMPLATES','Templates');
define('BOX_HEADING_TOOLS','Hilfsprogramme');
define('BOX_HEADING_LOCATION_AND_TAXES','Land / Steuer');
define('BOX_HEADING_CUSTOMERS','Kunden');
define('BOX_HEADING_CATALOG','Katalog');
define('BOX_MODULE_NEWSLETTER','Rundschreiben');
  • Save the file.

----------------------------------- part 2 -----------------------------------

  • Open the file lang/english/admin/english.php
  • Copy the marked codes below, and paste them at the corresponding position in your file.
define('TXT_GROUPS','Groups:');
define('TXT_SYSTEM','System');
define('TXT_CUSTOMERS','Customers/Orders');
define('TXT_PRODUCTS','Products/Categories');
define('TXT_STATISTICS','Statistics');
define('TXT_TOOLS','Tools');
define('TEXT_ACCOUNTING','Admin-access for:');
/******* SHOPGATE **********/
include_once rtrim(DIR_FS_CATALOG,"/").'/shopgate/base/lang/english/admin/english.php';
/******* SHOPGATE **********/
//Dividers text for menu
define('BOX_HEADING_MODULES', 'Modules');
define('BOX_HEADING_LOCALIZATION', 'Languages/Currencies');
define('BOX_HEADING_TEMPLATES','Templates');
define('BOX_HEADING_TOOLS', 'Tools');
define('BOX_HEADING_LOCATION_AND_TAXES', 'Location / Tax');
define('BOX_HEADING_CUSTOMERS', 'Customers');
define('BOX_HEADING_CATALOG', 'Catalog');
define('BOX_MODULE_NEWSLETTER','Newsletter');
  • Save the file

----------------------------------- part 3 -----------------------------------

  • Open the file includes/database_tables.php
  • Copy the marked codes below, and paste them at the corresponding position in your file.
define('TABLE_COUPON_GV_CUSTOMER','coupon_gv_customer');
define('TABLE_COUPON_GV_QUEUE','coupon_gv_queue');
define('TABLE_COUPON_REDEEM_TRACK','coupon_redeem_track');
define('TABLE_COUPON_EMAIL_TRACK','coupon_email_track');
define('TABLE_COUPONS','coupons');
define('TABLE_COUPONS_DESCRIPTION','coupons_description');
define('TABLE_BLACKLIST','card_blacklist');
define('TABLE_CAMPAIGNS_IP','campaigns_ip');
/******** SHOPGATE **********/
define('TABLE_SHOPGATE_ORDERS','orders_shopgate_order');
/******** SHOPGATE **********/
?>
  • Save the file

----------------------------------- part 4 -----------------------------------

  • Open the file admin/orders.php
  • Copy the marked codes below, and past them at the corresponding position in your file.
               if($order_updated){
/******* SHOPGATE **********/
include_once rtrim(DIR_FS_CATALOG,"/").'/shopgate/base/admin/orders.php';
setShopgateOrderStatus($oID,$status);
/******* SHOPGATE **********/
$messageStack->add_session(SUCCESS_ORDER_UPDATED,'success');
}else{
$messageStack->add_session(WARNING_ORDER_NOT_UPDATED,'warning');
}
  • Save the file

----------------------------------- part 5 -----------------------------------

  • Open the file admin/includes/column_left.php
  • Copy the marked codes below, and paste them at the corresponding position in your file.
 if (($_SESSION['customers_status']['customers_status_id'] == '0') && ($admin_access['whos_online'] == '1')) echo '<a href="' .xtc_href_link(FILENAME_WHOS_ONLINE) . '" class="menuBoxContentLink"> -' . BOX_WHOS_ONLINE . '</a><br>';
if (($_SESSION['customers_status']['customers_status_id'] == '0') && ($admin_access['csv_backend'] == '1')) echo '<a href="' .xtc_href_link('csv_backend.php') . '" class="menuBoxContentLink"> -' . BOX_IMPORT . '</a><br>';

/******** SHOPGATE **********/
include_once rtrim(DIR_FS_CATALOG,"/").'/shopgate/base/admin/includes/column_left.php';
/******** SHOPGATE **********/

if (ACTIVATE_GIFT_SYSTEM=='true') {
echo ('<div class="dataTableHeadingContent"><b>'.BOX_HEADING_GV_ADMIN.'</b></div>');
if (($_SESSION['customers_status']['customers_status_id'] == '0') && ($admin_access['coupon_admin'] == '1')) echo '<a href="' .xtc_href_link(FILENAME_COUPON_ADMIN, '', 'NONSSL') . '" class="menuBoxContentLink"> -' . BOX_COUPON_ADMIN . '</a><br>';
if (($_SESSION['customers_status']['customers_status_id'] == '0') && ($admin_access['gv_queue'] == '1')) echo '<a href="' .xtc_href_link(FILENAME_GV_QUEUE, '', 'NONSSL') . '" class="menuBoxContentLink"> -' . BOX_GV_ADMIN_QUEUE . '</a><br>';
if (($_SESSION['customers_status']['customers_status_id'] == '0') && ($admin_access['gv_mail'] == '1')) echo '<a href="' .xtc_href_link(FILENAME_GV_MAIL, '', 'NONSSL') . '" class="menuBoxContentLink"> -' . BOX_GV_ADMIN_MAIL . '</a><br>';
  • Save the file

----------------------------------- part 6 -----------------------------------

  • Open the file admin/includes/application_top.php
  • Copy the marked codes below, and paste them at the corresponding position in your file.
define('FILENAME_BLACKLIST','blacklist.php');
define('FILENAME_PRODUCTS_VPE','products_vpe.php');
define('FILENAME_CAMPAIGNS_REPORT','stats_campaigns.php');
define('FILENAME_XSELL_GROUPS','cross_sell_groups.php');
/******** SHOPGATE **********/
define('FILENAME_SHOPGATE','shopgate.php');
define('TABLE_SHOPGATE_ORDERS','orders_shopgate_order');
/******** SHOPGATE **********/
// define the database table names used in the project
define('TABLE_ADDRESS_BOOK','address_book');
define('TABLE_ADDRESS_FORMAT','address_format');
define('TABLE_ADMIN_ACCESS','admin_access');
define('TABLE_BANNERS','banners');
  • Save the file

----------------------------------- part 7 -----------------------------------

  • Open the file admin/includes/functions/general.php
  • Copy the marked codes below, and paste them at the corresponding position in your file.
function xtc_remove_order($order_id,$restock=false){
if($restock=='on'){
$order_query= xtc_db_query("select products_id, products_quantity from ".TABLE_ORDERS_PRODUCTS." where orders_id = '".xtc_db_input($order_id)."'");
while($order= xtc_db_fetch_array($order_query)){
xtc_db_query("update ".TABLE_PRODUCTS." set products_quantity = products_quantity + ".$order['products_quantity']// [...] Zeile gekürzt
}
}
xtc_db_query("delete from ".TABLE_ORDERS." where orders_id = '".xtc_db_input($order_id)."'");
xtc_db_query("delete from ".TABLE_ORDERS_PRODUCTS." where orders_id = '".xtc_db_input($order_id)."'");
xtc_db_query("delete from ".TABLE_ORDERS_PRODUCTS_ATTRIBUTES." where orders_id = '".xtc_db_input($order_id)."'");
xtc_db_query("delete from ".TABLE_ORDERS_STATUS_HISTORY." where orders_id = '".xtc_db_input($order_id)."'");
xtc_db_query("delete from ".TABLE_ORDERS_TOTAL." where orders_id = '".xtc_db_input($order_id)."'");
/******** SHOPGATE **********/
xtc_db_query("delete from ".TABLE_SHOPGATE_ORDERS." where orders_id = '".xtc_db_input($order_id)."'");
/******** SHOPGATE **********/
}
  • Save the file

----------------------------------- part 8 -----------------------------------

  • Open the file includes/header.php
  • Copy the marked codes below, and paste them at the corresponding position in your file.
?>
<?php
/******** SHOPGATE **********/
include_once DIR_FS_CATALOG.'/shopgate/base/includes/header.php';
/******** SHOPGATE **********/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php echo HTML_PARAMS; ?>>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $_SESSION['language_charset']; ?>" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<?php
/******** SHOPGATE **********/
echo $shopgateJsHeader;
/******** SHOPGATE **********/
  • Save the file.

----------------------------------- part 9 -----------------------------------

  • Open the file includes/modules/product_info.php
  • Copy the marked codes below, and paste them at the corresponding position in your file.
/******* SHOPGATE **********/
include_once DIR_FS_CATALOG.'/shopgate/base/includes/header.php';
/******* SHOPGATE **********/
//include needed functions
require_once(DIR_FS_INC.'xtc_check_categories_status.inc.php');
require_once(DIR_FS_INC.'xtc_get_products_mo_images.inc.php');
require_once(DIR_FS_INC.'xtc_get_vpe_name.inc.php');
require_once(DIR_FS_INC.'get_cross_sell_name.inc.php');
  • Save the file.

 

1.5 Installing the plugin

  1. Please login in to the admin backend of your shop.

  2. Select Payment Systems from the menu under Modules.


  3. Choose Shopgate from the list of all payment modules and click on Install in the top right corner.



  4. If installed correctly, the Install button will disappear, Uninstall and Edit buttons will appear. Scroll down on the menu bar on the left, Shopgate should now listed here. If the “Shopgate” menu does not appear right away, reload the page. Your plugin is now installed successfully in your xt:Commerce backend.



  5. Click on Shopgate > Settings on the left menu bar to open the configuration page for the Shopgate plugin. Leave this page open - we will explain how to find the required info in the next chapters.

 

2. Establishing connections between the plugin and Shopgate

After the Shopgate plugin has been installed successfully, 2 simple tasks need to be done to connect your mobile shop at Shopgate to your shop's backend: to enter API credentials in your shop's backend, and to enter your shop's URL in your Shopgate's admin page.

2.1 Getting API credentials

  1. Log in to your Shopgate Admin page.

  2. Click on Integration from the menu bar, then select  Install Interface.



  3. In the drop-down labeled Select system, type xt:Commerce 3 and select it.



  4. 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 authenticate at the Shopgate backend. Leave this page open - we will come back to enter the URL (explained in 2.2 Establishing connection)



  5. Copy Customer number, Shop number, API key, and Alias, and paste them individually onto the plugin configuration page you left open from the last chapter. The rest of the options can be configured later. This is explained in Chapter 4. Configuring the Plugin). Click Save.




2.2 Connecting your shop to Shopgate

  1. Go back to the pop-up window at your Shopgate merchant page (step 4).

  2. Under "3. Enter URL", enter the URL of your shop, ideally starting with “https://”. For example: https://www.MyAwesomeShop.com. Click connect to establish the interface.



  3. If a connection is made successfully, a popup shown below will open. Here you will be able to assign jobs for your first connection. We recommend to leave all assignments to ON at this time. Click Save.



  4. 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. You can always check the status of the imports. If no status bar is shown, it means either the import is finished, or no import is running at the moment.

    Welcome to the mobile world :)


3. Updating an existing Shopgate plugin

3.1 Checking for custom adaption

Before updating your Shopgate plugin to a newer version, make sure to check if your shop uses a customized version of the Shopgate plugin. If this is the case, a generic plugin update will NOT work for your shop.

To check if your plugin is customized...

You are using a customized version if

  • you have contacted Shopgate for making a 3rd party plugin to work in your mobile shop, or adding a special feature/function
  • Shopgate has sent you an adapted version of plugin
  • the plugin file you installed has "adaption" in the name

If your shop uses a customized Shopgate plugin...

Please email Shopgate each time before updating with the following details:

 

3.2 Updating the plugin

To update an existing plugin, follow the steps here:

  1. Uninstall the Shopgate payment module

  2. To update a customized Shopgate plugin, follow chapter 1.2 to upload the customized Shopgate plugin (the one you received in the email).
    To update a generic Shopgate plugin, follow chapters 1.1 to download the latest version and 1.2 to upload it to your server.

  3. Now follow chapter 1.3 to set file permissions and 1.5 to install the Shopgate plugin. (You can skip 1.4. The codes do NOT need to be adjusted every time you update the plugin.)
    Be aware not to delete any files on your shop server prior to updating the plugin.

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

 

4. Configuring the plugin

Here you can find a detailed explanation to every configuration field provided on the configuration page of the plugin. The settings page is divided into multiple individual sections which are described here one by one.

4.1 SHOPGATE + Connection Settings

Setup multiple Shopgate marketplaces Click on this button if you want to map each language of your shop to a separate mobile shop that you have registered at Shopgate. Every shop has its own credentials to connect with.
Customer number Your customer number which is presented to you every time that you create an interface in the Shopgate merchant area.
Shop number The shop number of your mobile store, provided by Shopgate.
API key This is the “password” that the plugin uses to be able to communicate with the Shopgate-MerchantAPI on a secure channel.

 

4.2 Mobile Redirect

Shop alias The alias is the subdomain of shopgate.com, e.g. myshop.shopgate.com, where your mobile website can be found. This is used as a fallback if no CNAME is configured.
CNAME A CNAME is a subdomain of your own domain that points to your mobile website. Usually that’s something like m.myawesomeshop.com. You’ll have to configure this on your server.
Redirected languages Select the languages the redirect to the mobile website should be active for.

 

4.3 Exporting Categories and Products

Language Choose the language the products should be exported in.
Currency Choose the currency your products should be exported in.
Country Choose the country your products should be exported for.
Tax zone for Shopgate Choose the tax zone your products will be exported for. This will calculate the tax rates to be exported for your products.
Reverse category sort order Choose "Yes" if categories in your mobile shop appear to be sorted upside down.
Reverse products sort order Choose "Yes" if products in your mobile shop appear to be sorted upside down.
Products description Choose between the short description, the long description or a combination of both to be used for exporting your products to Shopgate.
Price group for Shopgate Choose the price group products will be exported for to Shopgate.
Export the “New” category Here you can set the internal identifier for the virtual category “New products”. When exporting to the mobile website, it is exported as a real category using the specified internal identifier. Please note that this value is fine in most cases and should therefore not be changed. It also does not influence the appearance of the category on the mobile website.

NEW:

Export product options as text field

Now you can enter the id of a product option to create a text field on a product detail page. Separate the options with a comma, but do NOT enter a comma at the end of the list.

For example, if you sell customized canvas, and you entered the ids for "Height" and "Length". Your customers will see 2 added text fields, one for Height and one for Length. They can then enter a height and length of their choice when they order a canvas.

 

4.4 Importing Orders

Customer group Choose the group assigned to customers on incoming Shopgate orders.
Shipping method Choose the shipping method applied to incoming Shopgate orders.
Shipping not blocked Set the status to be assigned on incoming Shopgate orders that are not blocked for shipping.
Shipping blocked Set the status to be assigned on incoming Shopgate orders that are blocked for shipping.
Shipped Select the status you set on orders that have been shipped. This is used to synchronize the shipping status of orders with Shopgate.
Order Confirmation Mail It’s possible to send order confirmation emails after importing an order. These emails are sent out of your shop. Choose “Yes” if you want this feature to be activated, “No” otherwise.
Shipping Confirmation Mail Choose “Yes” if you want Shopgate to send a shipping confirmation mail after the shipping status has been transmitted to Shopgate, “No” otherwise.
Cancelled Select the status you set on orders that have been cancelled. This is used to synchronize the cancellation status of orders with Shopgate.

 

4.5 System Settings

Shop system encoding Choose the encoding of your system. This is usually “ISO-8859-15” for xt:Commerce 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 dropdown menu box above, provide a custom URL to the Shopgate API here.

 

4.6 Facebook Pixel Tracking for Desktop Shop

If you want to use Facebook Pixel for your xt:Commerce 3 Desktop Shop, please contact App Marketing.
View Content Event Choose Activate or Deactivate.
Add To Cart Event Choose Activate or Deactivate.
Purchase Event Choose Activate or Deactivate.

facebook_pixel_tracking.png

Comments