Welcome Guest, Not a member yet? Register   Sign In
Email shopping cart
#1

[eluser]Perkin5[/eluser]
I want to be able to email the contents of a shopping cart to a customer. I've come up with the following code to embed the cart data in a form but codeigniter is throwing an error. Am I doing this the right way?

Code:
<div>
&lt;?php echo form_open('shop/send'); ?&gt;
&lt;?php echo form_input('to''To: website.co.uk') ?&gt;
&lt;?php echo form_textarea("","
if ($cart = $this->cart->contents()): ?&gt;
<table>
<thead>
<tr>
    <th>Item Name</th>
    <th>Quantity</th>
    <th>Price</th>
    <th></th>
</tr>
</thead>
&lt;?php foreach ($cart as $item): ?&gt;
<tr>
    <td>&lt;?php echo $item['name']; ?&gt;</td>
    <td>&lt;?php echo $item['qty']; ?&gt;</td>
    <td>£&lt;?php echo $item['subtotal']; ?&gt;</td>
</tr>
&lt;?php endforeach; ?&gt;
<tr>
   <td colspan="2"><strong>Total</strong></td>
   <td>£&lt;?php echo $this->cart->total(); ?&gt;</td>
</tr>
</table>
&lt;?php  endif;?&gt;
&lt;?php "); ?&gt;
&lt;?php echo form_close(); ?&gt;
</div>




Theme © iAndrew 2016 - Forum software by © MyBB