The current Acumatica Shopify Connector doesn’t process the shipping information during Sales Order Import. But in some cases, Shopify Order will be fulfilled by other 3rd party service, and you want to import the shipping information into Acumatica Order if the order has been fulfilled.
This request can be resolved by using customization project:
namespace PX.Commerce.Shopify
{
public class SPSalesOrderProcessor_Extension : PXGraphExtension<SPSalesOrderProcessor>
{
public delegate void SaveBucketImportDelegate(SPSalesOrderBucket bucket, IMappedEntity existing, String operation);
PXOverride]
public virtual void SaveBucketImport(SPSalesOrderBucket bucket, IMappedEntity existing, String operation, SaveBucketImportDelegate baseMethod)
{
//Local is the API Object from Acumatica
SalesOrder localOrder = bucket.Order.Local;
//Extern is the API Object from Shopify
OrderData externOrder = bucket.Order.Extern;
//You can check FulfillmentStatus and Fulfillments object to ensure order has fulfillment data
//If order is unfulfilled, externOrder.Fulfillments is null
if ((externOrder.FulfillmentStatus == OrderFulfillmentStatus.Fulfilled || externOrder.FulfillmentStatus == OrderFulfillmentStatus.Partial)
&& externOrder?.Fulfillments?.Count > 0)
{
//Process the fulfillment data as what you want
foreach(FulfillmentData fulfillmentItem in externOrder?.Fulfillments)
{
if(fulfillmentItem.Status == FulfillmentStatus.Success) //You can handle data based on each fulfillment item status
localOrder.Note += $"Tracking Company: {fulfillmentItem.TrackingCompany}, tracking number: {string.Join(",",fulfillmentItem.TrackingNumbers)}";
}
}
baseMethod(bucket, existing, operation); // calling the base met
}
}
}
Now the shipping information will be auto updated to “Notes” field in Acumatica Order.