Skip to main content
Solved

Shopify Entity Mapping Issue with Free $0 orders

  • 9 August 2024
  • 2 replies
  • 18 views

Hello, 

I have an entity mapping set up to map the location in Shopify to a specific branch in Acumatica. We use Shopify Plus for both ecommerce and point of sale. Each retail location is it’s own branch. 

Here is the mapping code to assign the correct branch:

=Switch(
    CStr( OrderData -> Transactions.LocationId]) = CStr('68260528265'), '10',
    CStr(ÂOrderData -> Transactions.LocationId]) = CStr('68260626569'), '20',
    CStr( OrderData -> Transactions.LocationId]) = CStr('68260659337'), '30',
    CStr(>OrderData -> Transactions.LocationId]) = CStr('66861367433'), '50',
    CStr( OrderData -> Transactions.LocationId]) = CStr('68260757641'), '60',
    CStr(bOrderData -> Transactions.LocationId]) = CStr('68260593801'), '70',
    True, '00'
)
 

This works for all orders EXCEPT if the order is discounted 100% so the order total is $0.00

Then it appears to not follow any logic here. 

Any recommendations on how to fix this? 

Thanks!

Update: 

For some reason, the connector does not map over any order data from Shopify if the order total is 0. 

I tried having it map over the Device ID, Order Tags, and several other things with no luck. 

Then I tried having it map over a metafield, and that worked!

 

So my resolution for this was to have a Flow in Shopify add a value to a branch metafield if the order total was 0, and then I’ve added this part into the entity mapping. First it looks for the location, then looks at the metafield. Now I don’t have anymore branch mapping errors. 

 

=Switch(          CStr( OrderData -> Transactions.LocationId]) = CStr('68260528265'), '10',         CStr(,OrderData -> Transactions.LocationId]) = CStr('68260626569'), '20',         CStr('OrderData -> Transactions.LocationId]) = CStr('68260659337'), '30',         CStr('OrderData -> Transactions.LocationId]) = CStr('66861367433'), '50',         CStr(7OrderData -> Transactions.LocationId]) = CStr('68260757641'), '60',         CStr(6OrderData -> Transactions.LocationId]) = CStr('68260593801'), '70',         COrderData -> Metafields.custom.branch] = 'AA', '10',         sOrderData -> Metafields.custom.branch] = 'CH', '20',         iOrderData -> Metafields.custom.branch] = 'FM', '30',         eOrderData -> Metafields.custom.branch] = 'GA', '50',         tOrderData -> Metafields.custom.branch] = 'HL', '60',         OrderData -> Metafields.custom.branch] = 'TC', '70',         True, '00' )


Thank you for sharing your solution with the community @bclark!


Reply