Hi Jon,
First of, i need to know if you understand the concept of using a custom provider as descriped in the
documentation?
If not, then just follow the steps outlined here. When you get to the point where it says
4. Delete the CMS.CustomECommerceProvider.dll file from the /bin directory of the CMS project.
dont be frustrated if you dont have that DLL in your solution by this time.
Once you done this (and it sounds a lot more hairy than it is!) you should alter the code in the file in the new project that you created. The file is named "CustomShoppingCartInfoProvider.cs"
In line 23 you find the method called:
public void EvaluateShoppingCartContent(object shoppingCart)
This method should be recreated to look something like this:
public void EvaluateShoppingCartContent(object shoppingCart)
{
ShoppingCartInfoProvider.EvaluateShoppingCartContent((CMS.Ecommerce.ShoppingCartInfo)shoppingCart);
CMS.Ecommerce.ShoppingCartInfo si = (CMS.Ecommerce.ShoppingCartInfo)shoppingCart;
si.ShoppingCartContentTable.Columns.Add("skuNumber", typeof(string));
foreach (DataRow skuRow in si.ShoppingCartContentTable.Rows)
{
CMS.Ecommerce.SKUInfo sInfo = SKUInfoProvider.GetSKUInfo((int)skuRow["skuID"]);
skuRow["skuNumber"] = sInfo.SKUNumber.ToString();
}
}
If you want the same to go for the shoppingCartPreview.ascx file (also on this usercontrol there is a grid showing the content of the cart) then you need to add the same logik to the overloaded method with the same name just below the first one. That is:
public void EvaluateShoppingCartContent(object shoppingCart, bool evaluateForInvoice)
{
ShoppingCartInfoProvider.EvaluateShoppingCartContent((CMS.Ecommerce.ShoppingCartInfo)shoppingCart, evaluateForInvoice);
CMS.Ecommerce.ShoppingCartInfo si = (CMS.Ecommerce.ShoppingCartInfo)shoppingCart;
si.ShoppingCartContentTable.Columns.Add("skuNumber", typeof(string));
foreach (DataRow skuRow in si.ShoppingCartContentTable.Rows)
{
CMS.Ecommerce.SKUInfo sInfo = SKUInfoProvider.GetSKUInfo((int)skuRow["skuID"]);
skuRow["skuNumber"] = sInfo.SKUNumber.ToString();
}
}
If you want to add more fields from the SKU table, or customfields for the SKU table make sure to specify them in the dataTable definition first:
si.ShoppingCartContentTable.Columns.Add("myOwnSpecialSKUfield", typeof(string));
And then add them in the foreach loop where you will add values to them like:
skuRow["myOwnSpecialSKUfield"] = sInfo.getValue("myOwnSpecialSKUfield").ToString();
for the confirmation email i would recommend that you create a custom macro for that.
Hope this helps out a little...