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

¿How can I prevent the items in the cart from changing position? #367

Open
alquialrium opened this issue Jul 25, 2023 · 3 comments
Open

Comments

@alquialrium
Copy link

How can I prevent the items in the cart from changing position when I change the quantity of a product?

I think they are ordered according to the update and put them below, but I don't know where I can modify it.

@gantira
Copy link

gantira commented Sep 13, 2023

i use orderBy id to prevent changing position

@imnhasan
Copy link

i use orderBy id to prevent changing position

How to make this one orderBy

$cartItem = \Cart::session($this->userId)->getContent();

@imnhasan
Copy link

I have a solution to do that, you can also try this way.

$cartItem = \Cart::session($userId)->getContent()->sortKeysDesc();

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

3 participants