<p>You can use</p>
<pre><code>{{ subscription.subscriptionData.plan.amount }}
</code></pre>
<p>to get the price of the plan the customer subscribed to.</p>
<p>That returns in cents so you'll need to convert and format it.</p>
<pre><code>{{ (subscription.subscriptionData.plan.amount / 100) | currency('USD', stripZeros=true) }}
</code></pre>

CC BY-SA 4.0
2021-01-08T23:41:45.103Z
2021-01-08T23:41:45.103Z
CraftQuest
<p>I need to be able to output the price of a subscription after the user has subscribed. I'm using the Stripe Gateway. This post indicates to use <code>{{ subscriptionPlanData.plan.amount }}</code> but that doesn't seem to work for Commerce 3.</p>
<p><a href="https://craftcms.stackexchange.com/questions/27976/commerce-2-subscription-prices">Commerce 2 Subscription Prices</a></p>
<p>The code below works but only after you refresh the payment history for the subscription in the admin, which seems to be a manual task.</p>
<pre><code>{% set payments = subscription.getAllPayments() %}
      {% if payments %}
           {% for payment in payments %}
                ${{ payment.paymentAmount|number_format(2, '.', ',') }}
           {% endfor %}
      {% endif %}
</code></pre>
<p>Any idea how to get that payment history to automatically refresh after a subscription? Since that includes taxes, etc. that might be the best solution?</p>

<plugin-craftcommerce><stripe><commerce-subscriptions>
Commerce Subscription Prices
# Commerce Subscription Prices

(Asked by: username_0 on 2021-01-05)

I need to be able to output the price of a subscription after the user has subscribed. I'm using the Stripe Gateway. This post indicates to use {{ subscriptionPlanData.plan.amount }} but that doesn't seem to work for Commerce 3.
Commerce 2 Subscription Prices
The code below works but only after you refresh the payment history for the subscription in the admin, which seems to be a manual task.
{% set payments = subscription.getAllPayments() %}
      {% if payments %}
           {% for payment in payments %}
                ${{ payment.paymentAmount|number_format(2, '.', ',') }}
           {% endfor %}
      {% endif %}

Any idea how to get that payment history to automatically refresh after a subscription? Since that includes taxes, etc. that might be the best solution?

**Tags:** plugin-craftcommerce, stripe, commerce-subscriptions


---

## 1 answers

### Answer by username_1 on 2021-01-08. Score: 2

You can use
{{ subscription.subscriptionData.plan.amount }}

to get the price of the plan the customer subscribed to.
That returns in cents so you'll need to convert and format it.
{{ (subscription.subscriptionData.plan.amount / 100) | currency('USD', stripZeros=true) }}


---

