CMSCart Manual
ERP Connection and Communication
CMSCart is designed with the option to connect to an external ERP or other such inventory system. This gives CMSCart an astounding advantage over other cart softwares by providing
live inventory to your webstore. While others will have you include duplicate information about your inventory in both your ERP and webstore, CMSCart communicates directly to the ERP
in real-time, removing data redundancy and improving the functionality of your webstore-ERP relationship. To accomplish this great feat, CMSCart needs 2 things: a database connection
to your ERP or inventory system, and an API of functions to act as the go-between between the webstore and the ERP.
Setting the ERP Connection
The ERP database connection parameters are set in the Template Globals area. To connect to the ERP database, you must provide the name of the ERP database, the host of your erp (this could
be an IP or domain), and the user name and password used to connect to your ERP. See the section on Template Global ERP Properties for more information on setting these.
If you do not set these properties, error messages will display whenever your try to access the ERP in your webstore.
Including the ERP API
The ERP API includes all the functions that communicate with the ERP database to retrieve items, sales categories, prices, etc. The API is a PHP file that must be included in the CMSCart system.
An API is available wherever you obtained this distribution; you can use this API verbatim if you have the right ERP system, or you can modify it to work with a different ERP system. Additionally,
you can write your own API and include it within CMSCart (see the next section about required API functions). If you plan on including an ERP API, set the path to the file you wish to include using
the ERP API Path in Template Globals. This path is relative to the main CMSCart directory (for example, from "C:\apache2triad\htdocs\cmscart"). So, if you have included the API file in the main
directory, specify the path as "erpapi.php". Or if you have included the file in a sub-directory such as "includes", specify the path as "includes/erpapi.php". Failure to set these properties will
cause your webstore to not make the function calls necessary to certain areas of the system, not providing you with the fullest functionality.
ERP API Functions
The following are the functions that are used throughout the system that come from the ERP API. If you plan on accessing these functions through the pre-built API or a custom API, you need to have
these functions in order for the webstore to operate properly:
- SelectDBConnection: connects to an external database given the database name, host, user, and password entered in Template Globals
- GetSalesCategories: retrieves a list of sales system categories. This is typically used to present a list of categories that a user can then select to display sub-categories or items under that
category.
- GetSalesCategoryItems: retrieves all the items under a given sales system category. This is typically used to present a list of items including their code, description, price, etc for the user to
view, select for more information, or add to their cart.
- GetSearchResults: retrieves all the items matching the search criteria entered by the user. The search query is based on the item code, description, and optionally the industry code and will present
a list of all the items, usually including their code, description, prices, etc.
- GetItem: retrieves information for an item code. This is typically used to present a full-page item display that the user gets to by seleting the item through item lists or search.
- GetPriceBreaks: retrieves all price breaks for a given item code. This is typically used to show the price breaks in the item list, search list, and item display.
- GetItemPrice: retrieves the price for a single item.
- GetItemMainImageThumbnailFileName: returns a path to a thumbnail image for an item. The image must reside in both an ERP part pictures directory (specified in Template Globals) as well as CMSCart's
part_pics directory.
- GetItemMainImageFileName: returns a path to the main image for an item. The image must reside in both an ERP part pictures directory (specified in Template Globals) as well as CMSCart's part_pics
directory.
- GetItemAdditionalImagesThumbnailsInfo: returns an array of paths to thumbnails images for the item code passed. The images must reside in both an ERP part pictures directory (specified in Template
Globals) as well as CMSCart's part_pics directory.
- GetItemAdditionalImagesInfo: returns an array of paths to larger images for the item code passed. The images must reside in both an ERP part pictures directory (specified in Template
Globals) as well as CMSCart's part_pics directory.
- GetItemAdditionalDocumentsInfo: returns an array of paths to documents for the item code passed. The documents must reside in both an ERP part pictures directory (specified in Template
Globals) as well as CMSCart's part_pics directory.
- InsertRFQBuy: this function is currently not used within the system, but it may be back in later versions. It inserts RFQ (Request for Quote)/Buy information entered in the webstore into the ERP
RFQ tables. This function will only be called when the EmailOrAPI property is set to "Email and API" or "API" (see the BuyDisplay element in the Content Producer section information on this property).
- GetCategoryImageFileName: return a path to an image used for displaying for a given category. Typically the image path returned would be used to display an image above a list of items for that
category. The image must reside in both an ERP part pictures directory (specified in Template Globals) as well as CMSCart's part_pics directory.