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 to retrieve items from a cart? #37

Open
ghost opened this issue Jul 22, 2015 · 4 comments
Open

How to retrieve items from a cart? #37

ghost opened this issue Jul 22, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Jul 22, 2015

I have added several products in the cart. But I want to get the list of all added products back during a confirmation stage. Kindly help me to get array of all the added products in the cart

@emaiax
Copy link
Contributor

emaiax commented Jul 22, 2015

@cart.shopping_cart_items.map(&:item) should do the trick, right?

@ghost
Copy link
Author

ghost commented Jul 22, 2015

no, I have tried this. It gives me no method defined error

@emaiax
Copy link
Contributor

emaiax commented Jul 22, 2015

@zaingz can you provide some sample? tks!

@spchetan11
Copy link

spchetan11 commented Sep 30, 2016

items = @shopping_cart.shopping_cart_items items.each do |item| item.item_id item.quantity end

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

2 participants