Creating product variants
In the previous section, you have seen how to define a Product
entity and an example of product object creation. In this section, you will learn how to enable the inheritance for the Product
class to create product variants and define configurable products. Later in this section, we will see some PHP: Hypertext Preprocessor (PHP) code examples that will show how to practically use variants during development.
To enable inheritance for the Product
class, open the class definition and select the General Settings root element. You can enable class inheritance and allow the variants' creation by selecting the checkboxes that you see in the following screenshot:
As you can see in the previous screenshot, three checkboxes can be enabled, as follows:
- Allow inheritance: If checked, this property enables inheritance among objects in a tree-structured way. The child objects can be instances of...