Welcome Guest, Not a member yet? Register   Sign In
cart library sometimes works, sometimes not
#2

[eluser]cideveloper[/eluser]
Couple of things

1) I assume there is only one book per BOOK_ID so you shouldn't need to do the loop
2) you don't need the first line in addCards function

Code:
function addCards($id=1){
    $query = $this->Kategorie_model->get_books_by_ID($id);
    if($query->num_rows() > 0){
        $item = $query->row();
        $data = array(
            'id'      => $item->BOOK_ID,
            'qty'     => 1,
            'price'   => $item->BOOK_Price,
            'name'    => $item->BOOK_Title
        );
        $this->cart->insert($data);
    }
}

view

Code:
<tr>
        <td class="color"><b>Cena: </b>&lt;?php echo $data->BOOK_Price;?&gt;zł</td><td class="border" id="koszyk" >&lt;?php echo anchor('ksiegarnia/addCards/'.$data->BOOK_ID, 'Koszyk'); ?&gt;</td>
    </tr>
     <tr>

3) what is the datatype for the user_data field in the ci_sessions table where session data is stored.


Messages In This Thread
cart library sometimes works, sometimes not - by El Forum - 01-24-2011, 01:01 PM
cart library sometimes works, sometimes not - by El Forum - 01-24-2011, 04:41 PM
cart library sometimes works, sometimes not - by El Forum - 01-24-2011, 05:05 PM
cart library sometimes works, sometimes not - by El Forum - 01-24-2011, 05:16 PM
cart library sometimes works, sometimes not - by El Forum - 01-24-2011, 05:21 PM
cart library sometimes works, sometimes not - by El Forum - 01-25-2011, 05:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB