Skip to main content

We have template items setup with matrix items that map to the BigCommerce variants. Client does not want price or weight to populate BigCommerce from Acumatica. They want to maintain that in BigCommerce only. I’ve set in both the Stock Item and Template Item entity to unmap these fields yet the variant in BigCommerce is updating the price/weight based on what is on the variant in Acumatica. Is there a better way to accomplish this? This is 22 R1 for reference.

 

@hayleehicks18 unfortunately, we still haven’t done ability to map Matrix Items and Variants. We will be working on it in the future versions.

However, now you can use this customization, if you want. It will unmap fields you have mentioned.

public class BCTemplateItemProcessorExt : PXGraphExtension<BCTemplateItemProcessor>
{
>PXOverride]
public void Initialise(IConnector iconnector, ConnectorOperation operation, Action<IConnector, ConnectorOperation> baseHandler)
{
baseHandler(iconnector, operation);

Base.GetType().InvokeMember("productvariantBatchProvider",
System.Reflection.BindingFlags.SetField | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance,
null, Base, newn] { new ProductVariantBatchRestDataProviderExt(BCConnector.GetRestClient(Base.GetBindingExt<BCBindingBigCommerce>())) });
}
}

public class ProductVariantBatchRestDataProviderExt : ProductVariantBatchRestDataProvider
{
public ProductVariantBatchRestDataProviderExt(IBigCommerceRestClient restClient) : base(restClient)
{
}

public override void UpdateAll(List<ProductsVariantData> productDatas, Action<ItemProcessCallback<ProductsVariantData>> callback)
{
foreach(ProductsVariantData variant in productDatas)
{
variant.Price = null;
variant.Weight = null;
variant.CostPrice = null;
variant.RetailPrice = null;
variant.SalePrice = null;
}

base.UpdateAll(productDatas, callback);
}
}

 


Hi @smarenich! Thanks for the code snippet. That worked. What would need to be added to that code snippet to also unmap the sync of sales categories? We don’t want sales categories to sync either as those should be maintained in BigCommerce. When I synced the template items, the sales categories in BC were wiped out. Any suggestions are appreciated. Thanks!


@hayleehicks18  starting from 2022r1 sales categories are optional. You can just disable category sync in the entities and also remove default categories in the store preferences. 

This should disable category sync.


@hayleehicks  and anyone else who finds this thread - just a heads up that in 2023R2 (release date - 10/5/23) Acumatica will begin supporting “Unmapping” specific data on variants. This use case that Haylee described will be supported in 23R2. Additionally, you’ll have the ability to map custom data to variants. 


@smarenich - Any chance Acumatica wishes to provide the community with a similar code snippet for Shopify? 🙂


@darylbowman , you can try this code in 2022r2 and 2023r1:

public class SPTemplateItemProcessor_Extension : PXGraphExtension<PX.Commerce.Shopify.SPTemplateItemProcessor>
{
public static bool IsActive() => CommerceFeaturesHelper.ShopifyConnector;
#region Event Handlers
public delegate void MapVariantInventoryItemDelegate(SPTemplateItemEntityBucket bucket, MatrixItems local, InventoryItem localInventoryItem, ProductVariantData external);
PXOverride]
public void MapVariantInventoryItem(SPTemplateItemEntityBucket bucket, MatrixItems local, InventoryItem localInventoryItem, ProductVariantData external, MapVariantInventoryItemDelegate baseMethod)
{
baseMethod(bucket, local, localInventoryItem, external);
external.Price = null;
external.OriginalPrice = null;
external.Weight = null;
}


#endregion
}


 


Thank you! Would've taken me a very long time, if I got there.


@KarthikGajendran - I’m testing 24R1 internally with some test data. 

Is the export mapping of Matrix Items fully baked, or are there still some missing pieces?  

I have an example where I synced some t-shirts to my shopify store and it pulled the Vendor Name ‘Xiangtan Apparel’: 

 

This name also shows up on my default Shopify Store Theme, when viewing online: 

 

I wanted to remove that from my online store viz, so I unmapped from both stock item and Template Item using this logic:

 

It does not seem to work.  Name still shows under Vendor (i.e. same as the first picture)

 


@kkeating24 , if you put «Unmap» in the mapping, connector will not export any value to the Vendor field, so the existing value will keep in Shopify side. 

You can manual remove it in Shopify side. 


Can anyone provide an update on if this functionality works in 24 R1? The code snippets do NOT work in 24 R1. Please advise.


@hayleehicks - one thing i have noticed, is that if the value is already populated in Shopify/BC that adding the logic to UNMAP something doesn’t update the Store on the next sync...  You have to remove the value in the store and then going forward the logic will prevent it from being updated via the sync.

Are you seeing a different result?


Reply