Product ​
- Type
- Class
- Namespace
- craft\commerce\helpers
- Inherits
- craft\commerce\helpers\Product
- Since
- 2.0
Product helper
Public Methods ​
| Method | Description |
|---|---|
| populateProductFromPost() | Populates a product from the post data. |
| populateProductVariantModel() | Populates all Variant Models from HUD or POST data |
| productFromPost() | Instantiates the product specified by the post data. |
populateProductFromPost() ​
Populates a product from the post data.
Arguments ​
$product(craft\commerce\elements\Product, null)$request(craft\web\Request, null)
Throws ​
populateProductVariantModel() ​
Populates all Variant Models from HUD or POST data
Arguments ​
$product(craft\commerce\elements\Product)$variant(mixed)$key(mixed)
Returns ​
craft\commerce\elements\Variant
Throws ​
productFromPost() ​
- Since
- 3.1.3
Instantiates the product specified by the post data.
Arguments ​
$request(craft\web\Request, null)