Updated Cart::update() method so you can also update the 'options', also added unit test for it

This commit is contained in:
Rob Gloudemans
2013-05-31 07:28:13 +02:00
parent e0fc3f0145
commit 951c4a8b0f
2 changed files with 21 additions and 1 deletions

View File

@@ -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'))))