Sha256: 2968a00b1c5aea1c7a69b6721db453bf5f61b2a6441b19ee5a42eefd723ce69f

Contents?: true

Size: 810 Bytes

Versions: 53

Compression:

Stored size: 810 Bytes

Contents

Spree.Models.Shipment = Backbone.Model.extend({
  idAttribute: "number",
  paramRoot: "shipment",
  urlRoot: Spree.routes.shipments_api,

  relations: {
    "selected_shipping_rate": Backbone.Model,
    "shipping_rates": Backbone.Collection,
  },

  estimatedRates: function() {
    var ratesCollection = Backbone.Collection.extend({
      parse: function(resp){ return resp.shipping_rates }
    });
    var rates = new ratesCollection();
    rates.fetch({ url: this.url() + "/estimated_rates" })
    return rates;
  },

  selectShippingMethodId: function(shippingMethodId, options) {
    this.sync("update", this, _.extend({
      url: this.url() + "/select_shipping_method",
      contentType: 'application/json',
      data: JSON.stringify({ shipping_method_id: shippingMethodId })
    }, options));
  }
})

Version data entries

53 entries across 53 versions & 2 rubygems

Version Path
solidus_backend-2.9.0.rc.1 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.8.4 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.8.3 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.7.2 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.6.4 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.8.2 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.8.1 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.5.1 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.6.3 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.8.0 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.7.1 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend-2.6.2 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend_devise_token_auth-2.8.0.alpha.14 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend_devise_token_auth-2.8.0.alpha.13 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend_devise_token_auth-2.8.0.alpha.12 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend_devise_token_auth-2.8.0.alpha.11 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend_devise_token_auth-2.8.0.alpha.10 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend_devise_token_auth-2.8.0.alpha.9 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend_devise_token_auth-2.8.0.alpha.8 app/assets/javascripts/spree/backend/models/shipment.js
solidus_backend_devise_token_auth-2.8.0.alpha.7 app/assets/javascripts/spree/backend/models/shipment.js