[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!
);