Пример #1
0
        public bool ProductsRemoveOption(Product p, string optionBvin)
        {
            Option opt = ProductOptions.Find(optionBvin);

            if (opt == null)
            {
                return(false);
            }

            bool result = ProductsXOptions.RemoveOptionFromProduct(p.Bvin, optionBvin);

            ProductsReloadOptions(p);

            // delete an option if it's not shared
            if (result)
            {
                if (!opt.IsShared)
                {
                    result = ProductOptions.Delete(opt.Bvin);
                }
            }

            if (opt.IsVariant)
            {
                VariantsValidate(p);
            }

            return(result);
        }