Voucher codes work in the same way as discount codes, except that they are purchased for use by a customer, as opposed to given away for promotional reasons.
The discount codes and product variation features already give us most of the functionality required for purchasable voucher codes.
As a voucher code has the same functionality as our discount codes, which we built earlier, we have a large portion of the functionality in place. When a voucher is purchased, a new record in the discount codes table will be made, with a
num_vouchers value of
The product variations feature we built in Chapter 4, Product Variations and User Uploads, allows us to create a purchasable ...