Skip to content
Log in

VoucherProvider - Liquid Object Reference

On this page

Description

The VoucherProvider object represents a way vouchers can be applied at checkout: StoreConnect vouchers, or an external provider such as Vii gift cards.

current_store.voucher_providers lists only the providers the store can offer. StoreConnect vouchers are listed when the store has at least one voucher that has not expired. Vii is listed when the store has an active Vii payment provider whose Channels include web, or are blank.

Attributes

Attribute Type Description
name String Returns the name of this voucher provider: sc for StoreConnect vouchers, vii for Vii gift cards
payment_provider PaymentProvider Returns the PaymentProvider backing this voucher provider, or nil for StoreConnect vouchers

Example

The default checkout renders one panel per provider. Pass the provider to the apply-provider-voucher form to render that provider’s fields.

```liquid

{%- for voucher_provider in current_store.voucher_providers %} {% case voucher_provider.name %} {% when “sc” %} {% render “checkout/vouchers/apply_sc” %} {% when “vii” %} {% render “checkout/vouchers/apply_vii”, provider: voucher_provider %} {% endcase %} {%- endfor %} ```

Available on

Was this article helpful?

Was this article helpful?