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