CodeIgniter Forums
Annoying problem with Cart - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Annoying problem with Cart (/showthread.php?tid=41565)



Annoying problem with Cart - El Forum - 05-11-2011

[eluser]eokorie[/eluser]
Anyone having a serious problem with the CI Cart library? Before it gets mentioned, yes i did search the forums for every conceivable solution to my current problem and I cant think of why products are not being inserted.

Take the code below:

Code:
$data = array(
                    'id' => "1234abcd",
                    'quantity' => 1,
                    'price' => 10.95,
                    'name' => "Test Product (small)",
                    'options' => '',
                );



        //var_dump($data);

        $result = $this->cart->insert($data);
var_dump($this->cart->contents());

I have enabled logging and I get this error:

Code:
ERROR - 2011-05-11 10:04:20 --> The cart array must contain a product ID, quantity, price, and name.

Now this is what's weird, if I change id from small caps to uppercase, the error disappears but the item is still not being added to the cart. No errors are thrown up either. And my cart content remain empty.

Does anyone have an idea whats going on?

Thanks


Annoying problem with Cart - El Forum - 05-11-2011

[eluser]eokorie[/eluser]
I really need to start having my eyes checked.... quantity should be qty...
all fixed now..