As we have seen earlier, tickets should be associated with our events and may even have specific fields and code. Instead of just creating custom attributes, we will create a custom product type specifically for our tickets.
Here's how we do it:
Create the
[extension_path]/etc/product_types.xml
configuration file and add the following code:<?xml version="1.0"?> <configxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/product_types.xsd"> <type name="ticket" label="Ticket Product" modelInstance="Blackbird\TicketBlaster\Model\Product\Type\Ticket" indexPriority="30" sortOrder="30"> <customAttributes> <attribute name="refundable" value="true"/> <attribute name="is_real_product" value="false"/> <attribute name="taxable" value="true"/> </customAttributes> </type> <composableTypes> <type name="ticket" /> </composableTypes> </config>
This first...