Welcome Guest, Not a member yet? Register   Sign In
[ASK] limit item cart
#2

[eluser]jshot[/eluser]
My insert DB

Code:
INSERT INTO `part_mobil` (`no`, `kode_part`, `merk_mobil`, `kode_mobil`, `kategori`, `gambar`, `nama`, `keterangan`, `part_number`, `type`, `stok`, `harga`, `tgl_input`) VALUES
(41, '118b5f485617ad8d4864c08a48061a3c', 'KIA', 'CEED', 'Spareparts', '6.JPG', 'ceed sp', 'sedyset', 'ssp2', '3rw', 5, 500002, '03 November 2009 - 18:31:42'),
(42, 'e222b294c0d4d8e44e1b06c82ffec30d', 'KIA', 'SPECTRA', 'Exteriors', '4.JPG', 'spect', '45622', 'rt5422', 'se45y22', 50222, 20000221, '03 November 2009 - 18:32:22'),
(43, 'f44f297b37d1ef8fb582e48ed322eff4', 'KIA', 'FORTE', 'Wheel', '3.JPG', 'velg 19', 'velg aa bb cco', '192254o2', 'rimm22o', 1602, 250022, '03 November 2009 - 18:42:17'),
(44, 'a4efd0901c0051d5e1cb357698b9203e', 'HONDA', 'ACCORD', 'Spareparts', '9hq1pc.jpg', 'lampu spion accord', 'aa3', 'aa2', 'aa4', 2, 50000, '03 November 2009 - 21:13:17'),
(51, 'a5987d332a332b1b4fa99257f72ab860', 'KIA', 'CARENS', 'Spareparts', 'Vector_Wallpapers_by_mneti__61_.jpg', 'sdgh', 'asgsdf', 'hgfh', 'rty', 8, 345231, '04 November 2009 - 20:32:01'),
(35, 'ef3efc883935571f210c33aac44f6bc9', 'KIA', 'CEED', 'Engine', '02va8.jpg', 'fsad', 'w23rw', 'ghd', 'ewrt', 23, 23234, '03 November 2009 - 18:05:23'),
(46, 'c048749492430808b43e07c6a80c205b', 'HONDA', 'ACCORD', 'Wheel', 'Slide131.JPG', 'velg 20', 'ydtyj', 'asdf', 'ewrt', 10, 750000, '03 November 2009 - 21:28:07'),
(50, '9f3ae09ecd8194d91e317c9fc28e4c7b', 'KIA', 'CARENS', 'Spareparts', '015583277.jpg', 'spareparts carens', 'sfvbs', '123', '432', 4, 443322, '04 November 2009 - 20:30:58'),
(52, '8336523715e2f5c61cd78c07d53592d8', 'KIA', 'CARENS', 'Spareparts', '1ibxv6.jpg', 'ersatz', 'uhluyiyuil" kj\n', '345', 'tyfddu', 456, 67676, '04 November 2009 - 20:32:33'),
(53, 'a0c6804bb70ad87b1f55a15bf6bbc15b', 'KIA', 'CARENS', 'Spareparts', '2h7klyb.jpg', 'uyiyujf', 'guikgyik" d sdf sdf sdf dsf sdf sdf sdf sdf sdf sd f', '67', '7676', 60, 686868, '04 November 2009 - 20:33:31'),
(56, '00e632cf17c4f2ce34e177ba517aee88', 'HONDA', 'CRV', 'Exteriors', '2ngegs4.jpg', 'afgsdg', 'sdfgsdfg sdf asdf sdf', 'dsfgsdfg', 'sdfg', 43, 3433, '05 November 2009 - 01:38:40');

Code:
function show_cart()
        {
            if( $this->cart->contents() != NULL )
            {
             //$this->load->view('public/shop/cart');
                ?>
                <?php echo form_open('shop/update_cart'); ?>

                 <table cellpadding="6" cellspacing="1" style="width:100%" border="0">
                <p>&lt;?php echo anchor('shop', 'Continue Shopping'); ?&gt;</p>
                <tr>
                  <th width="50">Jumlah</th>
                  <th>Nama Part</th>
                  <th style="text-align:right">Harga Satuan</th>
                  <th style="text-align:right">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' => '5', 'size' => '5' , 'style' => 'border:solid 1px #000000;'  )); ?&gt;</td>
                    <td>
                        &lt;?php echo $items['name']; ?&gt;
                        &lt;?php if ($this->cart->has_options($items['rowid']) == TRUE): ?&gt;
                        (
                            &lt;?php foreach ($this->cart->product_options($items['rowid']) as $option_name => $option_value): ?&gt;
                              &lt;?php echo $option_value; ?&gt;              
                            &lt;?php endforeach; ?&gt;
                        )
                        &lt;?php endif; ?&gt;    
                    </td>
                    <td style="text-align:right">Rp &lt;?php echo $this->cart->format_number($items['price']); ?&gt;</td>
                    <td style="text-align:right">Rp &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 style="text-align:right; background:#999999;"><strong>Total</strong></td>
                  <td style="text-align:right; background:#999999;">Rp &lt;?php echo $this->cart->format_number($this->cart->total()); ?&gt;</td>
                </tr>
                
                </table>
                
                <p>&lt;?php echo form_submit('', 'Update your Cart'); ?&gt;</p>
                &lt;?php
            }
            else
            {
                echo "Data belum ada!";
            }
        }
        
        function clear_cart()
        {
                $this->cart->destroy();
                redirect('shop');
        }
        
}

when I add many data to cart, it just limited 4 datas session from my DB


Messages In This Thread
[ASK] limit item cart - by El Forum - 12-02-2009, 10:44 AM
[ASK] limit item cart - by El Forum - 12-02-2009, 10:46 AM
[ASK] limit item cart - by El Forum - 01-12-2010, 02:57 PM
[ASK] limit item cart - by El Forum - 01-12-2010, 04:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB