Beispiel #1
0
        public IEnumerable <ProductVariantDisplay> FilterOptionsBySelectedChoices(Guid productKey, string optionChoices)
        {
            var merchello = new MerchelloHelper();

            var optionsArray      = string.IsNullOrEmpty(optionChoices) ? new string[] { } : optionChoices.Split(',');
            var guidOptionChoices = new List <Guid>();

            foreach (var option in optionsArray)
            {
                if (!String.IsNullOrEmpty(option))
                {
                    guidOptionChoices.Add(new Guid(option));
                }
            }

            var variants = merchello.GetValidProductVariants(productKey, guidOptionChoices.ToArray());

            return(variants);
        }