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

Cart post with editable quantities fails when >1 qty is changed #39

Open
SysPete opened this issue Nov 12, 2014 · 2 comments
Open

Cart post with editable quantities fails when >1 qty is changed #39

SysPete opened this issue Nov 12, 2014 · 2 comments

Comments

@SysPete
Copy link
Member

SysPete commented Nov 12, 2014

@murwiz added this to issue #25:

Along the same lines: from a cart display page, where multiple items have an editable quantity field, there should be a way to update more than one of them. Right now you get something like:

isa check for "quantity" failed: ARRAY(0xaf1d1f8) is not a positive numeric. at (eval 1538) line 104.

@murwiz
Copy link

murwiz commented Nov 13, 2014

I was asked to provide a sample POST here. This is from a cart display page ("basket") where three items are in the cart, and we want to update more than one of them.

quantity 2
quantity 1
quantity 2
sku 112
sku 2001
sku 900
update.x 34
update.y 11
update_quantities 1

@SysPete
Copy link
Member Author

SysPete commented May 12, 2015

We cannot use simple post data with quantity and sku defined multiple times since this fails if the user deletes the value in the 1st quantity field resulting in one fewer quantity field compared to sku. To handle this we need to use input names for the quantity fields which include sku like quantity[sku] so the posted form would then include params so:

quantity[112] = 2
quantity[ADC87] = 3

This is sadly a fail for us long-term since we also want to be able to have a single sku added multiple times and not combined together in the cart (interchange/Interchange6#13).
Perhaps this could be handled using Cart::Product->id since we fill this attribute from the database on cart load; so for id 763 and quantity 4 we'd have quantity[763] = 4.
@racke thoughts?

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