Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add sale label to discounted products
weronkad14d7887ffe8
diff --git a/saleor/static/scss/demo/components/_home.scss b/saleor/static/scss/demo/components/_home.scssindex 86b7a69c34..10fdf13e8c 100644--- a/saleor/static/scss/demo/components/_home.scss+++ b/saleor/static/scss/demo/components/_home.scss@@ -42,7 +42,7 @@text-transform: uppercase;font-weight: 700;color: $body-color;- margin-top: $global-margin * 4;+ margin: $global-margin * 4 0 $global-margin * 2;}}}\ No newline at end of filediff --git a/saleor/static/scss/demo/components/_product-list.scss b/saleor/static/scss/demo/components/_product-list.scssindex f86f676ce0..1003d727e2 100644--- a/saleor/static/scss/demo/components/_product-list.scss+++ b/saleor/static/scss/demo/components/_product-list.scss@@ -1,5 +1,6 @@.product-list {text-align: center;+ margin-bottom: $global-margin * 2;img {max-width: 100%;}@@ -14,4 +15,22 @@margin-top: $global-margin / 2;display: block;}+ &__sale {+ clip-path: polygon(0 37%, 37% 0, 100% 0, 0% 100%);+ background-color: $red;+ position: absolute;+ top: 0;+ left: 15px;+ width: 55px;+ height: 55px;+ span {+ position: absolute;+ top: 7px;+ left: 3px;+ color: $white;+ text-transform: uppercase;+ transform: rotate(-45deg);+ font-weight: 700;+ }+ }}\ No newline at end of filediff --git a/templates/demo/category/_items.html b/templates/demo/category/_items.htmlindex aca7abdb1f..d0853cfb88 100644--- a/templates/demo/category/_items.html+++ b/templates/demo/category/_items.html@@ -23,7 +23,7 @@{% with discount=undiscounted.min_price|price_difference:price_range.min_price %}{% price_range price_range %}{% if undiscounted.min_price != price_range.min_price %}- <span class="label label-success">{% trans "Discount!" %}</span>+ <div class="product-list__sale"><span>{% trans "Sale" %}</span></div>{% endif %}{% endwith %}{% endwith %}