From 452893c1dbfa6f2dec41793bcfa09fdabf871463 Mon Sep 17 00:00:00 2001 From: Sisheng Zhang <88727960+sizhang12@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:28:59 -0400 Subject: [PATCH] [COM-28756] update product-scarcity when attributes exists (#46) --- .../plugins/platform/product-scarcity.html | 12 +++------- .../platform/f-scarcity-default-hidden.html | 14 +++++------- ...f-scarcity-default-shown-and-variants.html | 22 ++++++++----------- .../f-scarcity-default-shown-escape-html.html | 6 ++--- .../platform/f-scarcity-default-shown.html | 6 ++--- 5 files changed, 24 insertions(+), 36 deletions(-) diff --git a/core/src/main/resources/com/squarespace/template/plugins/platform/product-scarcity.html b/core/src/main/resources/com/squarespace/template/plugins/platform/product-scarcity.html index 0da08a58..a6354cfe 100644 --- a/core/src/main/resources/com/squarespace/template/plugins/platform/product-scarcity.html +++ b/core/src/main/resources/com/squarespace/template/plugins/platform/product-scarcity.html @@ -1,11 +1,5 @@ {.repeated section scarcityTemplateViews} - {.equal? @index 1} -
- {scarcityText|message qtyInStock:qtyInStock|htmltag} -
- {.or} -
- {scarcityText|message qtyInStock:qtyInStock|htmltag} -
- {.end} +
+ {scarcityText|message qtyInStock:qtyInStock|htmltag} +
{.end} diff --git a/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-hidden.html b/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-hidden.html index 265ff6db..bcf53676 100644 --- a/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-hidden.html +++ b/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-hidden.html @@ -27,13 +27,11 @@ {item|product-scarcity} :OUTPUT - - + - - + diff --git a/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown-and-variants.html b/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown-and-variants.html index 1e82d319..1975ec78 100644 --- a/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown-and-variants.html +++ b/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown-and-variants.html @@ -29,18 +29,14 @@ {item|product-scarcity} :OUTPUT -
- Only 3 left! -
- +
+ Only 3 left! +
- - - + - - + diff --git a/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown-escape-html.html b/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown-escape-html.html index 50eacd48..58f88ae9 100644 --- a/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown-escape-html.html +++ b/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown-escape-html.html @@ -22,6 +22,6 @@ {item|product-scarcity} :OUTPUT -
- Only 3 left! <img src=x> -
\ No newline at end of file + \ No newline at end of file diff --git a/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown.html b/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown.html index cb431cf3..9cf9d997 100644 --- a/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown.html +++ b/core/src/test/resources/com/squarespace/template/plugins/platform/f-scarcity-default-shown.html @@ -22,6 +22,6 @@ {item|product-scarcity} :OUTPUT -
- Only 3 left! -
\ No newline at end of file + \ No newline at end of file