Welcome Guest, Not a member yet? Register   Sign In
Shopping Cart
#10

[eluser]beaudierman[/eluser]
Sorry, maybe I'm not understanding and I'm not familiar with the Claudia's Kids site.

Based on your code it looks like you're just trying to display how many items are in the cart. Which, if using the CI cart class and the example you provided, would be done like this:

Code:
<img src="&lt;?php echo base_url(); ?&gt;images/bag.png" width="29" height="29" alt="Cart" />&nbsp;You have: <a href="&lt;?php echo base_url(); ?&gt;">
&lt;?php $this->cart->total_items(); ?&gt;
</a> <span>items in your cart</span>

Based on the error you got, the session variable "cart" is not an array so it cannot be used in a foreach. Can you show me an example of what that variable contains?


Messages In This Thread
Shopping Cart - by El Forum - 06-06-2012, 05:15 AM
Shopping Cart - by El Forum - 06-06-2012, 05:19 AM
Shopping Cart - by El Forum - 06-06-2012, 05:20 AM
Shopping Cart - by El Forum - 06-06-2012, 05:26 AM
Shopping Cart - by El Forum - 06-06-2012, 05:31 AM
Shopping Cart - by El Forum - 06-06-2012, 05:34 AM
Shopping Cart - by El Forum - 06-06-2012, 05:39 AM
Shopping Cart - by El Forum - 06-06-2012, 07:41 AM
Shopping Cart - by El Forum - 06-06-2012, 08:10 AM
Shopping Cart - by El Forum - 06-06-2012, 11:00 AM
Shopping Cart - by El Forum - 06-06-2012, 01:44 PM
Shopping Cart - by El Forum - 06-06-2012, 01:59 PM
Shopping Cart - by El Forum - 06-06-2012, 02:09 PM
Shopping Cart - by El Forum - 06-06-2012, 02:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB