diefenbach / django-lfs

An online-shop based on Django
http://www.getlfs.com
BSD 3-Clause "New" or "Revised" License
622 stars 222 forks source link

sitemap.py and multi variant products #49

Closed pierreNomazy closed 7 years ago

pierreNomazy commented 11 years ago

Sitemap which include multi_variant product lead to weakness SEO for the main product. In the best case (but not all cases) google robot will not index your multi variant products. can be check in tools for webmasters. So I advice to change in sitemaps.py, line 19 : return Product.objects.filter(sub_type__in=[0,1], active='TRUE') OR for having priority different for sub_type=0 and 1 : class ProductSitemap0(Sitemap): with filter(sub_type=0, active='TRUE') class ProductSitemap1(Sitemap): with filter(sub_type=1, active='TRUE') and in urls.py : import both classes and : url(r'^sitemap.xml$', 'sitemap', {'sitemaps': {"products0": ProductSitemap0,"products1": ProductSitemap1, "categories": CategorySitemap, "pages": PageSitemap, "shop": ShopSitemap}})

Pierre

diefenbach commented 7 years ago

Fixed.