Skip to main content
Clarify question
Source Link
Simon Kuran
  • 3k
  • 1
  • 19
  • 35

How do I access a subscription plan's planData? Maybe as an object? I'm using Commerce 2 with the Stripe gateway.

For example:

{% set plans = craft.commerce.getPlans().getAllPlans() %}
{% for plan in plans %}
    {{ dump(plan.planData) }}
{% endfor %}

planData looks like JSON stored as a string. How do I access its data (amount, trial_period_days etc.) on the front end?

Does this need to be handled by a custom plugin? Seems like something that should be available out of the box. Hopefully I just over looked it.

How do I access a subscription plan's planData? Maybe as an object? I'm using Commerce 2 with the Stripe gateway.

For example:

{% set plans = craft.commerce.getPlans().getAllPlans() %}
{% for plan in plans %}
    {{ dump(plan.planData) }}
{% endfor %}

planData looks like JSON stored as a string. How do I access its data (amount, trial_period_days etc.)?

Does this need to be handled by a custom plugin? Seems like something that should be available out of the box. Hopefully I just over looked it.

How do I access a subscription plan's planData? Maybe as an object? I'm using Commerce 2 with the Stripe gateway.

For example:

{% set plans = craft.commerce.getPlans().getAllPlans() %}
{% for plan in plans %}
    {{ dump(plan.planData) }}
{% endfor %}

planData looks like JSON stored as a string. How do I access its data (amount, trial_period_days etc.) on the front end?

Does this need to be handled by a custom plugin? Seems like something that should be available out of the box. Hopefully I just over looked it.

Source Link
Simon Kuran
  • 3k
  • 1
  • 19
  • 35

Get Commerce 2's Stripe subscription planData as object

How do I access a subscription plan's planData? Maybe as an object? I'm using Commerce 2 with the Stripe gateway.

For example:

{% set plans = craft.commerce.getPlans().getAllPlans() %}
{% for plan in plans %}
    {{ dump(plan.planData) }}
{% endfor %}

planData looks like JSON stored as a string. How do I access its data (amount, trial_period_days etc.)?

Does this need to be handled by a custom plugin? Seems like something that should be available out of the box. Hopefully I just over looked it.