mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-20 22:35:14 +00:00
Fixed bug with row qty that wasn't correctly updated
This commit is contained in:
@@ -51,6 +51,7 @@ class Cart {
|
||||
|
||||
/**
|
||||
* Update the quantity of one row of the cart
|
||||
*
|
||||
* @param string $rowId The rowid of the item you want to update
|
||||
* @param integer $qty New quantity of the item
|
||||
* @return boolean
|
||||
@@ -177,6 +178,7 @@ class Cart {
|
||||
|
||||
/**
|
||||
* Update the cart
|
||||
*
|
||||
* @param Array $cart The new cart content
|
||||
* @return void
|
||||
*/
|
||||
@@ -210,8 +212,8 @@ class Cart {
|
||||
|
||||
$row = $cart->get($rowId);
|
||||
|
||||
$row->qty = $qty;
|
||||
$row->subtotal = $row->qty * $row->price;
|
||||
$row->put('qty', $qty);
|
||||
$row->put('subtotal', $row->qty * $row->price);
|
||||
|
||||
$cart->put($rowId, $row);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user