Welcome Guest, Not a member yet? Register   Sign In
A simple problem with CodeIgniter Cart Library
#1

[eluser]dojolab[/eluser]
Hello, I have e simple problem with CodeIgniter Cart Library; this is my 'add' method of my Cart Controller.
Code:
function add() {
                            
    // CART ID (FOR DB STORAGE)
    if($this->session->userdata('cart_sid') == FALSE) {
        
        $cart_sid = md5(time()); // cart id.

       $data = array(
            
            'cart_sid'    =>    (string) $cart_sid
        );

        $this->session->set_userdata($data);
    }
    

    $data =
                array(
    
                'id'    =>    (string) $this->input->post('product_code'),
                'qty'    =>    (int) $this->input->post('product_quantity'),
                'price'    =>    (float) $this->input->post('product_price'),
                'name'    =>    (string) $this->input->post('product_name')

        );

    $this->cart->insert($data);

}

Where is the problem?

When I added the FIRST product/item to cart there is no problem.
When I added the SECOND product/item to cart (by add method), the item is not inserted...
Why? The POST debug works correctly!

Thanks for reply!


Messages In This Thread
A simple problem with CodeIgniter Cart Library - by El Forum - 11-03-2010, 01:39 AM
A simple problem with CodeIgniter Cart Library - by El Forum - 11-03-2010, 10:32 AM
A simple problem with CodeIgniter Cart Library - by El Forum - 11-03-2010, 12:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB