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: a9a61f8d71ba625b3d36a4bdf022a149f921962e
4
- data.tar.gz: c899b746ee2345f80c5781d81519299bed310733
3
+ metadata.gz: 8caad026c5f16e2a5d4ae19a51801766150ad677
4
+ data.tar.gz: 778fcfa166dda07bd05e20b74426cb178ea16966
5
5
  SHA512:
6
- metadata.gz: 076d6e1206329292eb380f9b1e9af9249ce3ae1060d248a5b608658f9c6fcc559b953f3fff9cac61f08823398dba36ed163785f4dbd19160489930df780c9ded
7
- data.tar.gz: 8c6314b7fda3813ac348b7b1e0be008a6f85214510847156a4c8f4b1d8bd5a6df4cf8cd49b9bc27dd3be72422a3458c5804a791339fd5bb070b258ef0583464e
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
- .append($('<h2/>').html(confirm ? 'Confirm Order' : 'Checkout'))
129
- .append($('<div/>').attr('id', 'invoice_1_instore_pickup' ))
130
- .append($('<section/>').attr('id', 'shipping_address_container'))
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.model_binder = new ModelBinder({
138
- name: 'Invoice',
139
- id: 1,
140
- update_url: '/checkout/invoice',
141
- authenticity_token: that.authenticity_token,
142
- attributes: [
143
- { name: 'instore_pickup', nice_name: 'In-store Pickup', type: 'checkbox' , value: that.invoice.instore_pickup, fixed_placeholder: true,
144
- //before_update: function() { this.value_old = this.value_clean; },
145
- after_update: function() {
146
- that.invoice.instore_pickup = this.value;
147
- var arr = ['shipping_address_container'];
148
- $.each(that.invoice.invoice_packages, function(i, ip) {
149
- arr.push('invoice_package_' + ip.id + '_shipping_method');
150
- });
151
- if (parseInt(this.value) == 0) $.each(arr, function(i, el) { $('#'+el).slideDown(); });
152
- else $.each(arr, function(i, el) { $('#'+el).slideUp(); });
153
- that.print_ready_message();
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
 
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.8.73'
2
+ VERSION = '0.8.74'
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.73
4
+ version: 0.8.74
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry