Welcome Guest, Not a member yet? Register   Sign In
Odd Cart Behavior
#11

[eluser]Matalina[/eluser]
try this:

Code:
if ($this->input->post('free_nail')) {
        $price = '0.00'; // price is set here <---- make a string here
        $this->session->set_userdata('free_nail', TRUE);
    } elseif ($this->input->post('free_tanktop')) {
        $price = '0.00'; // price is set here <---- make a string here
        $this->session->set_userdata('free_tanktop', TRUE);
    } else {
        $price = (float)$this->Cart_model->getProductPrice($this->input->post('id')); // <--- type case to float here
    }
    $data = array(
        'id'    => $this->input->post('id'),
        'name'  => str_replace('/', '-',$this->input->post('name')),
        'qty'   => (int)$this->input->post('quantity'),
        'price' => $price // <---- remove type cast here!  It's changing your strings to floats!
    );
#12

[eluser]RMinor[/eluser]
That worked! Thank you so much, I really appreciate your help.




Theme © iAndrew 2016 - Forum software by © MyBB