Order Status Uploads - CV3

From NewHaven Software Wiki

(Difference between revisions)
Jump to: navigation, search
(Created page with '== CMS == CMS uploads status for orders that have been set as shipped and have not yet had their status uploaded (ORDERHDR.STATUS_UPDATE = 1). === V9+  === CMS uploads t…')
(CMS Setup and Use)
 
(17 intermediate revisions not shown)
Line 1: Line 1:
== CMS ==
== CMS ==
 +
As part of the web service communications between CMS and CommerceV3 (CV3), CMS's [[eCMS Module]] can be configured to upload order status (and tracking number where applicable) for CV3 orders that have been set as shipped in CMS, are associated with a CV3 order source (downloaded from CV3), and have not yet had their status uploaded.
-
CMS uploads status for orders that have been set as shipped and have not yet had their status uploaded (ORDERHDR.STATUS_UPDATE = 1).
+
CMS uploads three types of statuses:
-
 
+
-
=== V9+  ===
+
-
 
+
-
CMS uploads two types of statuses:
+
*Shipped {date}
*Shipped {date}
Line 16: Line 13:
**This status will be set for orders that have more than one package and at least one (but not all) packages are shipped
**This status will be set for orders that have more than one package and at least one (but not all) packages are shipped
-
=== Data passed to CV3 via webservice ===
+
=== Data passed to CV3 ===
-
Test case:  
+
Example of a multi-package order for illustration:  
 +
 
 +
*Order shipped on 9/23/2018
 +
*Recipient #1 shipped via UPS Ground with tracking number 1Z3123134135
 +
*Recipient #2 shipped via FedEx 2-Day with tracking number 4563543534
-
*Order shipped on 9/23/2012
 
-
*Recipient #1 shipped via UPS Ground with tracking number 123
 
-
*Recipient #2 shipped via UPS 2nd Day Air with tracking number 456
 
-
*Recipient #3 shipped via UPS Next Day Air with tracking number 789
 
-
<pre>&lt;orders&gt;
 
-
&lt;status&gt;
 
-
  &lt;orderID&gt;81&lt;/orderID&gt;
 
-
  &lt;status&gt;Shipped 9/23/2012&lt;/status&gt;
 
-
  &lt;tracking&gt;UPS: 789&nbsp;; UPS: 456&nbsp;; UPS: 123&lt;/tracking&gt;
 
-
&lt;/status&gt;
 
-
&lt;/orders&gt;
 
-
</pre>
 
{| border="1"
{| border="1"
|- bgcolor="green"
|- bgcolor="green"
Line 37: Line 26:
! Tracking
! Tracking
|-
|-
-
| Shipped 8/15/2012
+
| Shipped 9/23/2018
-
| UPS: 123&nbsp;; FedEx: 456
+
| UPS: 1Z3123134135 ; FedEx: 4563543534
|}
|}
-
==Formatting the data for site display==
+
==CMS Setup and Use==
-
===CV3 array data in member_orderdetail.tpl===
+
By default, CMS will not upload order status to CV3. You can easily enable this option to run immediately after your order downloads by checking the box for "Upload Order Status". Order status uploads can also be run manually from the eCMS toolbar by clicking the cart button with the arrow pointing up.  
-
<pre>
+
-
[order] => Array (
+
-
  [status] => Shipped 9/23/2012
+
-
  [tracking] => UPS: 789 ; UPS: 456 ; UPS: 123
+
-
  [order] => Array (
+
-
    [recipID] => Array (
+
-
      [ship_name] => Number
+
-
      [ship_lastname] => Three
+
-
      ...
+
-
      [ship_method_name] => UPS Next Day Air
+
-
      ...
+
-
      [detail_ship] => 30.00
+
-
    )
+
-
  )
+
-
)
+
-
</pre>
+
-
===Website display===
+
-
Current Status: Shipped 9/23/2012
+
-
'''Tracking information for this order:'''
+
[[image:StatusUpload.png]]
-
&nbsp;&nbsp;&nbsp;&nbsp;UPS - [http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=789 789]
 
-
&nbsp;&nbsp;&nbsp;&nbsp;UPS - [http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=456 456]
+
'''WARNING''' - If you are using order status uploads for the first time, there is a huge amount of data CMS will try to compile to upload since you have never submitted an upload before and this upload will likely fail. Please work with NewHaven Support to set your older orders as uploaded so you are only uploading current statuses.
-
&nbsp;&nbsp;&nbsp;&nbsp;UPS - [http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=123 123]
+
== Tech Info ==
 +
Both the CV3(NHS) and CV3(Public) plug-ins use the same web service hosted by CV3. Details of this WSDL can be found here - https://service.commercev3.com/index.php?wsdl Presently the CV3 plug-ins are hard-coded to communicate only with the web services hosted by CV3.
-
 
+
'''XML passed (inside CV3Data):'''
-
===Template modifications===
+
-
====member_orderdetail.tpl====
+
<pre>
<pre>
-
  <input type="hidden" id="memberordertrack" value="{$order.tracking}" />
+
<orders>
 +
<status>
 +
    <orderID>12345</orderID>
 +
    <status>Shipped 9/23/2014</status>
 +
    <tracking>FedEx: 456 ; UPS: 123</tracking>
 +
</status>
 +
</orders>
</pre>
</pre>
-
''Used to put the $order.tracking value in the template so it can be accessed by Javascript.''
 
-
<pre>
 
-
      Current Status:&nbsp;{$order.status|lower|capitalize}<br>
 
-
{if $order.tracking != ''}
 
-
      <span id="memberOrderTracking">
 
-
        <b>Tracking information for this order:</b><br>
 
-
      </span>
 
-
{/if}
 
-
</pre>
 
-
''Used to display $order.status as uploaded by CMS, and include a <span> tag for the tracking info if there is any in the PHP arrays.  The Javascript function below to populate the info only runs if the span is present.''
 
-
 
-
'''In js_bottom.js'''
 
-
<syntaxhighlight lang="javascript">
 
-
//Parse uploaded order status tracking numbers.  Mike::NHS::09252012
 
-
function parseOrderTracking() {
 
-
    var trackdata = document.getElementById('memberordertrack').value,
 
-
        tracks = [],
 
-
        baseURL = {
 
-
            'ups'  :  'http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=',
 
-
            'fedex' :  'http://www.fedex.com/Tracking?action=track&tracknumbers=',
 
-
            'usps'  :  'https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1='
 
-
        },
 
-
        i = 0,
 
-
        t = '',
 
-
        track = [],
 
-
        trackURL = '',
 
-
        trackSpan = jQuery('#memberOrderTracking'),
 
-
        output = '';
 
-
   
 
-
    // Split the tracking string.
 
-
    tracks = trackdata.split(' ; ');
 
-
   
 
-
    // Parse the string and output tracking URLs if a tracking number is present
 
-
    jQuery.each(tracks, function(i, t) {
 
-
        track = t.split(': ');
 
-
        if (track.length === 2) {
 
-
            trackURL = baseURL[track[0].toLowerCase()] + track[1];
 
-
            output = '&nbsp;&nbsp;&nbsp;&nbsp;' + track[0] + ' - <a href="' + trackURL + '" target="_blank">' + track[1] + '</a><br>';
 
-
           
 
-
            trackSpan.append(output);
 
-
        } else {
 
-
            // No tracking number for the shipment, so we display nothing for this line.
 
-
        }
 
-
    });
 
-
}
 
-
 
-
$(document).ready(function() {
 
-
</syntaxhighlight>
 
-
'''...'''
 
-
<syntaxhighlight lang="javascript">
 
-
    // Only run parseOrderTracking if on member_orderdetail and tracking info is present
 
-
    if (jQuery('#memberOrderTracking').length !== 0) {
 
-
        parseOrderTracking();
 
-
    }
 
-
</syntaxhighlight>
 
-
'''...'''
 
-
<syntaxhighlight lang="javascript">
 
-
});  // end of document.ready
 
-
</syntaxhighlight>
 

Current revision as of 18:40, 27 June 2019

Contents

CMS

As part of the web service communications between CMS and CommerceV3 (CV3), CMS's eCMS Module can be configured to upload order status (and tracking number where applicable) for CV3 orders that have been set as shipped in CMS, are associated with a CV3 order source (downloaded from CV3), and have not yet had their status uploaded.

CMS uploads three types of statuses:

  • Shipped {date}
    • If all packages are shipped
  • Processing
    • all new orders imported into CMS
    • Orders that are backordered
    • Orders with no packages
  • Processing : Last Shipment {date}
    • This status will be set for orders that have more than one package and at least one (but not all) packages are shipped

Data passed to CV3

Example of a multi-package order for illustration:

  • Order shipped on 9/23/2018
  • Recipient #1 shipped via UPS Ground with tracking number 1Z3123134135
  • Recipient #2 shipped via FedEx 2-Day with tracking number 4563543534
Status Tracking
Shipped 9/23/2018 UPS: 1Z3123134135 ; FedEx: 4563543534

CMS Setup and Use

By default, CMS will not upload order status to CV3. You can easily enable this option to run immediately after your order downloads by checking the box for "Upload Order Status". Order status uploads can also be run manually from the eCMS toolbar by clicking the cart button with the arrow pointing up.

image:StatusUpload.png


WARNING - If you are using order status uploads for the first time, there is a huge amount of data CMS will try to compile to upload since you have never submitted an upload before and this upload will likely fail. Please work with NewHaven Support to set your older orders as uploaded so you are only uploading current statuses.

Tech Info

Both the CV3(NHS) and CV3(Public) plug-ins use the same web service hosted by CV3. Details of this WSDL can be found here - https://service.commercev3.com/index.php?wsdl Presently the CV3 plug-ins are hard-coded to communicate only with the web services hosted by CV3.

XML passed (inside CV3Data):

<orders>
<status>
    <orderID>12345</orderID>
    <status>Shipped 9/23/2014</status>
    <tracking>FedEx: 456 ; UPS: 123</tracking>
</status>
</orders>
Personal tools