From 8d33a0ab705d0e138143d62eaa973b7842d74423 Mon Sep 17 00:00:00 2001 From: Luke Holder Date: Wed, 13 Sep 2023 23:29:25 +0800 Subject: [PATCH] update example templates when no card exists --- example-templates/dist/shop/plans/index.twig | 9 +++++++++ example-templates/src/shop/plans/index.twig | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/example-templates/dist/shop/plans/index.twig b/example-templates/dist/shop/plans/index.twig index 4fd3a61e0d..d1efea5a56 100644 --- a/example-templates/dist/shop/plans/index.twig +++ b/example-templates/dist/shop/plans/index.twig @@ -93,6 +93,8 @@
{% for plan in plans %} + {% set paymentSources = craft.commerce.paymentSources.getAllPaymentSourcesByCustomerId(currentUser.id, plan.gateway.id) %} +
@@ -104,6 +106,7 @@

{{- plan.name -}}

+ {% if paymentSources|length %}
{% tag 'select' with { name: 'trialDays', @@ -131,6 +134,12 @@ text: 'Subscribe'|t }) }}
+ {% else %} +

+ {{- 'You do not have any payment sources set up for {gateway}.'|t({ gateway: plan.gateway.name }) -}} +

+ Add Card + {% endif %}
diff --git a/example-templates/src/shop/plans/index.twig b/example-templates/src/shop/plans/index.twig index 779b4cc169..8abcfb4492 100755 --- a/example-templates/src/shop/plans/index.twig +++ b/example-templates/src/shop/plans/index.twig @@ -93,6 +93,8 @@
{% for plan in plans %} + {% set paymentSources = craft.commerce.paymentSources.getAllPaymentSourcesByCustomerId(currentUser.id, plan.gateway.id) %} +
@@ -104,6 +106,7 @@

{{- plan.name -}}

+ {% if paymentSources|length %}
{% tag 'select' with { name: 'trialDays', @@ -131,6 +134,12 @@ text: 'Subscribe'|t }) }}
+ {% else %} +

+ {{- 'You do not have any payment sources set up for {gateway}.'|t({ gateway: plan.gateway.name }) -}} +

+ Add Card + {% endif %}