Available Variables

The following are common methods you will want to call in your front end templates:

craft.giftVoucher.vouchers() #

See Voucher Queries

craft.giftVoucher.codes() #

See Code Queries

craft.giftVoucher.getVoucherTypes() #

Returns all Voucher Types available.

craft.giftVoucher.getVoucherCodes() #

Returns any currently-applied vouchers. This occurs when a customer apply's a voucher to their cart.

craft.giftVoucher.isVoucher(lineItem) #

Returns whether a provided Line Item object is a gift voucher or not.

craft.giftVoucher.getPdfUrl(lineItem) #

Returns a URL to the PDF for this gift voucher, for the provided Line Item object. This will only show vouchers for this line item.

craft.giftVoucher.getOrderPdfUrl(order) #

Returns a URL to the PDF for this gift voucher, for the provided Order object. This will show vouchers for the entire order.

Get started with Gift Voucher

Available for Craft 2 & Craft 3.