You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
cart() helper hit database query every time.
example: protected function getCartDetails() { return [ 'items' => cart()->items($displayCurrency = true), 'totals' => cart()->totals(), ]; }
This function will hit database multiple times. To Reproduce
Steps to reproduce the behavior:
Clone demo
Install debugbar
We will see duplicate query
Expected behavior
No duplicate query during request
Screenshots
Additional context
Suguest fix: Change bind to singleton in CartManagerServiceProvider
The text was updated successfully, but these errors were encountered:
As per the current code status, the downside is that the items are not updated in the Cart object array resulting in data inconsistencies. To solve the DB queries issue, we will need to update some parts of the code.
Describe the bug
cart() helper hit database query every time.
example:
protected function getCartDetails() { return [ 'items' => cart()->items($displayCurrency = true), 'totals' => cart()->totals(), ]; }
This function will hit database multiple times.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No duplicate query during request
Screenshots
Additional context
Suguest fix: Change bind to singleton in CartManagerServiceProvider
The text was updated successfully, but these errors were encountered: