From 99094b96e43a7f6179937e25f1c78782c5d227d6 Mon Sep 17 00:00:00 2001 From: Luke Holder Date: Thu, 10 Nov 2022 13:43:25 +0800 Subject: [PATCH 1/2] Buy button JS example template --- example-templates/buy-button.twig | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 example-templates/buy-button.twig diff --git a/example-templates/buy-button.twig b/example-templates/buy-button.twig new file mode 100644 index 0000000..39a0c82 --- /dev/null +++ b/example-templates/buy-button.twig @@ -0,0 +1,56 @@ + + + + + + + Example Shopify Store + + + + + + +

Shopify BuyButton.js Example

+ +
+ {% for product in craft.shopifyProducts.status('live').all() %} +
+ + {% endfor %} +
+ + \ No newline at end of file From 3373847dd65ee031e36f6374786c579933122613 Mon Sep 17 00:00:00 2001 From: Luke Holder Date: Thu, 10 Nov 2022 13:56:05 +0800 Subject: [PATCH 2/2] Improvements --- .../index.twig} | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) rename example-templates/{buy-button.twig => buy-button/index.twig} (52%) diff --git a/example-templates/buy-button.twig b/example-templates/buy-button/index.twig similarity index 52% rename from example-templates/buy-button.twig rename to example-templates/buy-button/index.twig index 39a0c82..28e4269 100644 --- a/example-templates/buy-button.twig +++ b/example-templates/buy-button/index.twig @@ -10,7 +10,7 @@ @@ -22,30 +22,15 @@
{% for product in craft.shopifyProducts.status('live').all() %} -
+ {% set productId = "product-#{product.shopifyId}" %} +