Sha256: 4ceec546c12e4ee6d3d73d5fbc8220c1be1a60302ba806f40f9aeef8c3993d9e

Contents?: true

Size: 1.05 KB

Versions: 287

Compression:

Stored size: 1.05 KB

Contents

Caboose.Store.Modules.CheckoutShipping = (function() {
    
  self = {};
   
  self.initialize = function() {                
    self.bind_event_handlers();
  };
  
  self.bind_event_handlers = function() {
    $('a.shipping_rate').click(self.shipping_click_handler);    
  };

  self.shipping_click_handler = function(event) {
    event.preventDefault();
    $('#message').html("<p class='loading'>Saving information...</p>");            
    $.ajax({
      url: '/checkout/shipping',
      type: 'put',      
      data: { 
        order_package_id:   $(event.target).data('order_package_id'),
        shipping_method_id: $(event.target).data('shipping_method_id'),
        total:              $(event.target).data('total')
      },
      success: function(resp) {
        if (resp.errors && resp.errors.length > 0)
          $('#message').html("<p class='note error'>" + resp.errors[0] + "</p>");
        else if (resp.success)
          window.location = '/checkout/gift-cards';        
      }
    });
    return false;
  };
    
  return self
}).call(Caboose.Store);

Version data entries

287 entries across 287 versions & 1 rubygems

Version Path
caboose-cms-0.7.85 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.84 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.83 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.82 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.81 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.80 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.79 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.78 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.77 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.76 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.75 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.74 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.73 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.72 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.71 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.70 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.69 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.68 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.67 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.7.66 app/assets/javascripts/caboose/checkout_shipping.js