Add attribute to a product.
- Full name:
add_product_attribute - Defined in:
cms/core/Shared/Helpers/product.php
Parameters
| Parameter | Type | Description |
|---|---|---|
$productId |
string | Product ID. |
$key |
string | Attribute name. |
$value |
mixed | Attribute value. Must be serializable if non-scalar. |
Return Value
\App\Infrastructure\Services\Attribute\AttributeBag