Example #1
0
        public static bool GetOptionBooleanValue(this Product product, string optionName)
        {
            var option = product.GetOption(optionName);

            if (option == null)
            {
                return(false);
            }
            var optValue = option.Values.FirstOrDefault();

            return(optValue != null && Convert.ToString(optValue.Value) != "" && Convert.ToBoolean(optValue.Value));
        }
Example #2
0
        public static string GetOptionStringValue(this Product product, string optionName)
        {
            var option = product.GetOption(optionName);

            if (option == null)
            {
                return(String.Empty);
            }
            var optValue = option.Values.FirstOrDefault();

            return(optValue != null?Convert.ToString(optValue.Value) : String.Empty);
        }