Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add featured products to the home page
weronkac074eff171a4
diff --git a/saleor/static/scss/demo/components/_home.scss b/saleor/static/scss/demo/components/_home.scssindex 22aedb340f..86b7a69c34 100644--- a/saleor/static/scss/demo/components/_home.scss+++ b/saleor/static/scss/demo/components/_home.scss@@ -37,4 +37,12 @@padding: $global-padding * 10 0 $global-padding * 8;}}+ &__featured {+ h3 {+ text-transform: uppercase;+ font-weight: 700;+ color: $body-color;+ margin-top: $global-margin * 4;+ }+ }}\ No newline at end of filediff --git a/saleor/static/scss/demo/components/_product-list.scss b/saleor/static/scss/demo/components/_product-list.scssnew file mode 100644index 0000000000..08a3a487c3--- /dev/null+++ b/saleor/static/scss/demo/components/_product-list.scss@@ -0,0 +1,15 @@+.product-list {+ text-align: center;+ img {+ max-width: 100%;+ }+ a {+ color: $body-color;+ &:hover {+ text-decoration: none;+ }+ }+ &__name {+ font-weight: 700;+ }+}\ No newline at end of filediff --git a/saleor/static/scss/demo/storefront.scss b/saleor/static/scss/demo/storefront.scssindex 887bce376e..39a0a01710 100644--- a/saleor/static/scss/demo/storefront.scss+++ b/saleor/static/scss/demo/storefront.scss@@ -10,4 +10,5 @@@import "components/product-page";@import "components/cart";@import "components/userprofile";-@import "components/login";\ No newline at end of file+@import "components/login";+@import "components/product-list";\ No newline at end of filediff --git a/templates/demo/category/_items.html b/templates/demo/category/_items.htmlindex 8b2519fdfe..aca7abdb1f 100644--- a/templates/demo/category/_items.html+++ b/templates/demo/category/_items.html@@ -4,20 +4,20 @@{% load discounted_price_range price_difference from discount %}{% for product in products %}- <div class="col-xs-12 col-sm-6 col-md-4 col-lg-3" itemscope itemtype="https://schema.org/Product">- <div class="panel panel-default text-center">- <div class="panel-body">+ <div class="col-xs-6 col-md-4 product-list" itemscope itemtype="https://schema.org/Product" >+ <div class="text-center">+ <div><a itemprop="url" href="{{ product.get_absolute_url }}">{% if product.images.first %}<img itemprop="image" class="img-responsive" src="{{ product.images.first.image.crop.400x400 }}" alt="">{% else %}<img src="{% static 'images/product-image-placeholder.png' %}" alt="" class="img-responsive">{% endif %}- <span class="product-list-item-name" itemprop="name" title="{{ product }}">{{ product }}</span>+ <span class="product-list__name" itemprop="name" title="{{ product }}">{{ product }}<br>-</span></a></div>- <div class="panel-footer">+ <div>{% if product.is_in_stock %}{% with price_range=product|discounted_price_range:request.discounts undiscounted=product.get_price_range %}{% with discount=undiscounted.min_price|price_difference:price_range.min_price %}diff --git a/templates/demo/home.html b/templates/demo/home.htmlindex d44ecb8c8a..aeefbf9a03 100644--- a/templates/demo/home.html+++ b/templates/demo/home.html@@ -33,6 +33,14 @@</div></div></div>+ <div class="row home__featured">+ <h3 class="text-xs-center">{% trans "Featured products" %}</h3>+ <div class="col-sm-12">+ <div class="row">+ {% include "category/_items.html" %}+ </div>+ </div>+ </div></div>{% endblock %}\ No newline at end of file