Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New package with improved cart performance #344

Open
izyy123 opened this issue Aug 19, 2022 · 0 comments
Open

New package with improved cart performance #344

izyy123 opened this issue Aug 19, 2022 · 0 comments

Comments

@izyy123
Copy link

izyy123 commented Aug 19, 2022

Hello everybody,

when using an otherwise excellent library, I noticed that all changes to the shopping cart are immediately saved in the storage (session, database etc). The storage is also called e.g. when calling the getSubTotal() method, etc. - although in my opinion this is basically not necessary at all. As a result, the database can be completely unnecessarily overloaded (in my case, more than 30 myql queries were executed!). I changed the library a bit and created a new one. I would be happy if you could install and test it. I am definitely ready to implement all the changes in the basic library, but since the syntax has changed a bit and the new library is not 100% compatible with the basic one, I decided to create a new one.

Package - https://github.com/izyy123/laravelshoppingcart, https://packagist.org/packages/izyy123/cart

Only 3 commits are important - ebc873b
ebc873b
8b69405

Basically there are only two changes. Using session() method to set user key is mandatory and I implemented new save() method witch should be called whenever you want to save the cart into storage.

Comments are welcome. General about the performance of the core library and my updates.

Greetings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant