Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Sitemap internalization

Pacu275840e85345e
diff --git a/saleor/core/sitemaps.py b/saleor/core/sitemaps.py
index d968c4120f..e7923f9cc2 100644
--- a/saleor/core/sitemaps.py
+++ b/saleor/core/sitemaps.py
@@ -1,30 +1,36 @@
+from django.conf import settings
from django.contrib.sitemaps import Sitemap
from ..page.models import Page
from ..product.models import Category, Collection, Product
-class ProductSitemap(Sitemap):
+class i18nSitemap(Sitemap):
+ protocol = 'https' if settings.ENABLE_SSL else 'http'
+ i18n = True
+
+
+class ProductSitemap(i18nSitemap):
def items(self):
return Product.objects.only('id', 'name').order_by('-id')
-class CategorySitemap(Sitemap):
+class CategorySitemap(i18nSitemap):
def items(self):
categories = Category.objects.all().order_by('id')
return categories.only('id', 'name', 'slug')
-class CollectionSitemap(Sitemap):
+class CollectionSitemap(i18nSitemap):
def items(self):
collections = Collection.objects.all().order_by('id')
return collections.only('id', 'name', 'slug')
-class PageSitemap(Sitemap):
+class PageSitemap(i18nSitemap):
def items(self):
posts = Page.objects.public()