示例#1
0
        public IActionResult Create(EventAttributeModel model)
        {
            ProductAttribute attribute = new ProductAttribute
            {
                name = model.Name
            };

            var wooAttribute = _woocomerceService.CreateProductAttribute(attribute);

            if (wooAttribute != null)
            {
                List <ProductAttributeTerm> options = new List <ProductAttributeTerm>();
                foreach (var option in model.EventAttributeOptions)
                {
                    options.Add(new ProductAttributeTerm
                    {
                        name = option
                    });
                }

                _woocomerceService.CreateProductAttributeTerms(options, wooAttribute.id.Value);
            }

            return(View());
        }
示例#2
0
        public IActionResult Create()
        {
            EventAttributeModel model = new EventAttributeModel();

            return(View(model));
        }