caboose-cms 0.8.9 → 0.8.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28c0750a57c12214286a268e2b837657b70e0995
4
- data.tar.gz: 05f95bfca9e99254b0ef9441b1db56adacb84051
3
+ metadata.gz: 8c9634c46690b5c4bc5137344dfd466e183bc620
4
+ data.tar.gz: fddf702fa8d24cf49dbdadd308aef2e060944dc9
5
5
  SHA512:
6
- metadata.gz: dd29a6f11f1958c9775c51a0460930c146ae3a7cb56874b8bfbab2937ced64b8883c8777fdff9649a0bfe310c22cfffe71f80b3d75a4a93bc00212d54c5404fd
7
- data.tar.gz: 68b0968b3bbce3626c27cf9403f655fdeb0afb6475d8865d28358e14339cc64d2562d0244c5369816c17872688b97bf6a801aa83c046876fd32d3e7f17dc66e4
6
+ metadata.gz: 64d087ac2a8fb52977dc2ed22c1aeab5393140f239e9792c74699eb5f8a740d853c3b43627bd50e0c1bd3ecf0f71966fb966b3e5ac7e8de2144f6fa2b757e65a
7
+ data.tar.gz: 5557ee652c97763cfbd1711519cf4dad40a1eeb0f98d7cc26d6c264c77cfe001e50e4548dd27da31ab861952ce4a0dda34139be7565f2e6ebac31f1c7708adbf
@@ -90,21 +90,37 @@ CartController.prototype = {
90
90
  });
91
91
 
92
92
  if (line_items.length > 0)
93
- {
94
- tbody
95
- .append($('<tr/>').addClass('invoice_package_header')
96
- .append($('<td/>')
97
- .attr('colspan', '4')
98
- .append('<h3>Package ' + (j+1) + '</h3>')
93
+ {
94
+ // See if all the items in the package are downloadable
95
+ var all_downloadable = true;
96
+ $.each(line_items, function(i, li) {
97
+ if (!li.variant.downloadable || li.variant.downloadable == false)
98
+ all_downloadable = false;
99
+ });
100
+
101
+ if (all_downloadable)
102
+ {
103
+ tbody.append($('<tr/>').addClass('invoice_package_header')
104
+ .append($('<td/>').attr('colspan', '4')
105
+ .append('<h3>Downloadable Items</h3>')
106
+ )
107
+ );
108
+ }
109
+ else
110
+ {
111
+ tbody.append($('<tr/>').addClass('invoice_package_header')
112
+ .append($('<td/>').attr('colspan', '4')
113
+ .append('<h3>Package ' + j+1 + '</h3>')
99
114
  .append($('<div/>').attr('id', 'invoice_package_' + op.id + '_shipping_method'))
100
115
  )
101
- )
102
- .append($('<tr/>')
103
- .append($('<th/>').html('Item'))
104
- .append($('<th/>').html('Price'))
105
- .append($('<th/>').html('Quantity'))
106
- .append($('<th/>').html('Subtotal'))
107
116
  );
117
+ }
118
+ tbody.append($('<tr/>')
119
+ .append($('<th/>').html('Item'))
120
+ .append($('<th/>').html('Price'))
121
+ .append($('<th/>').html('Quantity'))
122
+ .append($('<th/>').html('Subtotal'))
123
+ );
108
124
  }
109
125
 
110
126
  $.each(line_items, function(i, li) {
@@ -255,4 +255,15 @@ CheckoutController.prototype = {
255
255
  });
256
256
  return li;
257
257
  },
258
+
259
+ all_downloadable: function()
260
+ {
261
+ var that = this;
262
+ var all = true;
263
+ $.each(that.invoice.line_items, function(i, li) {
264
+ if (!li.variant.downloadable || li.variant.downloadable == false)
265
+ all = false;
266
+ });
267
+ return all;
268
+ }
258
269
  };
@@ -16,6 +16,13 @@ ShippingAddressController.prototype = {
16
16
  print: function()
17
17
  {
18
18
  var that = this;
19
+
20
+ if (that.cc.all_downloadable())
21
+ {
22
+ $('#shipping_address_container').empty().append(div);
23
+ return;
24
+ }
25
+
19
26
  that.being_edited = false;
20
27
  var sa = that.cc.invoice.shipping_address;
21
28
 
@@ -44,6 +51,13 @@ ShippingAddressController.prototype = {
44
51
  edit: function()
45
52
  {
46
53
  var that = this;
54
+
55
+ if (that.cc.all_downloadable())
56
+ {
57
+ $('#shipping_address_container').empty().append(div);
58
+ return;
59
+ }
60
+
47
61
  var sa = that.cc.invoice.shipping_address;
48
62
  if (!sa.id) sa.id = 1;
49
63
 
@@ -80,6 +94,7 @@ ShippingAddressController.prototype = {
80
94
  ready: function()
81
95
  {
82
96
  var that = this;
97
+ if (that.cc.all_downloadable()) return true;
83
98
  if (that.cc.is_empty_address(that.cc.invoice.shipping_address)) return false;
84
99
  return true;
85
100
  }
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.8.9'
2
+ VERSION = '0.8.10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry