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 %}