In this chapter, we looked into extending our framework to allow downloadable products, for which customers are automatically provided access when their purchase is made. We also looked into removing this access when orders are updated to "refunded".
Although this is a very basic implementation, with a number of security issues that would need to be looked into in a live site, it does illustrate how we can quite easily extend the framework to accommodate new features and new types of products. If we wanted, we could easily extend our products' functionality to:
Allow subscriptions: This allows upgrading user accounts based on certain purchases. This could be a "gold membership" product, which upgraded a user's permission rights to the site, allowing them to access more areas.
Build dynamic downloads: If we were selling software, we could integrate the build process for that, so that license data or customer data is automatically inserted into their copy of the software (that is, the software is built direct from version control specifically for that customer, helping to manage licensing and track piracy).
E-mail-based products: This is just as we did with our purchasable voucher codes, where a custom e-mail is sent to the customer.
E-mail- or file-based products: We could combine our newly-created file-based products with an e-mail-based product, and have the files be sent as e-mail attachments.
Drop shipping orders: If we have a supplier who offers a drop shipping service, where they fulfill our orders, we could (assuming they had a suitable API) integrate with their systems to have the order dispatched.