Setting Up an osCommerce Shopping Cart

Note: The information in this article reflects the changes made to the Version 2.4 integration script provided by Stone Edge Technologies, Inc. for osCommerce shopping carts. There is now a single script that supports all osCommerce cart types and the script is downward compatible with all known releases as of August, 2009. The Authorize.net Payment Module is now available as a separate download, it is no longer included in the same zip file that contains the integration script.

 

The four osCommerce-based shopping carts that the Order Manager supports -- osCommerce 2.2, osCMax, CRE Loaded v6 (minimum version), and Zen Cart v1.2 (minimum version) -- require the installation of a PHP integration script to facilitate order import, inventory import, and quantity-on-hand synchronization. This document describes how to obtain and install the integration script in the shopping cart, how to set up an osCommerce shopping cart in the Order Manager, and how to customize the integration script if necessary.

 

Click on a link to jump to that section of the article:

Install the Integration Script

Setting Up the Shopping Cart

Customize the Integration Script (Optional)

 Install the Integration Script

  1. Go to the Stone Edge Technologies, Inc. Software Download Gateway page. (Refer to the email from Stone Edge Technologies, Inc. when the Order Manager was purchased. Click the link to the download gateway and put in the username and password that was provided in the email or go to www.stoneedge.net/dlgateway and enter the proper credentials.)

  2. Go to the Other Downloads section of the page; locate and click on the Download button next to osCommerce PHP Integration Script. The file will be named "oscommerce-import.zip".

  3. Make a note of where the file is saved.

  4. If necessary, navigate to the zip file using My Computer or Windows Explorer.

  5. Extract the files by right-clicking on the file name, select Extract All and follow the prompts.

  6. The zip file contains the following files:

- osc-import.php : the import script to be used for all variations of osCommerce carts

- README: release notes and abbreviated installation instructions

- VERSION: revision information about prior releases

  1. Install the integration script in the website's root directory (sometimes referred to as the catalog directory) of your shopping cart using an FTP client or some other file transfer utility. The location may vary based on the type of osCommerce cart being used (osCommerce 2.2, osCMax, CRE Loaded or Zencart). The merchant will need to determine the correct location for the script. Contact the web host for assistance. Once the script has been transferred to the website, make a note of the location of the script, and follow the instructions in the next section of this article to create a "shopping cart" in the Order Manager.

Setting Up the Shopping Cart

  1. To create an osCommerce Shopping Cart, go to Maintenance Menu>Cart Functions>Create/Edit Shopping Carts or click the Create/Edit Shopping Cart link in the Quick Clicks section of the main menu.

  2. Click the Add Cart button.

  3. Enter a value in the Store Name field. The value entered should easily identify the web site that it represents, but do not include ".com" in the name of a shopping cart.

  4. Select osCommerce from the drop-down list as the Cart Type for any of the cart variations (osCommerce, CRE Loaded, osCMax or Zencart). If the user is only licensed for one shopping cart type, the Cart Type drop-down box will not be visible.

  5. In the CartID/User Name and the Cart Password fields, enter the appropriate username and password combination for the type of shopping cart:

    1. osCommerce 2.2: Enter the Admin username and password that is used to access the osCommerce administrator panel.

    2. osCMax: Enter the Admin email address and password associated with the osCMax account.

    3. CRE Loaded v6: Enter the Admin email address and password associated with the CRE Loaded account.

    4. Zen Cart v1.2: Enter the Admin username and password that is used to login to Zen Cart’s administrator panel.

    If you are using the correct Admin username/password or correct Admin Email address/password but still receive the message "Access Denied", use the MySQL database username and password combination instead. The database username and password can be found in the Web site's root directory. Find the "Includes" folder and look in the file named "configure.php". The database username and password should be found at the end of the file. Refer to Figure 1 to see an example.

Figure 1: Example of database username and password as seen in the configure.php file  

  1. Re-enter the password entered in the previous step.

  2. It is not necessary to put a value in the Store Code field at this time. Skip to the next step.

  3. In the Script URL field, enter the path to the Order Manager integration script. Refer to step 7 in the previous section of this document. For example: www.mysite.com/catalog/osc-import.php

  4. Click the Test Script URL button to validate the accessibility of the script.

  5. A message box will appear to indicate the success or failure of the test.

    1. A successful test will show a message box stating: "Test passed: Script version: [X.XX]" Note: This test does not validate the username and password, merely the accessibility of the script.

    2. If an error message is displayed, verify the location of the script in the web site and ensure that the Order Manager Shopping Cart definition matches exactly.

    3. All connections to the script take place via secure HTTP (https://). If the error message indicates a "404 Not Found" or "Page could not be displayed" error, contact the web host to verify the secure URL and location of the integration script.

  6. Click the Save button to store the cart definition. If changes need to be made in the future, click the Edit Cart button to access the settings.

Figure 2: Shopping Carts screen

Customize the Integration Script (Optional)

The standard integration script as provided by Stone Edge Technologies, Inc. can be customized to meet the requirements of the business or those of the website host, but in most cases it is not required. However, if a store (shopping cart) is using a customized version of osCommerce and/or the standard database structure has been changed (either through the installation of 3rd-party contributions or code modifications), the standard Stone Edge integration script may NOT work correctly as provided and therefore may require custom changes to the script to match the custom changes made in the website.

IMPORTANT NOTE:  The integration script must be edited using a capable text editor (NOT Notepad) that will preserve the endline formatting. Editing as described in the next section of this article 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 at first. If it becomes apparent that changes need to be made, please contact either the web host, a PHP developer, or Stone Edge Technologies, Inc. (at an additional cost for custom coding services) to assist you.

 

There are several sections near the top of the PHP script that are relevant to customizing the script:

Payment Method Language Files Statement

The integration script tries to detect how to parse payment information based on the text of the payment method used at checkout. The language files associated with the payment module that is installed at the website include variables that contain information about the payment transaction, such as the name of the payment method, etc., which is written to a table in the osCommerce SQL database. It is imperative that the $language variable in the integration script matches the language type designated during the setup of the website (shopping cart). Change the value of the variable $language, as shown in the example below, only if the default checkout language of the cart is not English.

Note: The Stone Edge Order Manager integration script currently only supports the use of a single language and it should be set to match the language type that is chosen during the cart setup process at the website, or problems could be encountered when processing payments. It should also be noted that Stone Edge Technologies, Inc. only provides the English language files with the Authorize.net payment module provided for use with osCommerce carts.

// Include the standard payment method language files (if available)

$language = "english"; // name of folder containing local language files

Limit Status Codes Statement

This statement controls whether the integration script treats certain order statuses as "ready" to export. In the example as shown below, the script is set to import orders of any status.

// Limit imported orders to the following status code (-1 = all, default all)

define('USE_STATUS', -1);

Taxable Goods Statement

The default for taxable goods is Tax Class 1, as shown in the example below. If the tax settings were modified in the website (cart), the script should also be modified to reflect those changes. Otherwise, it is highly recommended that these settings are NOT changed.  

// Which tax class should your products have to be considered "Taxable Goods"? (default 1)

define('TAXABLE_GOODS', 1);

Payment Gateways and Payment Types

Payment Gateways

Note1: ZenCart supports Authorize.net without the SETI supplied payment module.

Note2: ZenCart version 1.3.7.1 or higher is required for PayPal Express / Website Payments Standard support.

ZenCart version 1.3.8 or higher is required for PayPal DirectPay / Website Payments Pro support.

Payment Types

 

See Also

Authorize.net Payment Module for osCommerce Carts

Inventory Synchronization

Updated: 7/26/11