Crinsane / LaravelShoppingcart

A simple shopping cart implementation for Laravel
MIT License
3.67k stars 1.73k forks source link

Problem with multiple instance of Cart #34

Closed mdeprezzo closed 10 years ago

mdeprezzo commented 10 years ago

Hi guys, i've a problem i these last few days. I dont know why. But when i try to use multiple instance of cart the last new goes to overwritten by first instance and i dont understand why this happened. Maybe i just add the new package with new methods ?

Crinsane commented 10 years ago

I really need more information to know what's wrong. What code do you use, what goes wrong, how can I reproduce this?

mdeprezzo commented 10 years ago

I was using Cart::instance('main') and Cart::instance('accessory') but for some reasons doesn't works. And now i've decided to use Cart::instance('cart') instead Cart::instance('main') and now works well.

Now i've question. What's is the lifetime of Cart instance. Its use a forever cookie ? I dont know if you understand me. I mean, i need to have stored the content of Cart instance for more while the user not logged in. Like the most part the e-commerce you know what i mean ?

Crinsane commented 10 years ago

The main instance is the default instance. So when you haven't set the instance on a request, Cart::instance('main') will be used. So maybe somewhere you're not setting the instance correctly. But I can't know for sure without a code example.

The packages uses the normal session from Laravel, so whatever you've set in the session.php config will be how the session behind the cart will work.

mdeprezzo commented 10 years ago

Ok understood. But this package is based on cartfy package? Il 14/mar/2014 11:28 "Rob Gloudemans" notifications@github.com ha scritto:

The main instance is the default instance. So when you haven't set the instance on a request, Cart::instance('main') will be used. So maybe somewhere you're not setting the instance correctly. But I can't know for sure without a code example.

The packages uses the normal session from Laravel, so whatever you've set in the session.php config will be how the session behind the cart will work.

Reply to this email directly or view it on GitHubhttps://github.com/Crinsane/LaravelShoppingcart/issues/34#issuecomment-37634127 .

mdeprezzo commented 10 years ago

I have another strange problem. Sometimes i get an error like 'unserialized offset from session' it depend from php.ini configuration?

Crinsane commented 10 years ago

@Mdpproduction No, this packages is not based on the cartfy package, don't even know that packages actually ;) It's at it's very base, based on the CodeIgniter Cart Library, but that's about it.

Again, without some code samples, I can't help you with your problems. You've given me nothing to work with, no way to reproduce your problem.

mdeprezzo commented 10 years ago

Ok next time i add some code. For now works well. Thanks for your support. Il 15/mar/2014 16:32 "Rob Gloudemans" notifications@github.com ha scritto:

@Mdpproduction https://github.com/Mdpproduction No, this packages is not based on the cartfy package, don't even know that packages actually ;) It's at it's very base, based on the CodeIgniter Cart Library, but that's about it.

Again, without some code samples, I can't help you with your problems. You've given me nothing to work with, no way to reproduce your problem.

Reply to this email directly or view it on GitHubhttps://github.com/Crinsane/LaravelShoppingcart/issues/34#issuecomment-37728728 .