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

Bugfix: Removing all items from cart (Commerce Lite) #639

Closed

Conversation

luke-nehemedia
Copy link

@luke-nehemedia luke-nehemedia commented Jan 21, 2019

Fixes an issue where removing the last item from the cart would cause an error:

Undefined offset: 0 in /craft/vendor/craftcms/commerce/src/elements/Order.php

This would only happen in the Lite-Version, since it is limited to one item in the cart.

Checking at first, whether $lineItems has at least one item, before running array_slice(), fixes the issue.

Fixes an issue where removing the last item from a cart would cause an error due to "Undefined offset: 0"
@lukeholder
Copy link
Member

Thanks. This was fixed in 94aa300

@lukeholder lukeholder closed this Jan 24, 2019
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

Successfully merging this pull request may close these issues.

2 participants