Welcome Guest, Not a member yet? Register   Sign In
Shopping Cart Issue
#1

[eluser]alejandronanez[/eluser]
Hi how are you?

I'm having a problem with my shopping cart class, when I add Items the cart didn't add the first item, it adds everything from the second item.

Can u help me with this?

I'm using the latest version of CI.

Here's my code.

My controller method.
Code:
public function agregar()
    {
        $data = array(
                    'id'    => $this->input->post('id_pack'),
                    'name'  => $this->input->post('nombre_pack'),
                    'qty'   => $this->input->post('cantidad'),
                    'price' => $this->input->post('precio'),
                    'options' => array('tipo_compra' => $this->input->post('tipo_producto'))
                );
                
        $this->cart->insert($data);
        echo 'Item agregado al carrito';
        echo '<pre>';
        print_r($data);
        echo '</pre>';
    }




Theme © iAndrew 2016 - Forum software by © MyBB