caboose-cms 0.8.73 → 0.8.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8caad026c5f16e2a5d4ae19a51801766150ad677
|
4
|
+
data.tar.gz: 778fcfa166dda07bd05e20b74426cb178ea16966
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dcb19f99ce9a7024cbad57b48a57393e32d6f2ce5b5661c493ff5c6ac4326a9e61c7c9d0e0d49442a924789e96ecba2787cfc86cd1152ea6754010e2257aa37
|
7
|
+
data.tar.gz: 8e88e1bb9465e46ed546f4cccfee3deba0e8d332d46f2d9819d3129084815c1f09dc189599c08c0c97dd9d01f677ae510e84af029b5008a90eb9c83c0559e9eb
|
@@ -25,6 +25,7 @@ CheckoutController.prototype = {
|
|
25
25
|
cart_controller: false,
|
26
26
|
|
27
27
|
// Cart options
|
28
|
+
allow_instore_pickup: false,
|
28
29
|
allow_edit_line_items: true,
|
29
30
|
allow_edit_gift_cards: true,
|
30
31
|
show_total: true,
|
@@ -124,37 +125,40 @@ CheckoutController.prototype = {
|
|
124
125
|
print: function(confirm)
|
125
126
|
{
|
126
127
|
var that = this;
|
127
|
-
var div = $('<div/>')
|
128
|
-
|
129
|
-
.append($('<div/>').attr('id', 'invoice_1_instore_pickup' ))
|
130
|
-
|
128
|
+
var div = $('<div/>').append($('<h2/>').html(confirm ? 'Confirm Order' : 'Checkout'));
|
129
|
+
if (that.allow_instore_pickup)
|
130
|
+
div.append($('<div/>').attr('id', 'invoice_1_instore_pickup' ));
|
131
|
+
div.append($('<section/>').attr('id', 'shipping_address_container'))
|
131
132
|
.append($('<section/>').attr('id', 'cart'))
|
132
133
|
.append($('<section/>').attr('id', 'gift_cards_container'))
|
133
134
|
.append($('<section/>').attr('id', 'payment_method_container'))
|
134
135
|
.append($('<div/>').attr('id', 'message'));
|
135
136
|
$('#'+that.container).empty().append(div);
|
136
137
|
|
137
|
-
that.
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
arr
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
138
|
+
if (that.allow_instore_pickup)
|
139
|
+
{
|
140
|
+
that.model_binder = new ModelBinder({
|
141
|
+
name: 'Invoice',
|
142
|
+
id: 1,
|
143
|
+
update_url: '/checkout/invoice',
|
144
|
+
authenticity_token: that.authenticity_token,
|
145
|
+
attributes: [
|
146
|
+
{ name: 'instore_pickup', nice_name: 'In-store Pickup', type: 'checkbox' , value: that.invoice.instore_pickup, fixed_placeholder: true,
|
147
|
+
//before_update: function() { this.value_old = this.value_clean; },
|
148
|
+
after_update: function() {
|
149
|
+
that.invoice.instore_pickup = this.value;
|
150
|
+
var arr = ['shipping_address_container'];
|
151
|
+
$.each(that.invoice.invoice_packages, function(i, ip) {
|
152
|
+
arr.push('invoice_package_' + ip.id + '_shipping_method');
|
153
|
+
});
|
154
|
+
if (parseInt(this.value) == 0) $.each(arr, function(i, el) { $('#'+el).slideDown(); });
|
155
|
+
else $.each(arr, function(i, el) { $('#'+el).slideUp(); });
|
156
|
+
that.print_ready_message();
|
157
|
+
}
|
158
|
+
}
|
159
|
+
]
|
160
|
+
});
|
161
|
+
}
|
158
162
|
|
159
163
|
if (confirm)
|
160
164
|
{
|
@@ -96,7 +96,7 @@ ShippingAddressController.prototype = {
|
|
96
96
|
ready: function()
|
97
97
|
{
|
98
98
|
var that = this;
|
99
|
-
if (that.cc.invoice.instore_pickup) return true;
|
99
|
+
if (that.cc.allow_instore_pickup && that.cc.invoice.instore_pickup) return true;
|
100
100
|
if (that.cc.all_downloadable()) return true;
|
101
101
|
if (that.cc.is_empty_address(that.cc.invoice.shipping_address)) return false;
|
102
102
|
|
@@ -21,7 +21,8 @@ store_config = @site.store_config
|
|
21
21
|
$(document).ready(function() {
|
22
22
|
var checkout_controller = new CheckoutController({
|
23
23
|
authenticity_token: '<%= raw form_authenticity_token %>',
|
24
|
-
pp_name: <%= raw Caboose.json(store_config.pp_name)
|
24
|
+
pp_name: <%= raw Caboose.json(store_config.pp_name) %>,
|
25
|
+
allow_instore_pickup: <%= store_config.allow_instore_pickup ? 'true' : 'false' %>
|
25
26
|
});
|
26
27
|
});
|
27
28
|
|
data/lib/caboose/version.rb
CHANGED