Sha256: 8d7d284ed5e01ae50c3f91f30d87ea24d13d892fb49bb9a4a51b05b6e808f3b9

Contents?: true

Size: 1.35 KB

Versions: 91

Compression:

Stored size: 1.35 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.Cart.EmptyCartButton({
    el: $('.js-empty-cart'),
    collection: collection,
    model: order
  });

  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({});
    }
  })
}

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

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
solidus_backend-4.4.2 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.4.1 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.4.0 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.3.4 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.2.4 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.1.5 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.3.3 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.3.2 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.1.4 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.3.1 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.3.0 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.2.3 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.1.3 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.0.4 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-3.4.6 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.0.3 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.1.2 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.2.2 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-3.4.5 app/assets/javascripts/spree/backend/orders/cart.js
solidus_backend-4.2.1 app/assets/javascripts/spree/backend/orders/cart.js