# How To ... Setup the ZenCart Interface

PhreeBooks has a built in interface with the ZenCart e-commerce shopping cart. The interface provide the following functionality:

- Download orders from Zencart to PhreeBooks
- Upload products to ZenCart from PhreeBooks

#### Pre-requisites

Order Download Function - None

Inventory Upload Function - Additional inventory fields are required to match up with the fields used in ZenCart. It is recommended that a new inventory category be added containing the fields needed for the ZenCart interface.

Field Name (case sensitive) | Field Type | Description
catalog | Checkbox | Used to identify products that can be uploaded to ZenCart. If the checkbox is selected, an icon will appear allowing the pdoduct to be uploaded to ZenCart.
category_id | TextField | Needs to match exactly with the category as defined in ZenCart. The ZenCart category must be the lowest level in the category tree.
manufacturer | TextField | Needs to match exactly with the manufacturer as defined in ZenCart.

#### Installing the files in ZenCart

At the ZenCart enable website, the PhreeSoft PhreeBooks-ZenCart module needs to be installed. the package is available at the PhreeBooks website and the ZenCart website.

1. Unzip the files into the Zencart folder and follow the installation instructions.
2. Install the functions desired.
3. Configure the functions per the module installation instructions. When pointing the ZenCart download functions, use url: https://yourdomain.com/PhreeBooksDir/modules/soap/(function).php. i.e. order.php for downloaded orders. (HTTP:// may be used for non-SSL transactions)

#### Installing the ZenCart Module

1. From the Tools -> ZenCart Interface menu select the function to activate and press Install.
2. Press edit to set the parameters for the interface function (see each function detail below for parameters to set).
3. After the parameters have been set, press Update to save the changes.

#### Setting the function parameters

Order Download Function

1. After installing the function. The only parameters to set are the enable/disable checkbox and the sort order.

Inventory Upload Function

1. Install the function if not already installed.
2. Press the Edit button to enter edit mode.
3. Click the enable checkbox.
4. Set the sort order to a non-zero value.
5. For the PhreeBooks XML URL, enter https://yourdomain.com/ZencartDir/admin/soap/products.php.
6. Enter an admin username and password. This can be an existing user, or better, a new user whose activity can be monitored in the admin log file.
7. If price sheets are to be used to set the upload pricing, set the True radsio button and then select a price sheet from the pull down menu. NOTE: At least one price sheet needs to be defined to upload using price sheets. If price sheets are not used, the Retail or Full Price will be used.

#### Using the ZenCart Functions

Order Download Function

1. Orders can b downloaded by logging into your Zencart shoppping cart and selecting Customers -> Orders. From the order screen an icon will be added indicating whether an order has been downloaded or not. If not, press the icon and the order will be downloaded to PhreeBooks (as a sales order) and the order page will reload. The download icon for the order downloaded will not be shown indicating the order was successfully downloaded to PhreeBooks.
2. If there are download errors during the process, an error message will be displayed. Fix the error and retry.

Inventory Upload Function

1. Select Inventory -> Maintain. The list of inventory items will be displayed with an upload icon appearing next to the products that have been identified as catalog items. (Catalog items are items that have the added inventory field catalog checked)
2. If there are upload errors during the process, an error message will be displayed. Fix the error and retry.

#### Additional Information

Adding Inventory Categories
Adding Inventory Fields
Adding Price Sheets