예제 #1
0
        public void GetProducts()
        {
            var retCmd = GetProductsCommand();
            var xList  = new List <SiteMapProduct>();

            if (Settings.ProductFiltering)
            {
                retCmd.Parameters["@StoreID"].Value = AppLogic.StoreID();
            }

            Action <System.Data.IDataReader> readEntities = rd =>
            {
                while (rd.Read())
                {
                    var prd = new SiteMapProduct(Url, SiteMapEntityHelper);
                    prd.EntityID = rd.FieldInt("ProductID");
                    prd.Name     = XmlCommon.GetLocaleEntry(rd.Field("Name"), Customer.Current.LocaleSetting, false);
                    prd.SEName   = rd.Field("SEName");
                    xList.Add(prd);
                }
            };

            DB.UseDataReader(retCmd, readEntities);
            Products = xList.ToArray();
        }
예제 #2
0
        string ProductXML(SiteMapProduct product)
        {
            var link = UrlHelper
                       .BuildProductLink(product.EntityID, product.SEName)
                       .TrimStart('/');

            return(string.Format(
                       "<url><loc>{0}{1}</loc><changefreq>{2}</changefreq><priority>{3}</priority></url>\n",
                       AppLogic.GetStoreHTTPLocation(false, false),
                       link,
                       AppLogic.AppConfig("SiteMapFeed.ObjectChangeFreq"),
                       AppLogic.AppConfig("SiteMapFeed.ObjectPriority")));
        }
        string ProductXML(SiteMapProduct product, SiteMapSettings settings)
        {
            var link = UrlHelper
                       .BuildProductLink(product.EntityID, product.SEName);

            return(string.Format(
                       "<url><loc>{0}{1}</loc><changefreq>{2}</changefreq><priority>{3}</priority></url>\n",
                       AppLogic.GetStoreHTTPLocation(
                           useSsl: true,
                           noVirtualNoSlash: true),
                       link,
                       settings.ObjectChangeFrequency,
                       settings.ObjectPriority));
        }