Dynamicweb 8 Documentation
UpdateDefaultVariantID Method
Example 

The product.
The variant combo ID.
Updates the default variant ID.
Syntax
'Declaration
 
Public Shared Function UpdateDefaultVariantID( _ 
   ByVal prod As Product, _ 
   ByVal variantComboID As String _ 
) As Integer
public static int UpdateDefaultVariantID( 
   Product prod,
   string variantComboID 
)

Parameters

prod
The product.
variantComboID
The variant combo ID.
Example
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.UpdateVariantCnt(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);
       }
   }
}
Requirements

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

See Also

Reference

Product Class
Product Members

Send Feedback