mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 07:31:31 +00:00
Updated Cart::update() method so you can also update the 'options', also added unit test for it
This commit is contained in:
@@ -264,7 +264,15 @@ class Cart {
|
||||
|
||||
foreach($attributes as $key => $value)
|
||||
{
|
||||
$row->put($key, $value);
|
||||
if($key == 'options')
|
||||
{
|
||||
$options = $row->options->merge($value);
|
||||
$row->put($key, $options);
|
||||
}
|
||||
else
|
||||
{
|
||||
$row->put($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
if( ! is_null(array_keys($attributes, array('qty', 'price'))))
|
||||
|
||||
Reference in New Issue
Block a user