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

Delivery partial not included because ajax function arguments are blank. #62

Open
prdanelli opened this issue May 15, 2018 · 0 comments

Comments

@prdanelli
Copy link

prdanelli commented May 15, 2018

Delivery partial is not included as data is an empty object:

address.html.erb

  $('#continue_to_delivery').on('ajax:success', function(evt, data, status, xhr){
    $("#deliveryOptionDiv").html(data);
  }).bind("ajax:error", function(evt, data, status, xhr){
    $("div#errors p").text(data);
  });

I fixed this by removing all arguments and using the evt's original event:

  $('#continue_to_delivery').on('ajax:success', function(evt){
    $("#deliveryOptionDiv").html(evt.originalEvent.detail[2].responseText);
  }).bind("ajax:error", function(evt){
    $("div#errors p").text(evt.originalEvent.detail[2].responseText);
  });

Gemlock:

GIT
  remote: https://github.com/boomerdigital/solidus_amazon_payments.git
  revision: 8d3082ec608077ecb5e1a9cd738800f606ad8c6d
  specs:
    solidus_amazon_payments (1.0.0)
      pay_with_amazon (~> 1.1)
      solidus (>= 1.2.0, < 3)
      solidus_support

solidus (2.4.2)
  solidus_api (= 2.4.2)
  solidus_backend (= 2.4.2)
  solidus_core (= 2.4.2)
  solidus_frontend (= 2.4.2)
  solidus_sample (= 2.4.2)
@prdanelli prdanelli changed the title Delivery partial not included because function arguments are blank. Delivery partial not included because ajax function arguments are blank. May 15, 2018
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

1 participant