Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if(!$this->cart->contents()){
- echo 'There are no items in your cart.';
- } else {
- ?>
- <?php echo form_open('pnp/update_cart'); ?>
- <table id="cart_table">
- <thead>
- <tr>
- <td class="titles" >Qty</td>
- <td class="titles" >Item Description</td>
- <td class="titles" >Item Price</td>
- <td class="titles" >Sub-Total</td>
- </tr>
- </thead>
- <tbody>
- <?php $i = 1; ?>
- <?php foreach($this->cart->contents() as $items): ?>
- <?php echo form_hidden('rowid[]', $items['rowid']); ?>
- <tr <?php if($i&1){ echo 'class="alt"'; }?>>
- <td>
- <?php echo form_input(array('name' => 'qty[]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '2')); ?>
- </td>
- <td><?php echo $items['name']; ?></td>
- <td>$<?php echo $this->cart->format_number($items['price']); ?></td>
- <td>$<?php echo $this->cart->format_number($items['subtotal']); ?></td>
- </tr>
- <?php $i++; ?>
- <?php endforeach; ?>
- <tr>
- <td> </td>
- <td> </td>
- <td><strong>Total</strong></td>
- <td>$<?php echo $this->cart->format_number($this->cart->total()); ?></td>
- </tr>
- </tbody>
- </table>
- <p id="buttons" >
- <?php
- echo form_submit('', 'Update Cart')."\n";
- //echo anchor('pnp/empty_cart', 'Empty Cart', 'class="empty"')."\n";
- ?>
- <button onclick="document.location.href='<?php echo base_url(); ?>pnp/empty_cart'; return false;" class="empty">Empty Cart</button>
- </p>
- <p><small>If the quantity is set to zero, the item will be removed from the cart.</small></p>
- <button onclick="document.location.href='<?php echo base_url(); ?>chout'; return false;" class="empty">Check Out</button>
- <?php
- echo form_close();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement