I'm trying to use ajax for a one-page checkout, I'...
# support
g
I'm trying to use ajax for a one-page checkout, I've tried a couple approaches, but can't manage to get it working: • I set it to use the same target as the normal form (
/checkout/update/address
) but it yells at me about a missing order parameter. I've tried sending the order id and number, but that didn't seem to be what it needed (and it doesn't appear that the original form passed any order info, I'm assuming it's pulling the
@order
object that just isn't there in the ajax call) • I looked through the routes and saw the API route for order addresses (
/api/checkouts/:checkout_id/addresses/:id
), but that doesn't seem to work without the address id, which doesn't exist on a new order, so I get a 404 returned on the route without it. I guess I'm just not even sure at this point how I should be approaching it. The 2 ways to do it that I can think of both seem to not want to play nicely with what I'm doing. Will I need to do some customizations on the back end or am I just missing something on the ajax side? Thanks!
e
https://github.com/solidusio/solidus/blob/master/core/lib/spree/core/controller_helpers/order.rb#L65 that's how Solidus finds the current order, not sure if the cookie is being lost somewhere in your ajax flow
g
You know what, I've been staring at this so long I had completely forgotten about cookies... I'll do that now.