diff --git a/locales/de.json b/locales/de.json index a0c21a123..f2a89e3f9 100644 --- a/locales/de.json +++ b/locales/de.json @@ -262,6 +262,7 @@ }, "product": { "sold_out": "Ausverkauft", + "on_sale": "Im Angebot", "on_sale_from_html": "Im Angebot ab {{ price }}", "unavailable": "Nicht verfügbar", "compare_at": "Vergleichen bei", diff --git a/locales/en.default.json b/locales/en.default.json index 898f2617d..666ff9c19 100644 --- a/locales/en.default.json +++ b/locales/en.default.json @@ -262,6 +262,7 @@ }, "product": { "sold_out": "Sold Out", + "on_sale": "On Sale", "on_sale_from_html": "On Sale from {{ price }}", "unavailable": "Unavailable", "compare_at": "Compare at", diff --git a/locales/es.json b/locales/es.json index da7e82256..0a7cae6dc 100644 --- a/locales/es.json +++ b/locales/es.json @@ -262,6 +262,7 @@ }, "product": { "sold_out": "Agotado", + "on_sale": "En oferta", "on_sale_from_html": "En oferta desde {{ price }}", "unavailable": "No disponible", "compare_at": " Comparar en", diff --git a/locales/fr.json b/locales/fr.json index b312fcffd..633d12e85 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -262,6 +262,7 @@ }, "product": { "sold_out": "Épuisé", + "on_sale": "En solde", "on_sale_from_html": "En solde {{ price }}", "unavailable": "Non disponible", "compare_at": "Était", diff --git a/locales/pt-BR.json b/locales/pt-BR.json index 5b49edcb5..06e2c1f0d 100644 --- a/locales/pt-BR.json +++ b/locales/pt-BR.json @@ -262,6 +262,7 @@ }, "product": { "sold_out": "Esgotado", + "on_sale": "Em promoção", "on_sale_from_html": "Em promoção, a partir de {{ price }}", "unavailable": "Indisponível", "compare_at": "Preço normal:", diff --git a/locales/pt-PT.json b/locales/pt-PT.json index 630eb0f1a..3a1ffb0a0 100644 --- a/locales/pt-PT.json +++ b/locales/pt-PT.json @@ -262,6 +262,7 @@ }, "product": { "sold_out": "Esgotado", + "on_sale": "Em Promoção", "on_sale_from_html": "Em Promoção desde {{ price }}", "unavailable": "Indisponível", "compare_at": "Comparar em", diff --git a/snippets/product-grid-item.liquid b/snippets/product-grid-item.liquid index 1783b5599..f890a8946 100755 --- a/snippets/product-grid-item.liquid +++ b/snippets/product-grid-item.liquid @@ -33,7 +33,7 @@ Check if the product is sold out and set a variable to be used below. {% endcomment %} {% assign sold_out = true %} -{% if product.available %} +{% if product.available %} {% assign sold_out = false %} {% endif %} @@ -66,14 +66,23 @@ You can show a leading 'from' or 'up to' by checking 'product.price_varies' if your variants have different prices. {% endcomment %} - {% if product.price_varies %}{{ 'products.general.from' | t }}{% endif %} - {{ product.price | money }} + {% if on_sale %} + {% if product.price_varies %} + {% assign sale_price = product.price | money %} + {{ 'products.product.on_sale_from_html' | t: price: sale_price }} + {% else %} + {{ 'products.product.on_sale' | t }} + {{ product.price | money }} + {% endif %} + {% else %} + {% if product.price_varies %}{{ 'products.general.from' | t }}{% endif %} + {{ product.price | money }} + {% endif %} {% if sold_out %}
{{ 'products.product.sold_out' | t }} {% endif %} {% if on_sale %} - {% assign sale_price = product.compare_at_price | money %} -
{{ 'products.product.on_sale_from_html' | t: price: sale_price }} +
{{ product.compare_at_price | money }} {% endif %}

diff --git a/snippets/product-list-item.liquid b/snippets/product-list-item.liquid index ac3fc88ce..0e6492b0c 100755 --- a/snippets/product-list-item.liquid +++ b/snippets/product-list-item.liquid @@ -18,7 +18,7 @@ Check if the product is sold out and set a variable to be used below. {% endcomment %} {% assign sold_out = true %} -{% if product.available %} +{% if product.available %} {% assign sold_out = false %} {% endif %} @@ -45,30 +45,43 @@ {{ product.featured_image.alt | escape }} -
-

{{ product.title }}

-
- {% if product.excerpt.size > 0 %} - {{ product.excerpt }} - {% else %} -

{{ product.content | strip_html | truncatewords: 30 }}

- {% endif %} +
+
+
+

{{ product.title }}

+
+ {% if product.excerpt.size > 0 %} + {{ product.excerpt }} + {% else %} +

{{ product.content | strip_html | truncatewords: 30 }}

+ {% endif %} +
+
+
+ {% comment %} + You can show a leading 'from' or 'up to' by checking 'product.price_varies' + if your variants have different prices. + {% endcomment %} + {% if on_sale %} + {% if product.price_varies %} + {% assign sale_price = product.price | money %} + {{ 'products.product.on_sale_from_html' | t: price: sale_price }} + {% else %} + {{ 'products.product.on_sale' | t }} + {{ product.price | money }} + {% endif %} + {% else %} + {% if product.price_varies %}{{ 'products.general.from' | t }}{% endif %} + {{ product.price | money }} + {% endif %} + {% if sold_out %} +
{{ 'products.product.sold_out' | t }} + {% endif %} + {% if on_sale %} +
{{ product.compare_at_price | money }} + {% endif %} +
-
- {% comment %} - You can show a leading 'from' or 'up to' by checking 'product.price_varies' - if your variants have different prices. - {% endcomment %} - {% if product.price_varies %}{{ 'products.general.from' | t }}{% endif %} - {{ product.price | money }} - {% if sold_out %} -
{{ 'products.product.sold_out' | t }} - {% endif %} - {% if on_sale %} - {% assign sale_price = product.compare_at_price | money %} -
{{ 'products.product.on_sale_from_html' | t: price: sale_price }} - {% endif %} -
diff --git a/snippets/search-result-grid.liquid b/snippets/search-result-grid.liquid index ac57537fe..33b210a3c 100755 --- a/snippets/search-result-grid.liquid +++ b/snippets/search-result-grid.liquid @@ -18,6 +18,22 @@ {% assign grid_item_width = 'large--one-third medium--one-half' %} {% endunless %} +{% comment %} + Check if the product is on sale and set a variable to be used below. +{% endcomment %} +{% assign on_sale = false %} +{% if item.compare_at_price > item.price %} + {% assign on_sale = true %} +{% endif %} + +{% comment %} + Check if the product is sold out and set a variable to be used below. +{% endcomment %} +{% assign sold_out = true %} +{% if item.available %} + {% assign sold_out = false %} +{% endif %} +
{% if item.featured_image %} @@ -30,20 +46,31 @@
{{ item.title | link_to: item.url }}
-
- {% if item.compare_at_price > item.price %} - - {{ item.price | money }} - - - {{ 'products.product.compare_at' | t }} - {{ item.compare_at_price_max | money }} - - {% else %} - - {{ item.price | money }} - - {% endif %} -
+ {% if item.price %} +

+ {% comment %} + You can show a leading 'from' or 'up to' by checking 'product.price_varies' + if your variants have different prices. + {% endcomment %} + {% if on_sale %} + {% if item.price_varies %} + {% assign sale_price = item.price | money %} + {{ 'products.product.on_sale_from_html' | t: price: sale_price }} + {% else %} + {{ 'products.product.on_sale' | t }} + {{ item.price | money }} + {% endif %} + {% else %} + {% if item.price_varies %}{{ 'products.general.from' | t }}{% endif %} + {{ item.price | money }} + {% endif %} + {% if sold_out %} +
{{ 'products.product.sold_out' | t }} + {% endif %} + {% if on_sale %} +
{{ item.compare_at_price | money }} + {% endif %} +

+ {% endif %}
diff --git a/snippets/search-result.liquid b/snippets/search-result.liquid index 555e648af..0c1c9841f 100755 --- a/snippets/search-result.liquid +++ b/snippets/search-result.liquid @@ -14,6 +14,22 @@ {% endcomment %} +{% comment %} + Check if the product is on sale and set a variable to be used below. +{% endcomment %} +{% assign on_sale = false %} +{% if item.compare_at_price > item.price %} + {% assign on_sale = true %} +{% endif %} + +{% comment %} + Check if the product is sold out and set a variable to be used below. +{% endcomment %} +{% assign sold_out = true %} +{% if item.available %} + {% assign sold_out = false %} +{% endif %} +
{% if item.featured_image %} @@ -33,22 +49,31 @@

{{ item.title | link_to: item.url }}

- {% comment %} - To show the price, let's pull what was already done on the product page, - but change product to item. - {% endcomment %} - {% if item.compare_at_price > item.price %} - - {{ item.price | money }} - - - {{ 'products.product.compare_at' | t }} - {{ item.compare_at_price_max | money }} - - {% else %} - - {{ item.price | money }} - + {% if item.price %} +

+ {% comment %} + You can show a leading 'from' or 'up to' by checking 'product.price_varies' + if your variants have different prices. + {% endcomment %} + {% if on_sale %} + {% if item.price_varies %} + {% assign sale_price = item.price | money %} + {{ 'products.product.on_sale_from_html' | t: price: sale_price }} + {% else %} + {{ 'products.product.on_sale' | t }} + {{ item.price | money }} + {% endif %} + {% else %} + {% if item.price_varies %}{{ 'products.general.from' | t }}{% endif %} + {{ item.price | money }} + {% endif %} + {% if sold_out %} +
{{ 'products.product.sold_out' | t }} + {% endif %} + {% if on_sale %} +
{{ item.compare_at_price | money }} + {% endif %} +

{% endif %} {% comment %}