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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c9634c46690b5c4bc5137344dfd466e183bc620
|
4
|
+
data.tar.gz: fddf702fa8d24cf49dbdadd308aef2e060944dc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
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
|
}
|
data/lib/caboose/version.rb
CHANGED