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

Added call to $store->save() method which triggers saveCart() #29

Closed
wants to merge 1 commit into from
Closed

Added call to $store->save() method which triggers saveCart() #29

wants to merge 1 commit into from

Conversation

alexrayan
Copy link

Item updating is not working in laravel-cart due to the fact that there is no call to saveCart() method following update item methods (either in Cart or in Item) which leads to the updates being lost next time Cart __construct() is being called.
Added call to $store->save() method which triggers saveCart() in persistent storage (mainly for laravel-cart) on cart item update (from within Cart model and from Item model). Added an empty public save() method to Runtime storage for reference.

…istent storage on cart item update (from within Cart model and from Item model). Added an empty public save() method to Runtime storage for reference
@alexrayan alexrayan closed this Sep 16, 2015
@alexrayan
Copy link
Author

There is a better way of fixing the item update not saving issue by adding:

$this->store->insertUpdate($this);
to the update() method in Item.

This, however, wouldn't fix the issue of item not updating in the following case:

Cart::item($id)->price = 1;

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

Successfully merging this pull request may close these issues.

None yet

1 participant