uawdijnntqw1x1x1
IP : 216.73.216.107
Hostname : toronto-dev2
Kernel : Linux toronto-dev2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
srv
/
users
/
craft4
/
apps
/
craft4-newsite-space
/
.
/
templates
/
.
/
shop
/
plans
/
subscription
/
index.twig
/
/
{% extends 'shop/_private/layouts' %} {# @var subscriptionId string #} {% set subscriptionId = craft.app.request.param('subscription') %} {# @var subscription \craft\commerce\elements\Subscription #} {% set subscription = craft.subscriptions() .id(subscriptionId) .one() %} {% if not subscription or currentUser is null or subscription.userId != currentUser.id %} {% redirect 'shop/plans' %} {% endif %} {% block main %} <!-- Template: {{ _self }}.twig --> <h1 class="text-3xl block sm:inline"> {{- 'Manage {plan}'|t({ plan: subscription.plan.name }) -}} </h1> {# @var information \craft\elements\Entry #} {% set information = subscription.plan.getInformation() ?? null %} <dl class="flex flex-wrap max-w-md mt-3"> <dt class="w-1/2 pr-2"> <strong> {{- 'Subscription Information'|t -}} </strong> </dt> <dd class="w-1/2"> </dd> {% if information %} <dt class="w-1/2 pr-2"> {{- 'Plan Information Entry'|t -}} </dt> <dd class="w-1/2"> <ul class="list-disc list-inside"> <li>{{ 'ID'|t }}: {{ information.id }}</li> <li>{{ 'Title'|t }}: {{ information.title }}</li> </ul> </dd> {% endif %} {% if subscription.isExpired %} <dt class="w-1/2 pr-2">{{ 'Expired on'|t }}</dt> <dd class="w-1/2">{{ subscription.dateExpired|date('Y-m-d') }}</dd> {% else %} {% if subscription.isCanceled %} <dt class="w-1/2 pr-2">{{ 'Cancelled on'|t }}</dt> <dd class="w-1/2">{{ subscription.dateCanceled|date('Y-m-d') }}</dd> <dt class="w-1/2 pr-2">{{ 'Expires on'|t }}</dt> <dd class="w-1/2">{{ subscription.nextPaymentDate|date('Y-m-d') }}</dd> {% if subscription.canReactivate() %} <dt class="w-1/2 pr-2"></dt> <dd class="w-1/2"> <form method="post" action=""> {{ csrfInput() }} {{ actionInput('commerce/subscriptions/reactivate') }} {{ hiddenInput('subscriptionUid', subscription.uid|hash) }} {{ redirectInput('shop/plans') }} {{ tag('button', { type: 'submit', class: 'cursor-pointer rounded px-4 py-2 inline-block bg-blue-500 hover:bg-blue-600 text-white hover:text-white', text: 'Reactivate'|t }) }} </form> </dd> {% endif %} {% else %} <dt class="w-1/2 pr-2">{{ 'Payment Amount'|t }}</dt> <dd class="w-1/2">{{ subscription.getNextPaymentAmount() }}</dd> <dt class="w-1/2 pr-2">{{ 'Next Payment'|t }}</dt> <dd class="w-1/2">{{ subscription.nextPaymentDate|date('Y-m-d') }}</dd> <dt class="w-1/2 pr-2"> </dt> <dd class="pt-2"> <form method="post" action=""> {{ csrfInput() }} {{ actionInput('commerce/subscriptions/cancel') }} {{ hiddenInput('subscriptionUid', subscription.uid|hash) }} {{ redirectInput('shop/plans') }} {{ subscription.plan.getGateway().getCancelSubscriptionFormHtml(subscription)|raw }} {{ tag('button', { type: 'submit', class: 'cursor-pointer rounded px-4 py-2 inline-block bg-gray-500 hover:bg-gray-600 text-white hover:text-white', text: 'Unsubscribe'|t }) }} </form> </dd> {% endif %} {% endif %} </dl> {% if not subscription.isCanceled and not subscription.isExpired and subscription.alternativePlans|length %} <div class="border-t border-gray-300 mt-3 pt-3"> <h2 class="text-lg font-semibold"> {{- 'Alternative Plans'|t -}} </h2> <table> <thead> <tr class="bg-gray-300 text-left"> <th class="p-2">{{ 'Plan'|t }}</th> <th> </th> </tr> </thead> <tbody> {% for plan in subscription.alternativePlans %} <tr class="{{ cycle(['bg-gray-100', ''], loop.index0) }}"> <td class="p-2">{{ plan.name }}</td> <td class="p-2"> <form method="post" action=""> {{ csrfInput() }} {{ actionInput('commerce/subscriptions/switch') }} {{ hiddenInput('subscriptionUid', subscription.uid|hash) }} {{ hiddenInput('planUid', plan.uid|hash) }} {{ redirectInput('shop/plans') }} {{ plan.gateway.getSwitchPlansFormHtml(subscription.plan, plan)|raw }} {{ tag('button', { type: 'submit', class: 'cursor-pointer rounded px-4 py-2 inline-block bg-blue-500 hover:bg-blue-600 text-white hover:text-white', text: 'Switch'|t }) }} </form> </td> </tr> {% endfor %} </tbody> </table> </div> {% endif %} {# @var payments \craft\commerce\models\subscriptions\SubscriptionPayment[] #} {% set payments = subscription.getAllPayments() %} {% if payments|length %} <h2 class="text-lg font-semibold mt-3"> {{- 'Payment History'|t -}} </h2> <table> <thead> <tr class="bg-gray-300 text-left"> <th class="p-2">{{ 'Date'|t }}</th> <th>{{ 'Amount'|t }}</th> </tr> </thead> </table> <tbody> {% for payment in payments %} <tr class="{{ cycle(['bg-gray-100', ''], loop.index0) }}"> <td class="p-2"> {{ payment.paymentDate|date("Y-m-d H:i") }} </td> <td class="p-2"> {{ payment.paymentCurrency }} {{ payment.paymentAmount }} </td> </tr> {% endfor %} </tbody> {% endif %} {% endblock %}
/srv/users/craft4/apps/craft4-newsite-space/./templates/./shop/plans/subscription/index.twig