w10schools
Login Register
  • Home
  • Tutorials
    • HTML, CSS
      • HTML, HTML5
      • CSS, CSS3
    • XML
    • JavaScript, AJAX
    • PHP
    • Ruby on Rails
      • Ruby
      • Rails
    • ASP.NET
      • ASP
      • C# .NET
    • Java
      • JSP
    • Databases
      • MySQL
      • MSSQL Server
      • Oracle
    • Web Server
      • Windows
      • Linux
      • Apache
      • IIS
    • Design
      • Dreamweaver
      • Flash
      • Photoshop
      • Fireworks
      • CorelDRAW
      • Illustrator
  • References
    • HTML
      • Bootstrap
    • CSS
      • CSS Selectors
      • Sass
    • JavaScript
    • Mobile Apps
      • Cordova
    • Ruby on Rails
      • Ruby
      • Rails
    • PHP
      • Function
      • Language
      • CodeIgniter
      • Phalcon
      • PHPUnit
      • Symfony
      • Drupal
      • Yii
      • Laravel
    • Perl
      • Perl
    • Python
      • Python
      • Django
      • NumPy
      • Pandas
      • scikit-image
      • scikit-learn
      • Statsmodels
      • Matplotlib
    • Lua
      • Lua
    • C, C++
      • C
      • C++
    • Server
      • Docker
      • Apache HTTP Server
      • Nginx
    • Database
      • PostgreSQL
    • Big Data
      • TensorFlow
    • Game Development
      • Phaser
      • LÖVE
  • Articles
    • News
    • General
      • Website Promotion
      • Online Advertising
      • Make Money Online
    • Editorials
    • Interviews
    • Web Roundups
  • Resources
    • Design
      • Fonts
      • Graphics
      • Vectors
      • Templates
      • UI (User Interface)
      • Brushes
      • Patterns, Backgrounds
      • Textures
    • Web Development
      • HTML, CSS
      • XML
      • JavaScript, AJAX
      • Ruby on Rails
      • PHP
      • Java
      • .NET
      • Python
      • Perl
      • Flash
    • Mobile Application Development
      • Mobile Development Tools
      • Swift
    • Online Services
      • Online Storage
      • Web Hosting
  • Tools
    • Generators
Edit
In Place Editing Advanced Editing
  • References
  • PHP
  • CodeIgniter
  • Shopping Cart

CI_Cart::contents()

contents([$newest_first = FALSE])

Parameters:
  • $newest_first (bool) – Whether to order the array with newest items first
Returns:

An array of cart contents

Return type:

array

Returns an array containing everything in the cart. You can sort the order by which the array is returned by passing it TRUE where the contents will be sorted from newest to oldest, otherwise it is sorted from oldest to newest.

Links:
  • http://www.codeigniter.com/user_guide/libraries/cart.html#CI_Cart::contents
doc_CodeIgniter
doc_CodeIgniter
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.

Popular Articles
CI_Cart class CI_Cart $product_id_rules = '.a-z0-9_-' These are the regular expression rules that we use to validate the product ID - alpha-numeric, da
CI_Cart::insert() insert([$items = array()]) Parameters: $items (array) – Items to insert into the cart Returns: TRUE on success, FALSE on failure Return type:
CI_Cart::destroy() destroy() Return type: void Permits you to destroy the cart. This method will likely be called when you are finished processing the customer’s o
CI_Cart::update() update([$items = array()]) Parameters: $items (array) – Items to update in the cart Returns: TRUE on success, FALSE on failure Return type:
CI_Cart::total() total() Returns: Total amount Return type: int Displays the total amount in the cart.


Return to View
  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share

Designed by : w10schools

service@w10schools.com

Our Partners: aeeble – Providing content publishing and search solutions