Zynk Workflow Documentation

This task will update order statuses in Magento, and optionally add a comment. See below for a sample input file.

Settings

Connection

Required
The Magento V2 connection to use. See the Connecting to Magento V2 article if you require more information on how to create/manage connections.

Fail File

Required
The XML file to save failed order updates to. The data will be written in the same format as the input file.

Input File

Required
The XML file containing the orders to be updated in Magento.

Success File

Required
The XML file to save successful order updates to. The data will be written in the same format as the input file.

Prevent Reprocessing

Required
Set to true to prevent the same record being processed more than once by the task. This setting will only work where an <external_id> element is provided in the XML.

Store View Code

Required
The magento store view code to perform the API calls against. Default value of ‘all’.

Zynk Settings

See Common Task Settings.

Examples

A sample input file is shown below. This will change the status of order 000000001 to ‘Processing’, and add a comment.

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfOrderStatusHistory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <OrderStatusHistory>
    <parent_id>1</parent_id>
    <parent_increment_id>000000001</parent_increment_id>
    <status>processing</status>
    <comment>Order imported into Sage</comment>
  </OrderStatusHistory>
</ArrayOfOrderStatusHistory>

Sample XSLT file to use to transform orders exported from Sage in the Zynk XML Sales Orders format, to the Magento order update format. This is also available in the Auto Mapper.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
    <xsl:output method="xml" indent="yes"/>

    <xsl:param name="Status" /><!-- Required - Enter the status to set in Magento -->
    <xsl:param name="Comment" /><!-- Optional - Enter the comment to set in Magento -->
    
    <xsl:template match="Company">
        <ArrayOfOrderStatusHistory>
            <xsl:for-each select="SalesOrders/SalesOrder">
                <xsl:call-template name="OrderInfo" />
            </xsl:for-each>
        </ArrayOfOrderStatusHistory>
    </xsl:template>
    
    <xsl:template name="OrderInfo">
        <OrderStatusHistory>
            <parent_increment_id><xsl:value-of select="CustomerOrderNumber" /></parent_increment_id>
            <status><xsl:value-of select="$Status" /></status>
    
            <xsl:if test="$Comment != ''">
                <comment><xsl:value-of select="$Comment" /></comment>
            </xsl:if>
        </OrderStatusHistory>
    </xsl:template>
    
</xsl:stylesheet>

Back | Edit on Github