I would like to know how I can output Craft Commerces Stripes Publishable Key, which I define under Payment Methods, in a template?

The value I set is settings[publishableKey].



Like this:

{% if cart.paymentMethod.class == 'Stripe' %}
    {{ cart.paymentMethod.settings.publishableKey }}
{% endif %}
  • Thanks. Works like a charm. Is this documented somewhere?
    – outline4
    Jan 24 '18 at 16:03
  • I'm not sure. I just checked the payment method model + the database. Jan 25 '18 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.