caboose-cms 0.9.26 → 0.9.27

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: 6d61cd61f33861af8f6d6629ed21732da3b9f845
4
- data.tar.gz: ac17118766ee2a78a539c7d44639766d4cbcc71a
3
+ metadata.gz: e1dc62676f228e072765b01730da01c40c6de169
4
+ data.tar.gz: 6e6e41ffc74f7f5f43459a043207e7861dcb26d8
5
5
  SHA512:
6
- metadata.gz: 8c1dc5d7b14673ce914d9053ad1a43de195c619c709e156ac867d4744eb6ca81fc1b91eb19550831cc8583730e7317fa0266c10c21f32785e642d5443edb0d4a
7
- data.tar.gz: 24d22a58ec6af37d01ec3c3c1f8ade46113cecc94f0adc9a6f0b30031f44c5b193c4af17169cfa5317d928fc4a715f771d304dfa4c89603276d8addefb82e9f8
6
+ metadata.gz: eac09898d009bf5bbb158eec4d344f95ea06f08d86c8250f2393e5827142fce4e3ed973c8b95fe2fe400efab388c095fc747c0ad44fe0f3ee271d1c00d3fe9c3
7
+ data.tar.gz: d06ee88853669829c7864fa4a86d774694afa75d497129d4f96e790a7a3ec229980623ae61bbf5866e5f234ff62994d1a5cfc547a2b714aa8aeb94de36812220
@@ -124,7 +124,7 @@ Caboose.Store.Modules.Cart = (function() {
124
124
  if (!self.$add_to_cart.find('.message').length) {
125
125
  self.$add_to_cart
126
126
  .append($('<div/>').hide().addClass('note error')
127
- .append($('<p/>').text(resp.error ? resp.error : (resp.errors ? resp.errors[0] : "Error adding to cart")))
127
+ .append($('<p/>').text(response.error ? response.error : (response.errors ? response.errors[0] : "Error adding to cart")))
128
128
  .append($('<p/>').append($('<a/>').attr('href', '/cart').html('View cart')))
129
129
  );
130
130
  self.$add_to_cart.find('.message').fadeIn();
@@ -120,6 +120,7 @@ module Caboose
120
120
  when 'custom_packages_function' then sc.custom_packages_function = value
121
121
  when 'custom_shipping_function' then sc.custom_shipping_function = value
122
122
  when 'custom_tax_function' then sc.custom_tax_function = value
123
+ when 'instore_tax_rate' then sc.instore_tax_rate = value
123
124
  when 'length_unit' then sc.length_unit = value
124
125
  when 'weight_unit' then sc.weight_unit = value
125
126
  when 'download_instructions' then sc.download_instructions = value
@@ -9,8 +9,7 @@ module Caboose
9
9
 
10
10
  def self.tax(invoice)
11
11
  sc = invoice.site.store_config
12
- return self.custom_tax(sc, invoice) if !sc.auto_calculate_tax
13
-
12
+
14
13
  if invoice.instore_pickup
15
14
  if sc.instore_tax_rate.nil?
16
15
  Caboose.log("Error: Null in-store tax rate")
@@ -19,6 +18,7 @@ module Caboose
19
18
  return invoice.subtotal * sc.instore_tax_rate
20
19
  end
21
20
 
21
+ return self.custom_tax(sc, invoice) if !sc.auto_calculate_tax
22
22
  return 0.00 if !invoice.shipping_address
23
23
  return 0.00 if !invoice.has_taxable_items?
24
24
  return 0.00 if !invoice.has_shippable_items?
@@ -7,6 +7,7 @@ sc = @store_config
7
7
  <p><div id='storeconfig_<%= sc.id %>_auto_calculate_tax' ></div></p>
8
8
  <p><div id='storeconfig_<%= sc.id %>_taxcloud_api_id' ></div></p>
9
9
  <p><div id='storeconfig_<%= sc.id %>_taxcloud_api_key' ></div></p>
10
+ <p><div id='storeconfig_<%= sc.id %>_instore_tax_rate'></div></p>
10
11
  <div id='custom_tax_container' <% if sc.auto_calculate_tax %>style='display: none;'<% end %>>
11
12
  <h3>Custom Tax Function</h3>
12
13
  <p><code>def custom_tax_function(invoice) {</code></p>
@@ -30,7 +31,8 @@ $(document).ready(function() {
30
31
  { name: 'auto_calculate_tax' , nice_name: 'Automatically Calculate Tax' , type: 'checkbox' , value: <%= raw Caboose.json(sc.auto_calculate_tax ? 1 : 0 ) %>, width: 400 , after_update: function() { toggleCustomTax(this.value); }},
31
32
  { name: 'taxcloud_api_id' , nice_name: 'TaxCloud API ID' , type: 'text' , value: <%= raw Caboose.json(sc.taxcloud_api_id ) %>, width: 400 },
32
33
  { name: 'taxcloud_api_key' , nice_name: 'TaxCloud API Key' , type: 'text' , value: <%= raw Caboose.json(sc.taxcloud_api_key ) %>, width: 600 },
33
- { name: 'custom_tax_function' , nice_name: 'Custom Tax Function' , type: 'textarea' , value: <%= raw Caboose.json(sc.custom_tax_function ) %>, width: 800, height: 200, fixed_placeholder: false }
34
+ { name: 'custom_tax_function' , nice_name: 'Custom Tax Function' , type: 'textarea' , value: <%= raw Caboose.json(sc.custom_tax_function ) %>, width: 800, height: 200, fixed_placeholder: false },
35
+ { name: 'instore_tax_rate' , nice_name: 'In-store Tax Rate' , type: 'text' , value: <%= raw Caboose.json(sc.instore_tax_rate ) %>, width: 400 }
34
36
  ]
35
37
  });
36
38
 
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.26'
2
+ VERSION = '0.9.27'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.26
4
+ version: 0.9.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-09 00:00:00.000000000 Z
11
+ date: 2016-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg