CodeIgniter Forums
Group items in cart - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Group items in cart (/thread-45862.html)



Group items in cart - El Forum - 10-09-2011

[eluser]gdweb[/eluser]
In "options"(the item from cart array) I have "id_category".
Something like this:
Code:
Array (
   [afdec7005cc9f14302cd0474fd0f3c96] =>
        Array (
            [rowid] => afdec7005cc9f14302cd0474fd0f3c96
            [id] => 103
            [qty] => 3
            [price] => 34
            [name] => Item22
            [options] => Array (
                             [instructions] => 'asdasdas'
                             [id_category] => 1
                         )
            [subtotal] => 102
        )
)

Now, by default, the cart view looks like this:
Code:
qty  name    category       price   subtotal
3   Item22 Category_Name22    23       69
2   Item23 Category_Name33    12       24
1   Item24 Category_Name22    14       14
   Total: 107

And I want it to be displayed like this:

Code:
Category_Name22
qty  name     price   subtotal
3   Item22     23       69
1   Item24     14       14
             total :    83

Category_Name33
qty  name     price   subtotal
2   Item23     12       24
             total :    24
  Total: 107