Welcome Guest, Not a member yet? Register   Sign In
Cart Class
#5

[eluser]the_unforgiven[/eluser]
Basically using what is stated in the manual:

Code:
<?php echo form_open('home/update_cart'); ?>
<?php if ($this->session->flashdata('message')) { ?>
<div class="success">&lt;?php echo $this->session->flashdata('message'); ?&gt;</div>
&lt;?php } ?&gt;

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

<tr>
   <th>QTY</th>
   <th>Item Description</th>
   <th>Item Price</th>
   <th>Sub-Total</th>
</tr>
&lt;?php $i = 1; ?&gt;

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

  &lt;?php echo form_hidden($i.'[rowid]', $items['rowid']); ?&gt;

  <tr>
    <td>&lt;?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?&gt;</td>
    <td>
   &lt;?php echo $items['name']; ?&gt;

    &lt;?php if ($this->cart->has_options($items['rowid']) == TRUE): ?&gt;

     <p>
      &lt;?php foreach ($this->cart->product_options($items['rowid']) as $option_name => $option_value): ?&gt;

       <strong>&lt;?php echo $option_name; ?&gt;:</strong> &lt;?php echo $option_value; ?&gt;<br />

      &lt;?php endforeach; ?&gt;
     </p>

    &lt;?php endif; ?&gt;

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

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

&lt;?php endforeach; ?&gt;

  &lt;?php //var_dump($this->input->post('rowid')); ?&gt;

<tr>
   <td></td>
   <td><strong>Total</strong></td>
   <td>&pound;&lt;?php echo $this->cart->format_number($this->cart->total()); ?&gt;</td>
</tr>

</table>

<p>&lt;?php echo form_submit('', 'Update Cart'); ?&gt;</p>

Which then goes to what I originally posted.


Messages In This Thread
Cart Class - by El Forum - 05-09-2012, 04:41 AM
Cart Class - by El Forum - 05-09-2012, 05:47 AM
Cart Class - by El Forum - 05-09-2012, 06:03 AM
Cart Class - by El Forum - 05-09-2012, 06:15 AM
Cart Class - by El Forum - 05-09-2012, 06:40 AM
Cart Class - by El Forum - 05-09-2012, 06:41 AM
Cart Class - by El Forum - 05-09-2012, 06:53 AM
Cart Class - by El Forum - 05-09-2012, 06:58 AM
Cart Class - by El Forum - 05-09-2012, 07:00 AM
Cart Class - by El Forum - 05-09-2012, 07:03 AM
Cart Class - by El Forum - 05-09-2012, 07:07 AM
Cart Class - by El Forum - 05-09-2012, 07:10 AM
Cart Class - by El Forum - 05-09-2012, 07:14 AM
Cart Class - by El Forum - 05-09-2012, 07:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB