How do I have the web store sync skip certain orders?

Add some conditions to the Order Document > Order > Skip Message in the web store mapping and have those conditions return empty text if the order shouldn't be skipped. Otherwise, add conditions to the Order table for the Source Values.

For some web store syncs, you may want to have it skip certain orders that are not ready to be brought into Acctivate.  Perhaps the payment is still pending or there is some sort of hold.  Maybe some orders need to be completely ignored since there is no intention of ever bringing them into Acctivate such as Cancelled or Completed web orders.  By default, many of the web store templates built into Acctivate already handle some of these situations.  However, if you have special criteria or the template you're using just doesn't take a certain scenario into account, you may need to make some changes to the sync template.

Skipping Web Store Orders

mapping1The Acctivate web store sync is capable of skipping certain orders and allowing you to attempt to re-sync them again at a later time using Business Alerts.  To do this, the sync needs to know what to look for within the information sent from the web store. Inside the web store sync template configuration, the mapping value that controls this is called "Skip Message" and is under Order Document > Order within the Mapping screen.  Like any other field in the mapping, a Source Value must be mapped to it in order for it to function.  The way it works is that if the value mapped returns empty text, it will continue on and not skip the order.  However, if the value returned does have text, the order will be skipped and the sync log will display the text returned.

Some templates, such as the one for Shopify, have nothing mapped to Skip Message so a value will need to be created with Source Values (the screen before Mapping) and then that value needs to be mapped to Skip Message.  However, other templates like WooCommerce already have a value and may just need modification.

Order Skipping Example:

To show how the source value should work, we'll use the WooCommerce template as an example.  Within the Source Values screen and under the Values of the "order" subdocument, there is a value called "skip_message".  The Match is going through the XML document for a particular order until it reaches the "status" node which indicates the order status.  The Select is then deciding what the source value will return to the mapped field.

MATCH:
/root/item/status
SELECT:
a:IIf(./text()= 'pending', 'Payment is pending. Adding order to Web Store tab in Business Alerts', '')

In this case, it checks to see if the status (represented by a period since it's in the Match) is currently "pending".  If it is, it will return the "Payment is pending..." text to the mapped field.  Otherwise, it will return empty text (just two single quotes).  Because of how the Skip Message field works, this means that pending orders will be skipped and anything else will come through as normal.

sourcevalue

Please keep in mind that the specific values and code in this example are for WooCommerce and other web stores will likely use different values and paths.  To control for multiple values, you can use multiple levels of "a:IIf()" functions within the Select.

Ignoring Web Store Orders

Sometimes there is no reason to bring particular orders within Acctivate.  Orders that were cancelled within the web store before Acctivate had the chance to sync it would be a good example.  Unlike skipped orders, Acctivate will never go back and try to re-sync this order again and will continue to ignore it even if you attempt to sync that specific order manually with the More Options button.  This process also differs from the skipping process in that you don't use the Mapping or mappable values to control it.  Instead, this is controlled in the Tables section of the Source Values screen.

Order Ignoring Example:

To show how ignoring certain orders works, we'll look at the BigCommerce sync template as an example and keeping the with the theme of filtering on certain order statuses.  Within the Source Values screen and under the "order" subdocument, there is the Tables section.  For controlling order statuses, the Order table is what will be used since this the order header information.

SELECT:
/orders/order[status='Awaiting Pickup' or status='Awaiting Shipment']

In this template, the Order table is pulling each unique "order" node and bring that in as a specific sales order.  However, that alone will bring in everything.  To filter it down, brackets are added for each condition.  In the BigCommerce example, the order will only be brought into Acctivate if the status is awaiting pickup or is awaiting shipment.  Any other orders will be completed ignored, even if you specify that order in a manual sync.

tables