summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Anbar <aanbar@gmail.com>2014-02-13 11:59:18 +0100
committerAhmad Anbar <aanbar@gmail.com>2014-02-13 11:59:18 +0100
commitda2bdf2b95a55f03aadfb6a1d21a90a0fff627db (patch)
treed65092d82b11791ae0be3c315201bbb1f1b12039
parent576439fda03d4e81cb5b0cfed371f7776a73fe3a (diff)
Re-arranged documentation, fixed comment.
-rw-r--r--system/libraries/Cart.php2
-rw-r--r--user_guide_src/source/libraries/cart.rst19
2 files changed, 16 insertions, 5 deletions
diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php
index ec67d9b4a..389b1b77e 100644
--- a/system/libraries/Cart.php
+++ b/system/libraries/Cart.php
@@ -326,7 +326,7 @@ class CI_Cart {
* This function permits changing item properties.
* Typically it is called from the "view cart" page if a user makes
* changes to the quantity before checkout. That array must contain the
- * rowid and qty for each item.
+ * rowid and quantity for each item.
*
* @param array
* @return bool
diff --git a/user_guide_src/source/libraries/cart.rst b/user_guide_src/source/libraries/cart.rst
index 6d0dd2e3a..a0870e34a 100644
--- a/user_guide_src/source/libraries/cart.rst
+++ b/user_guide_src/source/libraries/cart.rst
@@ -206,9 +206,7 @@ Updating The Cart
To update the information in your cart, you must pass an array
containing the Row ID and quantity to the $this->cart->update()
-function, you may also update any property you have previously
-defined when inserting the item such as options, price
-or other custom fields you defined.
+function.
.. note:: If the quantity is set to zero, the item will be removed from
the cart.
@@ -217,7 +215,6 @@ or other custom fields you defined.
$data = array(
'rowid' => 'b99ccdf16028f015540f341130b6d8ec',
- 'price' => 10,
'qty' => 3
);
@@ -242,6 +239,20 @@ or other custom fields you defined.
$this->cart->update($data);
+You may also update any property you have previously
+defined when inserting the item such as options, price
+or other custom fields you defined.
+
+::
+ $data = array(
+ 'rowid' => 'b99ccdf16028f015540f341130b6d8ec',
+ 'qty' => 1,
+ 'price' => 49.95,
+ 'coupon' => NULL
+ );
+
+ $this->cart->update($data);
+
What is a Row ID?
*****************