Hi Jim,
In that case, you can add a new property to the Shopping cart web part (
~\CMSWebParts\Ecommerce\ShoppingCart\ShoppingCartWebPart.ascx.cs), as demonstrated here:
public string CustomProperty
{
get
{
return ValidationHelper.GetString(this.GetValue("CustomProperty"), this.cartElem.CustomProperty);
}
set
{
this.SetValue("CustomProperty", value);
this.cartElem.CustomProperty = value;
}
}
also, the following code needs to be added to the
SetupControl method:
this.cartElem.CustomProperty = this.CustomProperty;
where the
cartElem is ID of the Shopping cart control being used in this web part.
Of couse, in order to be able to define this property directly in the
CMS Desk in the web part properties, you need add this property in the Site manager -> Development -> Web parts -> edit the Shopping cart web part -> Properies -> add a new property called CustomProperty.
Then, you need to create this property also in the Shopping cart control (
~\CMSModules\Ecommerce\Controls\ShoppingCart\ShoppingCart.ascx.cs):
public string CustomProperty
{
get
{
return ValidationHelper.GetString(this.ShoppingCartInfoObj.ShoppingCartCustomData["CustomProperty"], String.Empty);
}
set
{
this.ShoppingCartInfoObj.ShoppingCartCustomData["CustomProperty"] = value;
}
}
Please notice that the value is stored in the ShoppingCartCustomData property so that you can access in each of the shopping cart step controls ( ShoppingCartContent, ShoppingCartCustomerSelection etc.) if necessary:
string customProperty = ValidationHelper.GetString(this.ShoppingCartInfoObj.ShoppingCartCustomData["CustomProperty"], String.Empty);
I hope this will help you.
Best regards,
Michal Legen