Solved

BigCommerce Integration: How to unmap variant price/weight from syncing?

  • 17 August 2022
  • 3 replies
  • 121 views

Userlevel 4
Badge

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.

 

icon

Best answer by smarenich 18 August 2022, 01:25

View original

3 replies

Userlevel 6
Badge +3

@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, new[] { 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);
}
}

 

Userlevel 4
Badge

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!

Userlevel 6
Badge +3

@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.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2022  Acumatica, Inc. All rights reserved