Voucher
Whenever you're dealing with a vouchers in your template, you're actually working with a Voucher object.
Properties
Type: int|null
ID of the voucher.
Type: string|null
The voucher name/title.
Type: string|null
The voucher name/title.
Type: string|null
The URL to this single voucher.
Type: int|null
Returns this vouchers id - as vouchers are purchasables.
Type: VoucherType|null
The voucher's product type.
Type: int|null
The voucher's voucher type ID
Type: float|null
The listing price of the voucher.
Type: float|null
Whether this voucher should have a custom (user-provided) amount.
Type: string|null
The sku of the voucher.
Type: string|null
live, pending or expired based on postDate and expiryDate dates. Pending are vouchers with a future postDate date.
true or false
Type: int|null
The ID for the tax category this voucher uses when their tax calculations are made.
Type: TaxCategory
The tax category this voucher uses when their tax calculations are made.
Type: int|null
The ID for the shipping category this voucher uses when their shipping calculations are made.
Type: ShippingCategory
The shipping category this voucher uses when their shipping calculations are made.
Type: DateTime|null
The date this voucher is available for sale.
Type: DateTime|null
The date this voucher will no longer be available for sale.
Methods
The url to edit this voucher in the control panel.
Returns: string
Get the PDF URL for this voucher and Line Item (opens new window).
Get all Code's for a provided Line Item (opens new window) and voucher.
Returns: static
Convenience method for native Commerce product behaviour.