mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-24 07:55:35 +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
|
* Update the quantity of one row of the cart
|
||||||
|
*
|
||||||
* @param string $rowId The rowid of the item you want to update
|
* @param string $rowId The rowid of the item you want to update
|
||||||
* @param integer $qty New quantity of the item
|
* @param integer $qty New quantity of the item
|
||||||
* @return boolean
|
* @return boolean
|
||||||
@@ -177,6 +178,7 @@ class Cart {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the cart
|
* Update the cart
|
||||||
|
*
|
||||||
* @param Array $cart The new cart content
|
* @param Array $cart The new cart content
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@@ -210,8 +212,8 @@ class Cart {
|
|||||||
|
|
||||||
$row = $cart->get($rowId);
|
$row = $cart->get($rowId);
|
||||||
|
|
||||||
$row->qty = $qty;
|
$row->put('qty', $qty);
|
||||||
$row->subtotal = $row->qty * $row->price;
|
$row->put('subtotal', $row->qty * $row->price);
|
||||||
|
|
||||||
$cart->put($rowId, $row);
|
$cart->put($rowId, $row);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user