Welcome Guest, Not a member yet? Register   Sign In
CART Content not passing in VIEW
#2

[eluser]include[/eluser]
Try something like this in your view, it loops through each item in the cart array and displays it;

Code:
<?php
If (!$this->cart->contents()){
    echo '<p class="cart_empty">You don\'t have any items yet.</p>';
}
else { ?&gt;

<table class="quickcart" cellpadding="6" cellspacing="1"  border="0">

&lt;?php $i = 1; ?&gt;

&lt;?php foreach ($this->cart->contents() as $items): ?&gt;

  <tr>
    <td>&lt;?php echo $items['qty']; ?&gt;</td>
    <td>&lt;?php echo $items['name']; ?&gt;</td>
    <td>&lt;?php echo $this->cart->format_number($items['price']); ?&gt;</td>
    <td>£&lt;?php echo $this->cart->format_number($items['subtotal']); ?&gt;</td>
  </tr>

&lt;?php $i++; ?&gt;

&lt;?php endforeach; ?&gt;

</table>
&lt;?php } ?&gt;

Just doing our first app that uses the cart functions so had a bit of fun with it recently!


Messages In This Thread
CART Content not passing in VIEW - by El Forum - 04-23-2014, 01:09 PM
CART Content not passing in VIEW - by El Forum - 04-23-2014, 01:18 PM
CART Content not passing in VIEW - by El Forum - 04-23-2014, 01:33 PM
CART Content not passing in VIEW - by El Forum - 04-23-2014, 03:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB