• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shopping Cart

#11
[eluser]the_unforgiven[/eluser]
I put in this =
Code:
<?php echo (count($this->cart->total_items()));  ?>

Which shows 1 once I add 1 item to the cart but adding more items currently there's 6 in it still shows 1, any idea's please?

Thanks in advance...

:-)

#12
[eluser]beaudierman[/eluser]
The reason it's returning 1 is because you're using the PHP count function, which isn't working because of the multi-dimensional array that is being put in it. The cart class' total_items function returns an integer already so the count function isn't needed.

This should return 6 if you have 6 items in your cart:

Code:
<?php echo $this->cart->total_items(); ?>

#13
[eluser]the_unforgiven[/eluser]
Yer, silly me!! :0 thanks for that, well now i can move on everything else works the update the cart destroy it was just the total items things that was holding me up! Now i can move on with great thanks to you "beaudierman"

#14
[eluser]beaudierman[/eluser]
You're welcome, I'm glad I could help!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.