The three osCommerce-based shopping carts that the Order Manager supports -- osCommerce Milestone 2, CRE Loaded v6, and Zen Cart v1.2 -- require installation of a PHP script to facilitate order import, inventory import, and quantity-on-hand synchronization. This document describes how to install the appropriate export script for your shopping cart, how to set up an osCommerce shopping cart in the Order Manager, and how to customize the export script if necessary.
Go to the Stone Edge Technologies, Inc. Software Download Gateway page. (Refer to the email you received from Stone Edge Technologies, Inc. when you ordered the Order Manager.)
Download the zip file named "oscommerce-import.zip".
Make a note of where you save the zip file.
If necessary, navigate to the zip file using My Computer or Windows Explorer.
Extract the files: right-click on the file name, select Extract All and follow the prompts.
The zip file contains the following files:
- ms2-import.php (osCommerce Milestone 2)
- loaded-import.php (CRE Loaded v6)
- zencart-import.php (Zen Cart v1.2)
- README: release notes and abbreviated installation instructions
- VERSION: revision information about prior releases
Install the appropriate import script for your shopping cart at one of the following locations using an FTP client or some other file transfer utility.
- ms2-import.php: in your store’s MAIN CATALOG directory (usually named "catalog")
- loaded-import.php: in your store’s MAIN CATALOG directory (usually named "catalog")
- zencart-import.php: in your store’s DOCUMENT ROOT (usually also the location of the file "index.php")
Test the script’s functionality: open a web browser, enter the URL of your export script in the address bar adding a version request. For example:
https://www.mysite.com/catalog/ms2-import.php?setifunction=sendversion
https://www.mysite.com/catalog /loaded-import.php?setifunction=sendversion
https://www.mysite.com/zencart-import.php?setifunction=sendversion
You should see a message similar to "SETIResponse: version=1.80".
Note: All connections to the script take place via secure HTTP (https://) therefore it is necessary to test the accessibility of the script in this way. If your site displays a "404 Not Found" or "Page could not be displayed" error, contact your host to verify the secure URL and location of the import script.
1. In the CartID/User Name and the Cart Password field, enter the username and password appropriate for your shopping cart type:
- osCommerce Milestone 2: The uername and password are identical to your MySQL DATABASE LOGIN CREDENTIALS.
- CRE Loaded v6: The username and password are your ADMIN E-MAIL ADDRESS AND PASSWORD that you use to login to CRE Loaded’s administrator panel.
- Zen Cart v1.2: The username and password are your ADMIN USERNAME AND PASSWORD (and not e-mail address as above) that you use to login to Zen Cart’s administrator panel.
2. In the Script URL field, enter the path to the Order Manager export script. For example:
www.mysite.com/catalog/ms2-import.php (Milestone 2)
www.mysite.com/catalog /loaded-import.php (CRE Loaded v6)
www.mysite.com/zencart-import.php (Zen Cart v1.2)
3. Click the Test button to validate the URL.
4. You should see a message similar to "Test passed: Script version: [X.XX]" Note: This test does not validate the username and password.
IMPORTANT NOTE: If your store is using a customized version of osCommerce and/or you have changed your database structure (either through the installation of 3rd-party contributions or code modifications) the Stone Edge export scripts may NOT work correctly! You may have to customize the export script to accommodate these changes. Export script changes should be performed by a PHP developer or Stone Edge Technologies at our hourly development rate.
Customize the Export Script
You may edit the export script to customize the export process to your meet your own requirements or those of your website host. PLEASE NOTE: The export script must be edited using a capable text editor (NOT Notepad) that will preserve the endline formatting. Editing as described below should only be attempted by an experienced PHP programmer and/or system administrator. If you are unsure of whether or not you need to edit the script, do not edit it. Use the script without modifying it first. If you need to make changes at a later date but are not confident doing so yourself, please contact either your web host, a PHP developer, or Stone Edge Technologies to assist you.
There are several sections near the top of the PHP script that are relevant to customizing the script. Not all options are present in all versions of the import scripts.
// Pull site configuration variables from osCommerce. (recommended)
require('includes/configure.php');
require('includes/database_tables.php');
The files "configure.php" and "database_tables.php" should exist within the scope of your PHP script. If they are not located in a directory called "includes" at the script’s install location, you should change these includes to suit your needs.
// Include the standard payment method language files (if available)
$language = "english"; // name of folder containing local language files
@include_once "includes/languages/$language/modules/payment/authorizenet.php";
@include_once "includes/languages/$language/modules/payment/cc.php";
@include_once "includes/languages/$language/modules/payment/moneyorder.php";
@include_once "includes/languages/$language/modules/payment/cod.php";
@include_once "includes/languages/$language/modules/payment/paypal.php";
@include_once "includes/languages/$language/modules/payment/payflowpro.php";
The export script tries to detect how to parse payment information based on the text of the payment method used at checkout. These scripts from your language files have various constant variables that contain the name of the payment method written to the database. You may wish to change the variable $language if your default checkout language is not English.
// Override language settings?
define('AUTHNET_TITLE', MODULE_PAYMENT_AUTHORIZENET_TEXT_TITLE);
define('PAYFLOW_TITLE', MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE);
define('MONEYORDER_TITLE', MODULE_PAYMENT_MONEYORDER_TEXT_TITLE);
define('COD_TITLE', MODULE_PAYMENT_COD_TEXT_TITLE);
define('CC_TITLE', MODULE_PAYMENT_CC_TEXT_TITLE);
define('PAYPAL_TITLE', MODULE_PAYMENT_PAYPAL_TEXT_TITLE);
The script attempts to match payment method using the language constants included above. If payments are not being detected properly at import, you may change the value of, for example, "AUTHNET_TITLE" to read:
define('AUTHNET_TITLE’, "Credit Card’);
This causes the script to attempt to parse payment information for any order listed as paid by "Credit Card" as it normally would for an Authorize.net payment. If you do not understand what this means, please do not change the constant values.
// Limit imported orders to the following status code (-1 = all, default all)
define('USE_STATUS', -1);
// Update order status after import? (default false)
define('UPDATE_ORDER_STATUS', false);
// Order status ID for updated status? (default 2, "processing")
define('UPDATE_STATUS_TO', 2);
// Consider the customer notified when doing so? (1 = yes, 0 = no; default 0 - set to 1 if automatically e-mailing confirmations from OM)
define('UPDATE_STATUS_CUSTOMER_NOTIFIED', 0);
These settings control whether the export script treats certain order statuses as "ready" to export, and can optionally update the order status history of a particular customer during download. You must specify that you want to use this feature, and if so, whether you want the "Customer notified?" checkmark next to the updated order status.
// Which tax class should your products have to be considered "Taxable Goods"? (default 1)
define('TAXABLE_GOODS', 1);
// Import all product tax classes or only a specific one? (-1 = all, default all)
define('TAX_CLASS_TO_IMPORT', -1);
The default for taxable goods is Tax Class 1, and if was modified in your store, you should change the first constant listed above. The export script can be limited to importing only a particular type of taxable product if desired but this is a rare requirement. It is recommended you do not change these settings unless you changed the tax setup in osCommerce extensively.
// Delete credit card numbers after import? (default false)
define('DELETE_CC', false);
Credit card information can be purged during export, but this feature is NOT recommended because exports sometimes fail before being written successfully to your Order Manager data file. If the export fails, the script will still contain purged CC data and the new orders WILL BE UNRECOVERABLE (except from a backup of your osCommerce store database). On the other hand, some merchants may want to keep as little credit card detail stored in the database as possible which reduces their liability in case of a security breach. For more information on securing credit card data in the Order Manager, click here.
See Also