multi-add icon indicating copy to clipboard operation
multi-add copied to clipboard

Update options on updateCart

Open skogendev opened this issue 8 years ago • 10 comments

After some testing, it seems it's not possible to update options on updateCart method. I'm testing with your simple example:

<form method="POST">
    <input type="hidden" name="action" value="multiAdd/updateCart">
    <input type="hidden" name="redirect" value="/cart">
    {{ getCsrfInput() }}
    {% for item in cart.lineItems %}
      <input type="text" size="4" name="items[{{ item.id }}][qty]" value="{{ item.qty }}">
      <input type="text" size="4" name="items[{{ item.id }}][options][giftWrap]" value="{{ item.options.giftWrap }}">
    {% endfor %}
    <button type="submit">Update Cart</button>
</form>

Quantities update fine, but options remain unchanged.

skogendev avatar Jun 13 '17 10:06 skogendev

@engram-design Yeah think you missed the other stuff here maybe - https://github.com/engram-design/MultiAdd/blob/master/multiadd/controllers/MultiAddController.php#L119 ? Seems to only do qty.

I don't use this one so no quick way to test any fix, would you mind fleshing it out?

bossanova808 avatar Jun 14 '17 00:06 bossanova808

We're also a bit behind on releases here...maybe I will do one after you do the above - I've been using the changed db stuff on production for ages now, no issues so that's good to go

bossanova808 avatar Jun 14 '17 00:06 bossanova808

@bossanova808 Will advise shortly.

engram-design avatar Jun 14 '17 04:06 engram-design

Any progress? Would be good to get the latest chages out as they do seem to fix the potential race condition in multi-add

bossanova808 avatar Jun 27 '17 01:06 bossanova808

Yes, an update or progress would be greatly appreciated. Will there be a fix for this in the near-ish future?

skogendev avatar Jul 03 '17 08:07 skogendev

Added in the latest master.

engram-design avatar Jul 03 '17 11:07 engram-design

Appreciate the plugin—seems like this update came just in the nick of time for me. Just wanted to point out that the updateCart action doesn't check for AJAX to respond with JSON.

wfifer avatar Jul 07 '17 01:07 wfifer

I'm not sure on Josh but I'm very busy right now - but it would be easy enough for you to PR @wfifer if you just crib the ajax approach from the add function immediately above the update function....

bossanova808 avatar Jul 07 '17 01:07 bossanova808

@wfifer We'll sort that out in the next few days.

engram-design avatar Jul 07 '17 02:07 engram-design

@engram-design bump fella :)

bossanova808 avatar Aug 15 '17 08:08 bossanova808