Exemplo n.º 1
0
        // If there's a value for the canonical data element in config, and if the product is canonical, then send that value in
        // custom label 4
        public static string GetCustomLabel4Value(IGooglePlaFeedRuleHelper runnerFeed, IProductData productData, StringDictionary dict, IDataRecord reader)
        {
            string customLabelValue = null;

            if (!string.IsNullOrWhiteSpace(CanonicalProductDataValue) && dict.ContainsKey("isCanonical"))
            {
                bool databaseValue = false;
                bool.TryParse(reader[dict["isCanonical"]].ToString(), out databaseValue);
                if (databaseValue)
                {
                    customLabelValue = CanonicalProductDataValue;
                }
            }

            if (string.IsNullOrWhiteSpace(customLabelValue))
            {
                var ruleValue = runnerFeed.GetCustomLabelValue(productData, FeedRuleType.Custom_Label_4);
                customLabelValue = ruleValue != null ? ruleValue.Value : null;
            }

            return(customLabelValue);
        }
Exemplo n.º 2
0
        public static string GetCustomLabelValue(IGooglePlaFeedRuleHelper runnerFeed, IProductData productData, FeedRuleType feedRuleType)
        {
            var customLabelValue = runnerFeed.GetCustomLabelValue(productData, feedRuleType);

            return(customLabelValue != null ? customLabelValue.Value : null);
        }