Dynamicweb.eCommerce.Products Namespace > Product Class : RemoveVariantGroup Method |
'Declaration
Public Sub RemoveVariantGroup( _ ByVal variantGroup As VariantGroup _ )
public void RemoveVariantGroup( VariantGroup variantGroup )
class MyPage : System.Web.UI.Page { private void DelVariantGrpProdRelated() { Product prod = new Product(); prod = (Product)Session["Ecom.Backend.Product"]; string varGrpID = HttpContext.Current.Request.QueryString["grpArr"]; Dynamicweb.eCommerce.Variants.VariantGroup variantGrp = Dynamicweb.eCommerce.Variants.VariantGroup.Create(varGrpID); prod.RemoveVariantGroup(variantGrp); Dynamicweb.eCommerce.Variants.VariantGroupProductRelation vgpr = new Dynamicweb.eCommerce.Variants.VariantGroupProductRelation(); vgpr.Delete(prod.ID, varGrpID); Dynamicweb.eCommerce.Variants.VariantCombination vopr = new Dynamicweb.eCommerce.Variants.VariantCombination(); vopr.Delete(prod.ID); prod.VariantGroups = null; prod.VariantCombinations = null; } }
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