Dynamicweb.eCommerce.Products Namespace > Product Class : UpdateVariantCount Method |
'Declaration
Public Shared Function UpdateVariantCount( _ ByVal product As Product, _ ByVal variantCount As Integer _ ) As Integer
class MyPage : System.Web.UI.Page { public void VariantOptions(Product prod) { string overwriteDefaultVarCombo = string.Empty; if (Request["saveVariant"] == "1") { Dynamicweb.eCommerce.Variants.VariantCombinationCollection vars = Dynamicweb.eCommerce.Variants.VariantCombination.getProductCombinations(prod); Product.UpdateVariantCount(prod, vars.Count); } if (Request["saveDefaultVariant"] == "1") { if (!string.IsNullOrEmpty(Base.ChkString(Base.Request("DefaultVariantComboID")))) { overwriteDefaultVarCombo = Base.ChkString(Base.Request("DefaultVariantComboID")); } Product.UpdateDefaultVariantID(prod, overwriteDefaultVarCombo); } } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2