Vanilo 3.4 has been released with first-party configurable product support for cart & order items.
Products that the user can customize are common in the E-commerce. Typical examples are:
just to name a few.
The configuration is the property of the cart/order item and not the product itself, therefore the configuration data has to be stored along with those items.
To store the configuration with a cart item use the following code:
use Vanilo\Cart\Facades\Cart;
Cart::addItem($product1, 1, ['attributes' => ['configuration' => ['mug_text' => 'I love pizza']]]);
Besides the CartItem
and OrderItem
models, the following ones have also become configurable:
Carrier
,Shipment
,ShippingMethod
,PaymentMethod
.These models used to be configurable even in earlier versions of Vanilo, but with this release, their configuration has been made standard and uniform.
With this release, both the MasterProdcutVariant
and Product
models have a static findBySku($sku)
method.