Sha256: 6cc12d24ccb5c9b248c8a6bd988b8d7328708f2770fd0310da1524110dce1104

Contents?: true

Size: 1.22 KB

Versions: 16

Compression:

Stored size: 1.22 KB

Contents

Spree.Order || (Spree.Order = {})

Spree.Order.initCartPage = function(order_number) {
  var order = new Spree.Models.Order.fetch(order_number)
  var collection = order.get("line_items")

  new Spree.Views.Order.Summary({
    el: $('#order_tab_summary'),
    model: order
  });

  new Spree.Views.Cart.LineItemTable({
    el: $("table.line-items > tbody"),
    collection: collection
  });

  new Spree.Views.Cart.AddLineItemButton({
    el: $('.js-add-line-item'),
    collection: collection
  });

  new Spree.Views.Order.DetailsTotal({
    el: $('#order-total'),
    model: order
  });

  new Spree.Views.Order.DetailsAdjustments({
    el: $('.js-order-line-item-adjustments'),
    model: order,
    collection: order.get("line_items")
  });

  new Spree.Views.Order.DetailsAdjustments({
    el: $('.js-order-shipment-adjustments'),
    model: order,
    collection: order.get("shipments")
  });

  new Spree.Views.Order.DetailsAdjustments({
    el: $('.js-order-adjustments'),
    model: order
  });

  order.on("sync", function() {
    if(!collection.length) {
      collection.push({});
    }
  })
}

$(function() {
  if ($(".js-order-cart-page").length) {
    Spree.Order.initCartPage($(".js-order-cart-page").data("order-number"));
  }
});

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
solidus_backend-2.4.2 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.4.1 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.3.1 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.2.2 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.4.0 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.4.0.rc1 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.4.0.beta1 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.3.0 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.3.0.rc3 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.3.0.rc2 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.3.0.rc1 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.3.0.beta1 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.2.1 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.2.0 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.2.0.rc1 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-2.2.0.beta1 app/assets/javascripts/spree/backend/orders/cart.js