Dynamicweb 8 Documentation
RemoveVariantGroupLoop Method
Example 

The VariantGroup object.
Removes the variant group by ID, LanguageID, Label and Name.
Syntax
'Declaration
 
Public Sub RemoveVariantGroupLoop( _ 
   ByVal variantGroup As VariantGroup _ 
) 
public void RemoveVariantGroupLoop( 
   VariantGroup variantGroup 
)

Parameters

variantGroup
The VariantGroup object.
Example
class MyPage : System.Web.UI.Page
{
   private void DeleteVariantGroupProductRelated()
   {
       Product product = (Product)Session["Ecom.Backend.Product"];

       string variantGroupID = HttpContext.Current.Request.QueryString["grpArr"];

       Dynamicweb.eCommerce.Variants.VariantGroup variantGroup = Dynamicweb.eCommerce.Variants.VariantGroup.Create(variantGroupID);
       product.RemoveVariantGroupLoop(variantGroup);

       Dynamicweb.eCommerce.Variants.VariantGroupProductRelation variantGroupProductRelation = new Dynamicweb.eCommerce.Variants.VariantGroupProductRelation();
       variantGroupProductRelation.Delete(product.ID, variantGroupID);
 
       Dynamicweb.eCommerce.Variants.VariantCombination variantCombination = new Dynamicweb.eCommerce.Variants.VariantCombination();
       variantCombination.Delete(product.ID);

       product.VariantGroups = null;
       product.VariantCombinations = null;
   }
}
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