Welcome Guest, Not a member yet? Register   Sign In
shoping cart problem
#2

[eluser]suku[/eluser]
Code:
<?php foreach ($this->cart->contents() as $items): ?>

<?php echo form_open('cart/update/'.$items['rowid']); ?>// i need to pass qty as well how to pass????

<?php endforeach;?>
<table cellpadding="4" cellspacing="0" border="1">

<tr>
  <th>Delete_Items</th>
  <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( 'hdrow' . $i, $items['rowid']); ?&gt;
<tr>
<td><a href="&lt;?php echo base_url().'cart/delete/'. $items['rowid'] ;?&gt;">Delete</a></td>
   <td>&lt;?php echo form_input(array('name' => 'row'. $i, 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5','class' => 'num_only')); ?&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>$&lt;?php echo $this->cart->format_number($items['subtotal']); ?&gt;</td>
</tr>

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

&lt;?php endforeach; ?&gt;
<tr>
  <td colspan="2"> </td>
  <td class="right"><strong>Total</strong></td>
  <td class="right">$&lt;?php echo $this->cart->format_number($this->cart->total()); ?&gt;</td>
</tr>

</table>

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

controller //only update function

Code:
function update($rowid,$qty)
  {
  
   $data = array(
                'rowid' => $rowid,
                'qty'   => $qty
             );
   print_r($data);
   exit;

  $this->cart->update($data);
  //redirect('cart/view');
  }


Messages In This Thread
shoping cart problem - by El Forum - 06-28-2012, 03:21 AM
shoping cart problem - by El Forum - 07-08-2012, 09:52 PM
shoping cart problem - by El Forum - 07-09-2012, 01:51 AM
shoping cart problem - by El Forum - 07-09-2012, 03:39 AM
shoping cart problem - by El Forum - 07-09-2012, 03:41 AM
shoping cart problem - by El Forum - 07-09-2012, 03:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB