I have an upload tool, which, when used to update a product, its overriding my previously mapped customer levels. here is the update code: What do I need to change/add?
Code:
sbProductXML.Append("<AspDotNetStorefrontImport Verbose='true'><Transaction><Product Action='Update' ID='" + strProductID + "'>");
sbProductXML.Append("<Name><![CDATA[");
sbProductXML.Append(oRow["ProductName"].ToString());
sbProductXML.Append("]]></Name>");
sbProductXML.Append("<ProductType>");
sbProductXML.Append(oRow["ProductType"].ToString());
sbProductXML.Append("</ProductType>");
sbProductXML.Append("<Display><XmlPackage>product.variantsinrightbar.xml.config</XmlPackage><ColWidth>4</ColWidth><PageSize>20</PageSize></Display>");
sbProductXML.Append("<Images><ImageFilenameOverride>");
sbProductXML.Append(oRow["ImageName"].ToString());
sbProductXML.Append("</ImageFilenameOverride></Images>");
sbProductXML.Append("<Summary><![CDATA[");
sbProductXML.Append(oRow["Summary"].ToString());
sbProductXML.Append("]]></Summary>");
sbProductXML.Append("<Description><![CDATA[");
sbProductXML.Append(oRow["Description"].ToString());
sbProductXML.Append("]]></Description>");
sbProductXML.Append("<MiscText>");
sbProductXML.Append(oRow["SellingUnit"].ToString());
sbProductXML.Append("</MiscText>");
sbProductXML.Append("<SKU>");
sbProductXML.Append(oRow["SKU"].ToString());
sbProductXML.Append("</SKU>");
sbProductXML.Append("<Mappings AutoCleanup='True'>");
string strCategoryID = oRow["CategoryID"].ToString();
long lngCategoryID = long.Parse(strCategoryID);
if (lngCategoryID <= -1)
{
sbProductXML.Append("<Entity EntityType='Category' XPath='");
sbProductXML.Append(oRow["Category"].ToString());
sbProductXML.Append("'/>");
}
else
{
sbProductXML.Append("<Entity EntityType='Category' ID='");
sbProductXML.Append(oRow["CategoryID"].ToString());
sbProductXML.Append("'/>");
}
sbProductXML.Append("<Entity EntityType='Manufacturer' Name='");
sbProductXML.Append(oRow["Manufacturer"].ToString().Replace("&", "&"));
sbProductXML.Append("'/>");
sbProductXML.Append("</Mappings>");
sbProductXML.Append("<Variants>");
sbProductXML.Append("<Variant Action='Update' ID='" + strVariantID + "'>");
sbProductXML.Append("<Name><![CDATA[");
sbProductXML.Append(oRow["ProductName"].ToString());
sbProductXML.Append("]]></Name>");
sbProductXML.Append("<Description><![CDATA[");
sbProductXML.Append(oRow["Description"].ToString());
sbProductXML.Append("]]></Description>");
sbProductXML.Append("<Price>");
sbProductXML.Append(oRow["NetPrice"].ToString());
sbProductXML.Append("</Price>");
sbProductXML.Append("<IsTaxable>True</IsTaxable>");
sbProductXML.Append("<FreeShipping>");
sbProductXML.Append(oRow["FreeShipping"].ToString());
sbProductXML.Append("</FreeShipping>");
sbProductXML.Append("<MSRP>");
sbProductXML.Append(oRow["ListPrice"].ToString());
sbProductXML.Append("</MSRP>");
sbProductXML.Append("<Weight>");
sbProductXML.Append(oRow["Weight"].ToString());
sbProductXML.Append("</Weight>");
if (oRow["Dimensions"] != null)
{
string strDimensions = oRow["Dimensions"].ToString();
string[] aDimesions = new string[3] { "0", "0", "0" };
strDimensions = strDimensions.ToLower();
Char[] aChar = new char[] { 'x' };
aDimesions = strDimensions.Split(aChar, StringSplitOptions.RemoveEmptyEntries);
sbProductXML.Append("<Dimensions>");
sbProductXML.Append("<Height>");
sbProductXML.Append(aDimesions[0]);
sbProductXML.Append("</Height>");
sbProductXML.Append("<Width>");
sbProductXML.Append(aDimesions[1]);
sbProductXML.Append("</Width>");
sbProductXML.Append("<Length>");
sbProductXML.Append(aDimesions[2]);
sbProductXML.Append("</Length>");
sbProductXML.Append(oRow["Dimensions"].ToString());
//aDimesions[0]=
}
sbProductXML.Append("</Dimensions>");
sbProductXML.Append("<Inventory>");
// sbProductXML.Append(oRow["Inventory"].ToString());
sbProductXML.Append("1000000");
sbProductXML.Append("</Inventory>");
sbProductXML.Append("<Published>");
sbProductXML.Append("True");
sbProductXML.Append("</Published>");
sbProductXML.Append("<ExtensionData2>");
sbProductXML.Append(oRow["Discount"].ToString());
sbProductXML.Append("</ExtensionData2>");
sbProductXML.Append("<ExtensionData3>");
sbProductXML.Append(oRow["Markup"].ToString());
sbProductXML.Append("</ExtensionData3>");
sbProductXML.Append("<ExtensionData4>");
sbProductXML.Append(oRow["InitialNetPrice"].ToString());
sbProductXML.Append("</ExtensionData4>");
sbProductXML.Append("</Variant></Variants>");
sbProductXML.Append("</Product></Transaction></AspDotNetStorefrontImport>");
return sbProductXML.ToString();
}