From a49c8adbc24d904b3473cc301f0f56818acdddcb Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 11 Feb 2014 17:15:07 +0200 Subject: Change CI_Table:: to NULL Because semantics --- user_guide_src/source/libraries/table.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/table.rst b/user_guide_src/source/libraries/table.rst index 6e011083e..9d95eddfc 100644 --- a/user_guide_src/source/libraries/table.rst +++ b/user_guide_src/source/libraries/table.rst @@ -139,7 +139,7 @@ Class Reference .. class:: CI_Table - .. attribute:: $function = FALSE + .. attribute:: $function = NULL Allows you to specify a native PHP function or a valid function array object to be applied to all cell data. :: -- cgit v1.2.3-24-g4f1b From 871754af60251993d640981e107d2def5f2db396 Mon Sep 17 00:00:00 2001 From: darwinel Date: Tue, 11 Feb 2014 17:34:57 +0100 Subject: 2013 > 2014 Update copyright notices from 2013 to 2014. And update one calendar example in user_guide from year 2013/2014 to 2014/2015. --- user_guide_src/source/libraries/calendar.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/calendar.rst b/user_guide_src/source/libraries/calendar.rst index 65a447a3d..2263aa404 100644 --- a/user_guide_src/source/libraries/calendar.rst +++ b/user_guide_src/source/libraries/calendar.rst @@ -248,14 +248,14 @@ Class Reference you submit 13 as the month, the year will increment and the month will become January:: - print_r($this->calendar->adjust_date(13, 2013)); + print_r($this->calendar->adjust_date(13, 2014)); outputs:: Array (     [month] => '01' - [year] => '2014' + [year] => '2015' ) .. method:: get_total_days($month, $year) -- cgit v1.2.3-24-g4f1b From 25f119cef588a01651cec7c59d3b03924b2dd81c Mon Sep 17 00:00:00 2001 From: darwinel Date: Tue, 11 Feb 2014 18:29:58 +0100 Subject: Writing style fix based on style guide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit „Use of || is discouraged as its clarity on some output devices is low (looking like the number 11 for instance). && is preferred over AND but either are acceptable, and a space should always precede and follow !.” --- user_guide_src/source/libraries/xmlrpc.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/xmlrpc.rst b/user_guide_src/source/libraries/xmlrpc.rst index 2cf548750..115b4e680 100644 --- a/user_guide_src/source/libraries/xmlrpc.rst +++ b/user_guide_src/source/libraries/xmlrpc.rst @@ -223,17 +223,17 @@ email address, etc.). Here is how the processing function might look:: $parameters = $request->output_parameters(); - if ($parameters['1'] != $username AND $parameters['2'] != $password) + if ($parameters['1'] != $username && $parameters['2'] != $password) { return $this->xmlrpc->send_error_message('100', 'Invalid Access'); } - $response = array(array('nickname' => array('Smitty','string'), - 'userid' => array('99','string'), - 'url' => array('http://yoursite.com','string'), - 'email' => array('jsmith@yoursite.com','string'), - 'lastname' => array('Smith','string'), - 'firstname' => array('John','string') + $response = array(array('nickname' => array('Smitty', 'string'), + 'userid' => array('99', 'string'), + 'url' => array('http://yoursite.com', 'string'), + 'email' => array('jsmith@yoursite.com', 'string'), + 'lastname' => array('Smith', 'string'), + 'firstname' => array('John', 'string') ), 'struct'); -- cgit v1.2.3-24-g4f1b From 053d5d6e8dff0f1af9c33330960a1085628b3930 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 11 Feb 2014 21:45:39 +0200 Subject: [ci skip] Update the XML-RPC lib docs --- user_guide_src/source/libraries/xmlrpc.rst | 131 +++++++++++++++-------------- 1 file changed, 66 insertions(+), 65 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/xmlrpc.rst b/user_guide_src/source/libraries/xmlrpc.rst index 115b4e680..c2e9a1113 100644 --- a/user_guide_src/source/libraries/xmlrpc.rst +++ b/user_guide_src/source/libraries/xmlrpc.rst @@ -123,12 +123,12 @@ If you use data types other than strings, or if you have several different data types, you will place each parameter into its own array, with the data type in the second position:: - $request = array ( - array('John', 'string'), - array('Doe', 'string'), - array(FALSE, 'boolean'), - array(12345, 'int') - ); + $request = array( + array('John', 'string'), + array('Doe', 'string'), + array(FALSE, 'boolean'), + array(12345, 'int') + ); $this->xmlrpc->request($request); The `Data Types <#datatypes>`_ section below has a full list of data @@ -171,7 +171,7 @@ not part of the CodeIgniter super object. In other words, if an XML-RPC Client sends a request for the new_post method, your server will load the My_blog class and call the new_entry function. If the request is for the update_post method, your server -will load the My_blog class and call the update_entry function. +will load the My_blog class and call the ``update_entry()`` method. The function names in the above example are arbitrary. You'll decide what they should be called on your server, or if you are using @@ -181,7 +181,7 @@ function names. There are two additional configuration keys you may make use of when initializing the server class: debug can be set to TRUE in order to enable debugging, and xss_clean may be set to FALSE to prevent sending -data through the Security library's xss_clean function. +data through the Security library's ``xss_clean()`` method. Processing Server Requests ========================== @@ -207,49 +207,52 @@ have access to the *request parameters* enabling you to process the request. When you are done you will send a Response back to the Client. Below is a real-world example, using the Blogger API. One of the methods -in the Blogger API is getUserInfo(). Using this method, an XML-RPC +in the Blogger API is ``getUserInfo()``. Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing function might look:: class My_blog extends CI_Controller { - function getUserInfo($request) - { - $username = 'smitty'; - $password = 'secretsmittypass'; + public function getUserInfo($request) + { + $username = 'smitty'; + $password = 'secretsmittypass'; - $this->load->library('xmlrpc'); + $this->load->library('xmlrpc'); - $parameters = $request->output_parameters(); + $parameters = $request->output_parameters(); - if ($parameters['1'] != $username && $parameters['2'] != $password) - { - return $this->xmlrpc->send_error_message('100', 'Invalid Access'); - } + if ($parameters[1] != $username && $parameters[2] != $password) + { + return $this->xmlrpc->send_error_message('100', 'Invalid Access'); + } - $response = array(array('nickname' => array('Smitty', 'string'), - 'userid' => array('99', 'string'), - 'url' => array('http://yoursite.com', 'string'), - 'email' => array('jsmith@yoursite.com', 'string'), - 'lastname' => array('Smith', 'string'), - 'firstname' => array('John', 'string') - ), - 'struct'); + $response = array( + array( + 'nickname' => array('Smitty', 'string'), + 'userid' => array('99', 'string'), + 'url' => array('http://yoursite.com', 'string'), + 'email' => array('jsmith@yoursite.com', 'string'), + 'lastname' => array('Smith', 'string'), + 'firstname' => array('John', 'string') + ), + 'struct' + ); - return $this->xmlrpc->send_response($response); - } + return $this->xmlrpc->send_response($response); + } } Notes: ------ -The output_parameters() function retrieves an indexed array +The ``output_parameters()`` method retrieves an indexed array corresponding to the request parameters sent by the client. In the above example, the output parameters will be the username and password. If the username and password sent by the client were not valid, and -error message is returned using send_error_message(). +error message is returned using ``send_error_message()``. If the operation was successful, the client will be sent back a response array containing the user's info. @@ -263,22 +266,22 @@ single item**. This item can be an array with several additional arrays, but there can be only one primary array index. In other words, the basic prototype is this:: - $response = array('Response data', 'array'); + $response = array('Response data', 'array'); Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:: - $response = array ( - array( - 'first_name' => array('John', 'string'), - 'last_name' => array('Doe', 'string'), - 'member_id' => array(123435, 'int'), - 'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'), - ), - 'struct' - ); + $response = array( + array( + 'first_name' => array('John', 'string'), + 'last_name' => array('Doe', 'string'), + 'member_id' => array(123435, 'int'), + 'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'), + ), + 'struct' + ); Notice that the above array is formatted as a struct. This is the most common data type for responses. @@ -373,17 +376,16 @@ folder:: $parameters = $request->output_parameters(); $response = array( - array( - 'you_said' => $parameters[0], - 'i_respond' => 'Not bad at all.' - ), - 'struct' - ); + array( + 'you_said' => $parameters[0], + 'i_respond' => 'Not bad at all.' + ), + 'struct' + ); return $this->xmlrpc->send_response($response); } } - ?> Try it! @@ -398,7 +400,7 @@ back to you. The client you created sends a message ("How's is going?") to the server, along with a request for the "Greetings" method. The Server -receives the request and maps it to the "process" function, where a +receives the request and maps it to the ``process()`` method, where a response is sent back. Using Associative Arrays In a Request Parameter @@ -408,22 +410,21 @@ If you wish to use an associative array in your method parameters you will need to use a struct datatype:: $request = array( - array( - // Param 0 - array( - 'name'=>'John' - ), - 'struct' - ), - array( - // Param 1 - array( - 'size'=>'large', - 'shape'=>'round' - ), - 'struct' - ) - ); + array( + // Param 0 + array('name' => 'John'), + 'struct' + ), + array( + // Param 1 + array( + 'size' => 'large', + 'shape'=>'round' + ), + 'struct' + ) + ); + $this->xmlrpc->request($request); You can retrieve the associative array when processing the request in -- cgit v1.2.3-24-g4f1b From 7d16de620a46f84ffeb52a54ae82439a06f89c74 Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Thu, 13 Feb 2014 01:45:27 +0200 Subject: Fixed code style & added few extra checks. Updated cart documentation. --- user_guide_src/source/libraries/cart.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/cart.rst b/user_guide_src/source/libraries/cart.rst index fb92c280a..015f1c90e 100644 --- a/user_guide_src/source/libraries/cart.rst +++ b/user_guide_src/source/libraries/cart.rst @@ -194,7 +194,9 @@ 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: +function, you may also update any property you have previously +defined when inserting the item such like (options, price +or other custom fields you defined). .. note:: If the quantity is set to zero, the item will be removed from the cart. @@ -289,10 +291,10 @@ Class Reference :returns: TRUE on success, FALSE on failure :rtype: bool - This method permits the quantity of a given item to be changed. + This method permits changing the properties of a given item. Typically it is called from the "view cart" page if a user makes changes - to the quantity before checkout. That array must contain the product ID - and quantity for each item. + to the quantity before checkout. That array must contain the rowid + and qty for each item. .. method:: remove($rowid) -- cgit v1.2.3-24-g4f1b From 576439fda03d4e81cb5b0cfed371f7776a73fe3a Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Thu, 13 Feb 2014 06:16:31 +0200 Subject: Added changelog entry. An example to the docs. Tidy code a little bit. --- user_guide_src/source/libraries/cart.rst | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/cart.rst b/user_guide_src/source/libraries/cart.rst index 015f1c90e..6d0dd2e3a 100644 --- a/user_guide_src/source/libraries/cart.rst +++ b/user_guide_src/source/libraries/cart.rst @@ -88,6 +88,18 @@ array will be stored in the session. However, it is best to standardize your data among all your products in order to make displaying the information in a table easier. +:: + + $data = array( + 'id' => 'sku_123ABC', + 'qty' => 1, + 'price' => 39.95, + 'name' => 'T-Shirt', + 'coupon' => 'XMAS-50OFF' + ); + + $this->cart->insert($data); + The insert() method will return the $rowid if you successfully insert a single item. @@ -195,8 +207,8 @@ 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 like (options, price -or other custom fields you defined). +defined when inserting the item such as options, price +or other custom fields you defined. .. note:: If the quantity is set to zero, the item will be removed from the cart. @@ -205,6 +217,7 @@ or other custom fields you defined). $data = array( 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', + 'price' => 10, 'qty' => 3 ); -- cgit v1.2.3-24-g4f1b From da2bdf2b95a55f03aadfb6a1d21a90a0fff627db Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Thu, 13 Feb 2014 12:59:18 +0200 Subject: Re-arranged documentation, fixed comment. --- user_guide_src/source/libraries/cart.rst | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'user_guide_src/source/libraries') 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? ***************** -- cgit v1.2.3-24-g4f1b From c09b953be9d14158cc21cecc676f7e992c16f752 Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Thu, 13 Feb 2014 13:05:41 +0200 Subject: Added Missing new line. --- user_guide_src/source/libraries/cart.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/cart.rst b/user_guide_src/source/libraries/cart.rst index a0870e34a..74e791554 100644 --- a/user_guide_src/source/libraries/cart.rst +++ b/user_guide_src/source/libraries/cart.rst @@ -244,6 +244,7 @@ defined when inserting the item such as options, price or other custom fields you defined. :: + $data = array( 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', 'qty' => 1, -- cgit v1.2.3-24-g4f1b From 0bd390c660290b7dc478955da6a8a7fbb3ca9fd6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 13 Feb 2014 14:26:50 +0200 Subject: [ci skip] Polish changes from #2874 --- user_guide_src/source/libraries/cart.rst | 125 +++++++++++++++---------------- 1 file changed, 62 insertions(+), 63 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/cart.rst b/user_guide_src/source/libraries/cart.rst index 74e791554..8a473b49d 100644 --- a/user_guide_src/source/libraries/cart.rst +++ b/user_guide_src/source/libraries/cart.rst @@ -33,7 +33,7 @@ Initializing the Shopping Cart Class utilize a database. To initialize the Shopping Cart Class in your controller constructor, -use the $this->load->library function:: +use the ``$this->load->library()`` method:: $this->load->library('cart'); @@ -49,16 +49,16 @@ Adding an Item to The Cart ========================== To add an item to the shopping cart, simply pass an array with the -product information to the $this->cart->insert() function, as shown +product information to the ``$this->cart->insert()`` method, as shown below:: $data = array( - 'id' => 'sku_123ABC', - 'qty' => 1, - 'price' => 39.95, - 'name' => 'T-Shirt', - 'options' => array('Size' => 'L', 'Color' => 'Red') - ); + 'id' => 'sku_123ABC', + 'qty' => 1, + 'price' => 39.95, + 'name' => 'T-Shirt', + 'options' => array('Size' => 'L', 'Color' => 'Red') + ); $this->cart->insert($data); @@ -91,16 +91,16 @@ information in a table easier. :: $data = array( - 'id' => 'sku_123ABC', - 'qty' => 1, - 'price' => 39.95, - 'name' => 'T-Shirt', - 'coupon' => 'XMAS-50OFF' - ); + 'id' => 'sku_123ABC', + 'qty' => 1, + 'price' => 39.95, + 'name' => 'T-Shirt', + 'coupon' => 'XMAS-50OFF' + ); $this->cart->insert($data); -The insert() method will return the $rowid if you successfully insert a +The ``insert()`` method will return the $rowid if you successfully insert a single item. Adding Multiple Items to The Cart @@ -148,15 +148,15 @@ helper `. :: - + - - - - + + + + @@ -166,9 +166,9 @@ helper `. - - + - - + + + @@ -192,9 +192,9 @@ helper `. - - - + + +
QTYItem DescriptionItem PriceSub-TotalQTYItem DescriptionItem PriceSub-Total
$i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?> - + $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?> + cart->has_options($items['rowid']) == TRUE): ?> @@ -182,9 +182,9 @@ helper `. - cart->format_number($items['price']); ?>$cart->format_number($items['subtotal']); ?>cart->format_number($items['price']); ?>$cart->format_number($items['subtotal']); ?>
 Total$cart->format_number($this->cart->total()); ?> Total$cart->format_number($this->cart->total()); ?>
@@ -205,8 +205,8 @@ 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. +containing the Row ID and quantity to the ``$this->cart->update()`` +method:: .. note:: If the quantity is set to zero, the item will be removed from the cart. @@ -214,53 +214,52 @@ function. :: $data = array( - 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', - 'qty' => 3 - ); + 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', + 'qty' => 3 + ); $this->cart->update($data); // Or a multi-dimensional array $data = array( - array( - 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', - 'qty' => 3 - ), - array( - 'rowid' => 'xw82g9q3r495893iajdh473990rikw23', - 'qty' => 4 - ), - array( - 'rowid' => 'fh4kdkkkaoe30njgoe92rkdkkobec333', - 'qty' => 2 - ) - ); + array( + 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', + 'qty' => 3 + ), + array( + 'rowid' => 'xw82g9q3r495893iajdh473990rikw23', + 'qty' => 4 + ), + array( + 'rowid' => 'fh4kdkkkaoe30njgoe92rkdkkobec333', + 'qty' => 2 + ) + ); $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. +You may also update any property you have previously defined when +inserting the item such as options, price or other custom fields. :: $data = array( - 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', - 'qty' => 1, - 'price' => 49.95, - 'coupon' => NULL - ); + 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', + 'qty' => 1, + 'price' => 49.95, + 'coupon' => NULL + ); $this->cart->update($data); What is a Row ID? ***************** -The row ID is a unique identifier that is -generated by the cart code when an item is added to the cart. The reason -a unique ID is created is so that identical products with different -options can be managed by the cart. +The row ID is a unique identifier that is generated by the cart code +when an item is added to the cart. The reason a unique ID is created +is so that identical products with different options can be managed +by the cart. For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will @@ -274,9 +273,9 @@ In nearly all cases, updating the cart will be something the user does via the "view cart" page, so as a developer, it is unlikely that you will ever have to concern yourself with the "row ID", other than making sure your "view cart" page contains this information in a hidden form -field, and making sure it gets passed to the update function when the -update form is submitted. Please examine the construction of the "view -cart" page above for more information. +field, and making sure it gets passed to the ``update()`` method when +the update form is submitted. Please examine the construction of the +"view cart" page above for more information. *************** @@ -374,7 +373,7 @@ Class Reference Returns TRUE (boolean) if a particular row in the cart contains options. This method is designed to be used in a loop with ``contents()``, since - you must pass the rowid to this function, as shown in the Displaying + you must pass the rowid to this method, as shown in the Displaying the Cart example above. .. method:: product_options([$row_id = '']) -- cgit v1.2.3-24-g4f1b From aef63e532bcede1d455bc27f0fc6f369ab74f203 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 13 Feb 2014 14:49:55 +0200 Subject: Add language translation support to CI_Pagination (#1589) --- user_guide_src/source/libraries/pagination.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/pagination.rst b/user_guide_src/source/libraries/pagination.rst index ee12d9e6f..d8d31f8c5 100644 --- a/user_guide_src/source/libraries/pagination.rst +++ b/user_guide_src/source/libraries/pagination.rst @@ -165,6 +165,8 @@ $config['first_link'] = 'First'; The text you would like shown in the "first" link on the left. If you do not want this link rendered, you can set its value to FALSE. +.. note:: This value can also be translated via a language file. + $config['first_tag_open'] = '
'; ==================================== @@ -185,6 +187,8 @@ $config['last_link'] = 'Last'; The text you would like shown in the "last" link on the right. If you do not want this link rendered, you can set its value to FALSE. +.. note:: This value can also be translated via a language file. + $config['last_tag_open'] = '
'; =================================== @@ -205,6 +209,8 @@ $config['next_link'] = '>'; The text you would like shown in the "next" page link. If you do not want this link rendered, you can set its value to FALSE. +.. note:: This value can also be translated via a language file. + $config['next_tag_open'] = '
'; =================================== @@ -225,6 +231,8 @@ $config['prev_link'] = '<'; The text you would like shown in the "previous" page link. If you do not want this link rendered, you can set its value to FALSE. +.. note:: This value can also be translated via a language file. + $config['prev_tag_open'] = '
'; =================================== -- cgit v1.2.3-24-g4f1b From 81f036753272391360ba5b64e6dd93c4101a8733 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 13 Feb 2014 17:57:41 +0200 Subject: [ci skip] Add compatibility functions documentation + Sphinx build fixes for Cart --- user_guide_src/source/libraries/cart.rst | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/cart.rst b/user_guide_src/source/libraries/cart.rst index 8a473b49d..d7d495967 100644 --- a/user_guide_src/source/libraries/cart.rst +++ b/user_guide_src/source/libraries/cart.rst @@ -114,26 +114,26 @@ same page. :: $data = array( - array( - 'id' => 'sku_123ABC', - 'qty' => 1, - 'price' => 39.95, - 'name' => 'T-Shirt', - 'options' => array('Size' => 'L', 'Color' => 'Red') - ), - array( - 'id' => 'sku_567ZYX', - 'qty' => 1, - 'price' => 9.95, - 'name' => 'Coffee Mug' - ), - array( - 'id' => 'sku_965QRS', - 'qty' => 1, - 'price' => 29.95, - 'name' => 'Shot Glass' - ) - ); + array( + 'id' => 'sku_123ABC', + 'qty' => 1, + 'price' => 39.95, + 'name' => 'T-Shirt', + 'options' => array('Size' => 'L', 'Color' => 'Red') + ), + array( + 'id' => 'sku_567ZYX', + 'qty' => 1, + 'price' => 9.95, + 'name' => 'Coffee Mug' + ), + array( + 'id' => 'sku_965QRS', + 'qty' => 1, + 'price' => 29.95, + 'name' => 'Shot Glass' + ) + ); $this->cart->insert($data); @@ -206,7 +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()`` -method:: +method. .. note:: If the quantity is set to zero, the item will be removed from the cart. -- cgit v1.2.3-24-g4f1b