Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add example google feed
Krzysztof Wolskidfad31cbe3dc
diff --git a/saleor/integrations/feeds.py b/saleor/integrations/feeds.pyindex 4343453638..60040afe03 100644--- a/saleor/integrations/feeds.py+++ b/saleor/integrations/feeds.py@@ -6,6 +6,7 @@ from django.contrib.sites.models import Sitefrom django.contrib.syndication.views import Feed, add_domainfrom django.utils.encoding import smart_textfrom django.utils.feedgenerator import Atom1Feed+from prices import Pricefrom ..product.models import ProductVariant, Category@@ -246,3 +247,22 @@ class GoogleProductFeed(StaticFeed):product_data['brand'] = brandreturn product_data+++class SaleorFeed(GoogleProductFeed):+ """+ Example of using GoogleProductFeed.+ """++ def item_shipping(self, item):+ """Flat shipping price"""+ price = Price(5, currency=settings.DEFAULT_CURRENCY)+ return '%s %s' % (price.gross, price.currency)++ def item_tax(self, item):+ """No taxes on products"""+ price = Price(0, currency=settings.DEFAULT_CURRENCY)+ return '%s %s' % (price.gross, price.currency)++ def item_brand(self, item):+ return 'Saleor'