Magento
Technical Overview |
Last Revised: 01/18/17 |
The following documentation is intended to provide insight to Dynamo/Magento integration for programmers and developers. For an overview of changing settings in Dynamo at the end-user level, see the Magento integration general documentation page.
There are three functions during the process of online purchases where Dynamo interacts with Magento. These are exporting Dynamo product quantities and pricing to Magento, importing sales orders from Magento, and updating Magento with dynamo shipping information.
In addition to providing more detail on these 3 distinct interactions, the following documentation also provides the prerequisites for Dynamo integration with Magento, field mappings between the two programs, and customizing automatic Dynamo integration with Magento.
Contents
- Exporting Dynamo Products to Magento
- Importing Sales Orders from Magento
- Updating Magento With Dynamo Shipping Information
- Prerequisites for Dynamo Integration with Magento
- Field Mapping Between Dynamo and Magento
- Customizing Automated Dynamo Integration
Exporting Dynamo Products to Magento
Dynamo performs the following steps when exporting Dynamo products to Magento:
- Dynamo looks for the item in IM01, which is a table of all existing products entered into Dynamo
- Dynamo checks to see whether the item has been designated as an eCommerce product. All Dynamo products flagged with “Y” in the ECOOMMERCE field of table IM01 will be exported to Magento via SOAP. If not an eCommerce product, the process loops back to the beginning and examines the next product in the queue
- Dynamo checks whether the eCommerce product exists in Magento
- If the product does not exist in Magento, Dynamo will check to see if the Magento Category Parameter (MAGENTOCTG) is defined.
- If defined, Dynamo will use product category (PCT) and product class (PCL) as the category and subcategory for the product to be inserted.
- If not defined, the product category (PCT) and product class (PCL) will be designated by Dynamo as the root category and subcategory, respectively, in Magento.
- If the product does exist in Magento, Dynamo will check whether Magento Category Parameter (MAGENTOCTG) is defined.
- If defined, Dynamo will use MAGENTOCTG as a catch-all PCT for all products that will be inserted
- If not defined, Dynamo will use the PCT and PCL of the item/product as references for the category and subcategory in Magento.
- Dynamo updates data in Magento and advances to the next item in queue
Importing Sales Orders From Magento
Dynamo performs the following steps when importing sales order from Magento:
- Start of order processing
- Dynamo retrieves all orders that are in the “pending” status from Magento
- Dynamo retrieves the item details of the Magento order from IM01, which is a Dynamo table containing all existing items
- Dynamo checks whether the customer exists in CM01, which is a Dynamo table containing all previously entered customers. Matches are based on name, email address, mailing address, etc
- If the customer already exists, Dynamo will use the record in CM01 from a previously created account
- If the customer does not exist, Dynamo will use a predefined default customer from the Magento Integration Menu.
- Dynamo combines information from steps 3 and 4 and imports to SO90/91. SO90 contains the import order header for the sales order, while SO91 contains the import order details.
Updating Magento with Dynamo Shipping Information (Fig. 3)
Dynamo performs the following steps when updating Magento with shipping information:
- Sales order information is exported to SO40/41. SO40 contains the order headers for the sales order, while SO41 contains the order details
- Dynamo checks the inventory level and makes sure it is greater than zero.
- If Dynamo determines there is insufficient quantity on hand, it will wait for inventory.
- If there is sufficient inventory, Dynamo will proceed with processing the shipment
- An automatic process, scheduled at predetermined increments retrieves the tracking number
- Dynamo schedules the invoice to be updated
- The invoice is updated meaning it is ready to be sent to the customer
- Dynamo updates Magento with a completed invoice and tracking number
Prerequisites for Dynamo Integration with Magento:
The following conditions must be met before fully integrating Magento with Dynamo:
- MG00 fields must be populated
- Items in IM01 that need to be exported to Magento must have a “Y” flag in Dynamo’s ECOMMERCE field.
- MG00.CATADMIN field should be flagged as “Y” or “N”. If flagged as “N”, then MG00.ROOTCAT becomes required
- Dynamo must be the only the source of items imported to Magento
- WSI Compliance and Enable WSDL Cache must be enabled in the Magento Core API so that SOAP can be used by languages other than PHP.
- In order to incorporate Minimum Advertised Pricing Policy (MAPP), Enable MAP must be set to “Yes” in Magento admin under the System tab
-
The file app/code/core/Mage/Catalog/Model/Product/Api/V2.php in Magento must be modified. As background, SOAP v2 does not inherently allow you to modify or insert values in the custom product attributes. In the case of Dynamo/Magento integration, there are two custom attributes: UPC and VPN. Click here for more information on this slight modification.
Field Mapping Between Dynamo and Magento
Magento Description | Magento Field Name | Dynamo Description | Dynamo Field Name |
Product Name | Name | Description Line 1 + 2 + optional pricing unit indicator | IM01.DESC1$ + IM01.DESC2$ + IM610-PU$ |
Product Description | Short Description | Description Line 1 |
Set per item by user under Item Maintenance & Listings (IML) menu in Item Maintenance. |
Product Description | Long Description | Description Line 2 | Set per item by user under Item Maintenance & Listings (IML) menu in Item Maintenance. |
Root Category | Category | Product Category (PCT) | IM26.DESC$ |
Subcategory | Subcategory |
Product Class Description (PCL) |
IM27.DESC$ |
- | Root Category Meta Description | Product Category | IM26.PCT$ |
- | Subcategory Meta Description | Product Class | IM27.PCL$ |
SKU | SKU | Item Number | IM01.ITEMNO$ |
Weight | Weight | Weight | IM01.WEIGHT |
- | Price | Selling Price | call "IM610",Y$,IM610$,IM01$ dynamoprice=im610.NET[1] |
Inventory/Qty | Qty | Quantity Available | call "IC033",y$,rec$,ic033$ dynamoqoh=dynamoqoh+ic033.QOH |
Custom Field Added | UPC | UPC | IM04.BARCODE (where qty=1) |
Custom Field Added | VPN | Vendor Part Number | IM03.VENDPARTNO$ |
Sales Order # | Custom Field? | Dynamo Sales Order # | - |
Status | Order# | - | SO40.SONO$ |
- | Order Status | - | SO40.STATUS$ |
- | Qty Ordered | - | - |
- | Qty Invoiced | - | - |
- | Qty Shipped | - | - |
Freight Charges | Item Status | - | - |
# of Packages | Shipping&Handling Information | - | SO40.FREIGHT |
Tracking Number(s) | - | - | SO40.PACKAGES |
Customizing Automated Dynamo Integration
Dynamo has several tasks that will run in the background automatically at predefined intervals in order to "sync" information between itself and Magento. Known as chron jobs, these processes include ITEMINFO, GETORDERS, and ITEMQTY and time intervals can be customized according the following table.
ITEMINFO | If the product is flagged with a "Y" for ecommerce in Dyanmo, then Dynamo will push the product information to Magento at the set interval |
In the following example, ITEMINFO will be run weekdays at 11pm:
*/15 7-19 * * * /u/CDI/bin/background MG013 XX eCommerce_Integration GETORDERS bbj
ITEMQTY | For items that are flagged with a "Y" for ecommerce Dynamo updates Magento with the current quantity-on-hand |
In the following example, ITEMQTY will be run weekdays, between 7:10am and 7:10pm at hourly intervals occurring at 10 minutes past the hour:
10 7-19 * * 1-5 /u/CDI/bin/background MG013 XX eCommerce_Integration ITEMQTY bbj
GETORDERS | Dynamo retrieves all orders from Magento that have a "pending" status. |
In the following example, GETORDERS will be run every 15 minutes from 7am to 7pm, 7 days a week:
*/15 7-19 * * * /u/CDI/bin/background MG013 XX eCommerce_Integration GETORDERS bbj
"" | Use consecutive quotes to include all of the above modes in your argument |
In the following example, GETORDERS, then ITEMQTY, and finally ITEMINFO get run consecutively every 15 minutes from 7am to 7pm on weekdays only:
*/15 7-19 * * 1-5 /u/CDI/bin/background MG013 XX eCommerce_Integration "" bbj