spree_frontend 4.2.0.rc1 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/frontend.js +11 -1
  3. data/app/assets/javascripts/spree/frontend/account.js +1 -1
  4. data/app/assets/javascripts/spree/frontend/cart.js +24 -2
  5. data/app/assets/javascripts/spree/frontend/checkout/address.js +60 -43
  6. data/app/assets/javascripts/spree/frontend/checkout/shipment.js +15 -2
  7. data/app/assets/javascripts/spree/frontend/coupon_manager.js +2 -2
  8. data/app/assets/javascripts/spree/frontend/currency.js +11 -0
  9. data/app/assets/javascripts/spree/frontend/locale.js +11 -0
  10. data/app/assets/javascripts/spree/frontend/views/spree/product/related.js +2 -2
  11. data/app/assets/javascripts/spree/frontend/views/spree/products/cart_form.js +1 -1
  12. data/app/assets/stylesheets/spree/frontend/application.scss +0 -3
  13. data/app/assets/stylesheets/spree/frontend/functions.scss +1 -0
  14. data/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss +2 -2
  15. data/app/assets/stylesheets/spree/frontend/variables/helper-variables.scss +1 -0
  16. data/app/assets/stylesheets/spree/frontend/variables/variables.scss +54 -0
  17. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss +27 -22
  18. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +3 -0
  19. data/app/assets/stylesheets/spree/frontend/views/spree/orders/show.scss +3 -0
  20. data/app/controllers/concerns/spree/checkout/address_book.rb +9 -7
  21. data/app/controllers/concerns/spree/locale_urls.rb +23 -0
  22. data/app/controllers/spree/addresses_controller.rb +1 -0
  23. data/app/controllers/spree/checkout_controller.rb +8 -8
  24. data/app/controllers/spree/currency_controller.rb +6 -10
  25. data/app/controllers/spree/home_controller.rb +5 -1
  26. data/app/controllers/spree/locale_controller.rb +23 -6
  27. data/app/controllers/spree/orders_controller.rb +2 -2
  28. data/app/controllers/spree/products_controller.rb +6 -5
  29. data/app/controllers/spree/store_controller.rb +7 -13
  30. data/app/controllers/spree/taxons_controller.rb +4 -3
  31. data/app/helpers/spree/addresses_helper.rb +19 -8
  32. data/app/helpers/spree/cache_helper.rb +7 -0
  33. data/app/helpers/spree/frontend_helper.rb +17 -25
  34. data/app/helpers/spree/navigation_helper.rb +6 -1
  35. data/app/helpers/spree/store_helper.rb +39 -0
  36. data/app/helpers/spree/taxons_helper.rb +1 -1
  37. data/app/models/spree/frontend_configuration.rb +2 -1
  38. data/app/views/kaminari/twitter-bootstrap-4/_first_page.html.erb +2 -2
  39. data/app/views/kaminari/twitter-bootstrap-4/_gap.html.erb +2 -2
  40. data/app/views/kaminari/twitter-bootstrap-4/_last_page.html.erb +2 -2
  41. data/app/views/kaminari/twitter-bootstrap-4/_next_page.html.erb +2 -2
  42. data/app/views/kaminari/twitter-bootstrap-4/_page.html.erb +2 -2
  43. data/app/views/kaminari/twitter-bootstrap-4/_paginator.html.erb +2 -2
  44. data/app/views/kaminari/twitter-bootstrap-4/_prev_page.html.erb +2 -2
  45. data/app/views/spree/address/_form.html.erb +15 -16
  46. data/app/views/spree/addresses/_form.html.erb +1 -1
  47. data/app/views/spree/addresses/edit.html.erb +2 -2
  48. data/app/views/spree/addresses/new.html.erb +2 -2
  49. data/app/views/spree/checkout/_address.html.erb +4 -6
  50. data/app/views/spree/checkout/_confirm.html.erb +1 -33
  51. data/app/views/spree/checkout/_credit_card.html.erb +2 -2
  52. data/app/views/spree/checkout/_delivery_informations.html.erb +43 -36
  53. data/app/views/spree/checkout/_summary.html.erb +3 -5
  54. data/app/views/spree/checkout/payment/_gateway.html.erb +1 -1
  55. data/app/views/spree/home/index.html.erb +21 -22
  56. data/app/views/spree/locale/index.html.erb +1 -0
  57. data/app/views/spree/orders/_coupon_code.html.erb +2 -3
  58. data/app/views/spree/orders/_line_item.html.erb +2 -2
  59. data/app/views/spree/orders/_line_item_data.html.erb +2 -2
  60. data/app/views/spree/orders/edit.html.erb +2 -3
  61. data/app/views/spree/orders/show.html.erb +1 -71
  62. data/app/views/spree/products/_cart_form.html.erb +4 -7
  63. data/app/views/spree/products/_color_option_type.html.erb +2 -3
  64. data/app/views/spree/products/_filters_desktop.html.erb +1 -2
  65. data/app/views/spree/products/_gallery.html.erb +4 -6
  66. data/app/views/spree/products/_gallery_modal.html.erb +3 -5
  67. data/app/views/spree/products/_option_type.html.erb +1 -2
  68. data/app/views/spree/products/_sort_mobile.html.erb +4 -4
  69. data/app/views/spree/products/related.html.erb +11 -5
  70. data/app/views/spree/products/show.html.erb +1 -5
  71. data/app/views/spree/shared/_carousel_4_products.html.erb +6 -12
  72. data/app/views/spree/shared/_color_select.html.erb +3 -3
  73. data/app/views/spree/shared/_currency_dropdown.html.erb +13 -0
  74. data/app/views/spree/shared/_delete_address_popup.html.erb +1 -2
  75. data/app/views/spree/shared/_error_messages.html.erb +2 -2
  76. data/app/views/spree/shared/_footer.html.erb +4 -4
  77. data/app/views/spree/shared/_head.html.erb +5 -1
  78. data/app/views/spree/shared/_header.html.erb +1 -1
  79. data/app/views/spree/shared/_internationalization_options.html.erb +31 -0
  80. data/app/views/spree/shared/_line_item.html.erb +2 -2
  81. data/app/views/spree/shared/_link_to_account.html.erb +5 -5
  82. data/app/views/spree/shared/_locale_dropdown.html.erb +13 -0
  83. data/app/views/spree/shared/_login.html.erb +1 -1
  84. data/app/views/spree/shared/_main_nav_bar.html.erb +1 -1
  85. data/app/views/spree/shared/_mobile_internationalization_options.html.erb +37 -0
  86. data/app/views/spree/shared/_mobile_navigation.html.erb +3 -6
  87. data/app/views/spree/shared/_nav_bar.html.erb +5 -5
  88. data/app/views/spree/shared/_no_product_available.html.erb +1 -1
  89. data/app/views/spree/shared/_option_values.html.erb +1 -1
  90. data/app/views/spree/shared/_order_details.html.erb +117 -174
  91. data/app/views/spree/shared/_payment.html.erb +2 -2
  92. data/app/views/spree/shared/_payment_sources.html.erb +2 -2
  93. data/app/views/spree/shared/_product_added_modal.html.erb +1 -1
  94. data/app/views/spree/shared/_search.html.erb +1 -2
  95. data/app/views/spree/shared/_translations.html.erb +6 -6
  96. data/app/views/spree/shared/carousel/_single.html.erb +6 -11
  97. data/app/views/spree/shared/carousel/_thumbnails.html.erb +5 -11
  98. data/app/views/spree/users/_address.html.erb +1 -1
  99. data/app/views/spree/users/_address_controls.html.erb +1 -2
  100. data/app/views/spree/users/show.html.erb +4 -4
  101. data/config/initializers/canonical_rails.rb +1 -1
  102. data/config/routes.rb +26 -30
  103. data/lib/generators/spree/frontend/copy_storefront/copy_storefront_generator.rb +1 -7
  104. data/lib/generators/spree/frontend/install/install_generator.rb +34 -0
  105. data/lib/generators/spree/frontend/install/templates/config/initializers/spree_storefront.rb +1 -0
  106. data/lib/generators/spree/frontend/install/templates/config/spree_storefront.yml +99 -0
  107. data/spree_frontend.gemspec +2 -2
  108. metadata +27 -19
  109. data/app/views/spree/products/_vendor_info.html.erb +0 -13
  110. data/app/views/spree/shared/_change_store.html.erb +0 -25
  111. data/app/views/spree/shared/_mobile_change_store.html.erb +0 -30
  112. data/app/views/spree/shared/forbidden.html.erb +0 -0
  113. data/app/views/spree/shared/unauthorized.html.erb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6310325fadb8490372ab3956820adacc3f2863efafc90657479af4154fecf2c
4
- data.tar.gz: fc6a855e4f78e5f08dd5e1df605199a1ca3cdef09e7f3e62daf41f532c825f15
3
+ metadata.gz: b202f99393b22f252f8c79ce9dbb68bdb3886df0095db558b7aeb54649d7442a
4
+ data.tar.gz: b6bf3f9b0dff2c97e90773fe58113d589711bb830ce921211b447b73b1a24631
5
5
  SHA512:
6
- metadata.gz: dad2b913fb4f1ac3ec06fc49586c1918b5a3fe68393b65231ac7f52348b74cd6b9ea083890afa857a85bbe7f94a59dd4a379bc5b4b146a3dd6a3eb6b2b9201f4
7
- data.tar.gz: bc89753cb7503a7823d1ac2af023f23bdd1d9a022d8351393967e878845faa8ce8ee6bbc82510278b2454d795cb804c2aa236e9b730b1ce78864f373ab133419
6
+ metadata.gz: 6ca9c497131e513e80a043e7dae75e7e3dacff782fc0d4111fa1c4883c68db5db58f351a734065accb375855cb3e05ec3d080453777865cf5a51d81507fa103a
7
+ data.tar.gz: 459e4adc0b271ee193f9e99c7bec8b044d45ffc94449e897fcdc8ca1d1a2c696f13bc7adda5be001e59eaf5f3fdd07647c8a6b45890b1539990a5633393205da
@@ -15,6 +15,8 @@
15
15
  //= require spree/frontend/api_tokens
16
16
  //= require spree/frontend/carousel-noconflict
17
17
  //= require spree/frontend/cart
18
+ //= require spree/frontend/locale
19
+ //= require spree/frontend/currency
18
20
  //= require spree/frontend/checkout
19
21
  //= require spree/frontend/checkout/address
20
22
  //= require spree/frontend/checkout/address_book
@@ -45,5 +47,13 @@ Spree.routes.ensure_cart = Spree.pathFor('ensure_cart')
45
47
  Spree.routes.api_v2_storefront_cart_apply_coupon_code = Spree.pathFor('api/v2/storefront/cart/apply_coupon_code')
46
48
  Spree.routes.api_v2_storefront_cart_remove_coupon_code = Spree.pathFor('api/v2/storefront/cart/remove_coupon_code')
47
49
  Spree.routes.product = function(id) { return Spree.pathFor('products/' + id) }
48
- Spree.routes.product_related = function(id) { return Spree.routes.product(id) + '/related' }
50
+ Spree.routes.product_related = function(id) { return Spree.pathFor('products/' + id + '/related') }
49
51
  Spree.routes.product_carousel = function (taxonId) { return Spree.pathFor('product_carousel/' + taxonId) }
52
+ Spree.routes.set_locale = function(locale) { return Spree.pathFor('locale/set?switch_to_locale=' + locale) }
53
+ Spree.routes.set_currency = function(currency) { return Spree.pathFor('currency/set?switch_to_currency=' + currency) }
54
+
55
+ Spree.showProgressBar = function () {
56
+ if (!Turbolinks.supported) { return }
57
+ Turbolinks.controller.adapter.progressBar.setValue(0)
58
+ Turbolinks.controller.adapter.progressBar.show()
59
+ }
@@ -1,6 +1,6 @@
1
1
  Spree.fetchAccount = function () {
2
2
  return $.ajax({
3
- url: Spree.pathFor('account_link')
3
+ url: Spree.localizedPathFor('account_link')
4
4
  }).done(function (data) {
5
5
  Spree.accountFetched = true
6
6
  return $('#link-to-account').html(data)
@@ -3,6 +3,21 @@
3
3
  Spree.ready(function ($) {
4
4
  var formUpdateCart = $('form#update-cart')
5
5
 
6
+ function buildEventTriggerObject(dataset, quantity) {
7
+ if (!dataset || !quantity) return false
8
+
9
+ var triggerObject = {
10
+ type: 'product_remove_from_cart',
11
+ variant_sku: dataset.variantSku,
12
+ variant_name: dataset.variantName,
13
+ variant_price: dataset.variantPrice,
14
+ variant_options: dataset.variantOptions,
15
+ variant_quantity: quantity
16
+ }
17
+
18
+ return triggerObject
19
+ }
20
+
6
21
  if (formUpdateCart.length) {
7
22
  var clearInvalidCouponField = function() {
8
23
  var couponCodeField = $('#order_coupon_code');
@@ -12,9 +27,16 @@ Spree.ready(function ($) {
12
27
  }
13
28
  }
14
29
 
15
- formUpdateCart.find('a.delete').show().one('click', function () {
30
+ formUpdateCart.find('a.delete').show().one('click', function (event) {
31
+ var itemId = $(this).attr('data-id')
32
+ var link = $(event.currentTarget);
33
+ var quantityInputs = $("form#update-cart input.shopping-cart-item-quantity-input[data-id='" + itemId + "']")
34
+ var quantity = $(quantityInputs).val()
16
35
  $(this).parents('.shopping-cart-item').first().find('input.shopping-cart-item-quantity-input').val(0)
17
36
  clearInvalidCouponField()
37
+ if (link[0] && link[0].dataset && quantity) {
38
+ link.trigger(buildEventTriggerObject(link[0].dataset, quantity))
39
+ }
18
40
  formUpdateCart.submit()
19
41
  return false
20
42
  })
@@ -101,7 +123,7 @@ Spree.ready(function ($) {
101
123
 
102
124
  Spree.fetchCart = function () {
103
125
  return $.ajax({
104
- url: Spree.pathFor('cart_link')
126
+ url: Spree.localizedPathFor('cart_link')
105
127
  }).done(function (data) {
106
128
  Spree.cartFetched = true
107
129
  return $('#link-to-cart').html(data)
@@ -1,16 +1,24 @@
1
- Spree.ready(function ($) {
2
- Spree.onAddress = function () {
1
+ Spree.ready(function($) {
2
+ Spree.onAddress = function() {
3
3
  if ($('#checkout_form_address').length) {
4
- Spree.updateState = function (region) {
4
+ Spree.updateState = function(region) {
5
5
  var countryId = getCountryId(region)
6
6
  if (countryId != null) {
7
7
  if (Spree.Checkout[countryId] == null) {
8
8
  $.ajax({
9
- async: false, method: 'GET', url: Spree.pathFor('/api/v2/storefront/countries/' + countryId + '?include=states'), dataType: 'json'
10
- }).done(function (data) {
11
- var json = data.included; var xStates = []
9
+ async: false,
10
+ method: 'GET',
11
+ url: Spree.localizedPathFor('/api/v2/storefront/countries/' + countryId + '?include=checkout_zone_applicable_states'),
12
+ dataType: 'json'
13
+ }).done(function(data) {
14
+ var json = data.included;
15
+ var xStates = [];
12
16
  for (var i = 0; i < json.length; i++) {
13
- var obj = json[i]; xStates.push({ 'id': obj.id, 'name': obj.attributes.name })
17
+ var obj = json[i];
18
+ xStates.push({
19
+ id: obj.id,
20
+ name: obj.attributes.name
21
+ })
14
22
  }
15
23
  Spree.Checkout[countryId] = {
16
24
  states: xStates,
@@ -27,7 +35,7 @@ Spree.ready(function ($) {
27
35
  }
28
36
  }
29
37
 
30
- Spree.toggleZipcode = function (data, region) {
38
+ Spree.toggleZipcode = function(data, region) {
31
39
  var requiredIndicator = $('span#required_marker').first().text()
32
40
  var zipcodeRequired = data.zipcode_required
33
41
  var zipcodePara = $('#' + region + 'zipcode')
@@ -49,7 +57,7 @@ Spree.ready(function ($) {
49
57
  }
50
58
  }
51
59
 
52
- Spree.fillStates = function (data, region) {
60
+ Spree.fillStates = function(data, region) {
53
61
  var selected
54
62
  var statesRequired = data.states_required
55
63
  var states = data.states
@@ -63,64 +71,72 @@ Spree.ready(function ($) {
63
71
  if (states.length > 0) {
64
72
  selected = parseInt(stateSelect.val())
65
73
  stateSelect.html('')
66
- $.each(states, function (idx, state) {
74
+ $.each(states, function(idx, state) {
67
75
  var opt = $(document.createElement('option')).attr('value', state.id).html(state.name)
68
76
  if (selected.toString(10) === state.id.toString(10)) {
69
77
  opt.prop('selected', true)
70
78
  }
71
79
  stateSelect.append(opt)
72
80
  })
73
- stateSelect.prop('required', false)
74
- stateSelect.prop('disabled', false).show()
75
- stateLabel.addClass('state-select-label')
76
- stateInput.hide().prop('disabled', true)
77
- statePara.show()
78
- stateSpanRequired.hide()
79
- stateSelect.removeClass('required')
81
+ // If States are listed for the Country selected kill the input field
82
+ stateInput.hide()
83
+ .prop('disabled', true)
84
+ .prop('required', false)
85
+ .val('')
80
86
 
81
- if (statesRequired) {
82
- stateSelect.addClass('required')
83
- stateSelectImg.show()
84
- stateSpanRequired.show()
85
- stateSelect.prop('required', true)
86
- }
87
- stateSelect.removeClass('hidden')
88
- stateInput.removeClass('required')
87
+ // Activate the State select dropdown.
88
+ statePara.show()
89
+ stateSelect.prop('required', statesRequired)
90
+ .prop('disabled', false)
91
+ .show()
92
+ stateSelectImg.show()
93
+ stateLabel.addClass('state-select-label')
94
+ stateSpanRequired.toggle(statesRequired)
89
95
  } else {
90
- stateSelect.hide().prop('disabled', true)
91
- stateLabel.removeClass('state-select-label')
96
+ // If no States are listed in the database for the country selected
97
+ // and a State is not required => (United Kingdom).
98
+ // Kill the State selector and input field.
92
99
  stateSelectImg.hide()
93
- stateInput.show()
100
+ stateSelect.hide()
101
+ .prop('disabled', true)
102
+ .prop('required', false)
103
+ .find('option').remove()
104
+
105
+ stateInput.prop('disabled', true)
106
+ .prop('required', false)
107
+ .hide()
108
+
109
+ // Toggle visibility of States parent element based on State required.
110
+ statePara.toggle(statesRequired)
111
+
94
112
  if (statesRequired) {
113
+ // If a State is required, but none are listed in the database
114
+ // for the country selected => (Hong Kong)
115
+ // Enable the State input field, set it to required.
116
+ stateInput.show()
117
+ .prop('disabled', false)
118
+ .prop('required', true)
95
119
  stateSpanRequired.show()
96
- stateLabel.removeClass('state-select-label')
97
- stateInput.addClass('required form-control')
98
- } else {
99
- stateInput.val('')
100
- stateSpanRequired.hide()
101
- stateInput.removeClass('required')
120
+ stateLabel.removeClass('state-select-label') // required for floating label
102
121
  }
103
- statePara.toggle(!!statesRequired)
104
- stateInput.prop('disabled', !statesRequired)
105
- stateInput.removeClass('hidden')
106
- stateSelect.removeClass('required')
107
122
  }
108
123
  }
109
- $('#bcountry select').change(function () {
124
+ $('#bcountry select').change(function() {
110
125
  Spree.updateState('b')
111
126
  })
112
- $('#scountry select').change(function () {
127
+ $('#scountry select').change(function() {
113
128
  Spree.updateState('s')
114
129
  })
115
130
  Spree.updateState('b')
116
131
 
117
132
  var orderUseBilling = $('input#order_use_billing')
118
- orderUseBilling.change(function () {
133
+ orderUseBilling.change(function() {
119
134
  updateShippingFormState(orderUseBilling)
120
135
  })
121
136
  updateShippingFormState(orderUseBilling)
122
137
  }
123
- function updateShippingFormState (orderUseBilling) {
138
+
139
+ function updateShippingFormState(orderUseBilling) {
124
140
  if (orderUseBilling.is(':checked')) {
125
141
  $('#shipping .inner').hide()
126
142
  $('#shipping .inner input, #shipping .inner select').prop('disabled', true)
@@ -130,7 +146,8 @@ Spree.ready(function ($) {
130
146
  Spree.updateState('s')
131
147
  }
132
148
  }
133
- function getCountryId (region) {
149
+
150
+ function getCountryId(region) {
134
151
  return $('#' + region + 'country select').val()
135
152
  }
136
153
  }
@@ -3,6 +3,7 @@ function ShippingTotalManager (input1) {
3
3
  this.input = input1
4
4
  this.shippingMethods = this.input.shippingMethods
5
5
  this.shipmentTotal = this.input.shipmentTotal
6
+ this.isFreeShipping = this.input.isFreeShipping
6
7
  this.taxTotal = this.input.taxTotal
7
8
  this.nonShipmentTax = $(this.taxTotal).data('non-shipment-tax')
8
9
  this.orderTotal = this.input.orderTotal
@@ -35,8 +36,19 @@ ShippingTotalManager.prototype.parseCurrencyToFloat = function (input) {
35
36
  return accounting.unformat(input, this.formatOptions.decimal)
36
37
  }
37
38
 
39
+ ShippingTotalManager.prototype.totalShipmentAmount = function (newShipmentTotal, oldShipmentTotal) {
40
+ var totalShipmentAmount = 0;
41
+ if (!this.isFreeShipping.html()) {
42
+ totalShipmentAmount = newShipmentTotal - oldShipmentTotal
43
+
44
+ return totalShipmentAmount
45
+ } else {
46
+ return totalShipmentAmount
47
+ }
48
+ }
49
+
38
50
  ShippingTotalManager.prototype.readjustSummarySection = function (orderTotal, newShipmentTotal, oldShipmentTotal, newTaxTotal, oldTaxTotal) {
39
- var newOrderTotal = orderTotal + (newShipmentTotal - oldShipmentTotal) + (newTaxTotal - oldTaxTotal)
51
+ var newOrderTotal = orderTotal + this.totalShipmentAmount(newShipmentTotal, oldShipmentTotal) + (newTaxTotal - oldTaxTotal)
40
52
  this.taxTotal.html(accounting.formatMoney(newTaxTotal, this.formatOptions))
41
53
  this.shipmentTotal.html(accounting.formatMoney(newShipmentTotal, this.formatOptions))
42
54
  return this.orderTotal.html(accounting.formatMoney(accounting.toFixed(newOrderTotal, 10), this.formatOptions))
@@ -53,7 +65,8 @@ Spree.ready(function ($) {
53
65
  orderTotal: $('#summary-order-total'),
54
66
  taxTotal: $('[data-hook="tax-total"]'),
55
67
  shipmentTotal: $('[data-hook="shipping-total"]'),
56
- shippingMethods: $('input[data-behavior="shipping-method-selector"]')
68
+ shippingMethods: $('input[data-behavior="shipping-method-selector"]'),
69
+ isFreeShipping: $('[data-hook="is-free-shipping"]')
57
70
  }
58
71
  return new ShippingTotalManager(input).bindEvent()
59
72
  })
@@ -49,7 +49,7 @@ CouponManager.prototype.sendRequest = function () {
49
49
  return $.ajax({
50
50
  async: false,
51
51
  method: 'PATCH',
52
- url: Spree.routes.api_v2_storefront_cart_apply_coupon_code,
52
+ url: Spree.routes.api_v2_storefront_cart_apply_coupon_code + '?locale=' + SPREE_LOCALE,
53
53
  dataType: 'json',
54
54
  headers: {
55
55
  'X-Spree-Order-Token': SpreeAPI.orderToken
@@ -74,7 +74,7 @@ CouponManager.prototype.sendRemoveRequest = function () {
74
74
  return $.ajax({
75
75
  async: false,
76
76
  method: 'DELETE',
77
- url: Spree.routes.api_v2_storefront_cart_remove_coupon_code + '/' + this.couponCode,
77
+ url: Spree.routes.api_v2_storefront_cart_remove_coupon_code + '/' + this.couponCode + '?locale=' + SPREE_LOCALE,
78
78
  dataType: 'json',
79
79
  headers: {
80
80
  'X-Spree-Order-Token': SpreeAPI.orderToken
@@ -0,0 +1,11 @@
1
+ Spree.ready(function ($) {
2
+ var currencySelect = $('#currency-select select')
3
+
4
+ if (currencySelect.length) {
5
+ currencySelect.on('change', function () {
6
+ currencySelect.attr('disabled')
7
+ Spree.showProgressBar()
8
+ window.location = Spree.routes.set_currency(this.value)
9
+ })
10
+ }
11
+ })
@@ -0,0 +1,11 @@
1
+ Spree.ready(function ($) {
2
+ var localeSelect = $('#locale-select select')
3
+
4
+ if (localeSelect.length) {
5
+ localeSelect.on('change', function () {
6
+ localeSelect.attr('disabled')
7
+ Spree.showProgressBar()
8
+ window.location = Spree.routes.set_locale(this.value)
9
+ })
10
+ }
11
+ })
@@ -1,6 +1,6 @@
1
1
  //= require spree/frontend/viewport
2
2
 
3
- Spree.fetchRelatedProductcs = function (id, htmlContainer) {
3
+ Spree.fetchRelatedProducts = function (id, htmlContainer) {
4
4
  return $.ajax({
5
5
  url: Spree.routes.product_related(id)
6
6
  }).done(function (data) {
@@ -21,7 +21,7 @@ document.addEventListener('turbolinks:load', function () {
21
21
  if (!relatedProductsFetched && relatedProductsContainer.length && relatedProductsEnabled && relatedProductsEnabled === 'true' && productId !== '') {
22
22
  $(window).on('resize scroll', function () {
23
23
  if (!relatedProductsFetched && relatedProductsContainer.isInViewport()) {
24
- Spree.fetchRelatedProductcs(productId, relatedProductsContainer)
24
+ Spree.fetchRelatedProducts(productId, relatedProductsContainer)
25
25
  relatedProductsFetched = true
26
26
  }
27
27
  })
@@ -255,7 +255,7 @@ function CartForm($, $cartForm) {
255
255
 
256
256
  this.$price.html(variant.display_price)
257
257
 
258
- var compareAtPriceContent = shouldDisplayCompareAtPrice ? '<span class="mr-3">' + variant.display_compare_at_price + '</span>' : ''
258
+ var compareAtPriceContent = shouldDisplayCompareAtPrice ? variant.display_compare_at_price : ''
259
259
  this.$compareAtPrice.html(compareAtPriceContent)
260
260
  }
261
261
 
@@ -1,6 +1,4 @@
1
1
  @import "spree/frontend/variables/variables";
2
- @import "spree/frontend/variables/bootstrap-overrides";
3
- @import "spree/frontend/variables/helper-variables";
4
2
  @import "bootstrap";
5
3
  @import "spree/frontend/bootstrap-patches";
6
4
 
@@ -32,7 +30,6 @@
32
30
  @import "spree/frontend/views/spree/errors/not_found";
33
31
  @import "spree/frontend/views/spree/shared/carousel/thumbnails";
34
32
  @import "spree/frontend/views/spree/shared/carousel/single";
35
- @import "spree/frontend/views/spree/shared/change_store";
36
33
  @import "spree/frontend/views/spree/home/index";
37
34
  @import "spree/frontend/views/spree/user_passwords/user_passwords";
38
35
  @import "spree/frontend/views/spree/user_sessions/new";
@@ -1,4 +1,5 @@
1
1
  $font-size-base-px: 16px; //assuming 16px is 1rem ($font-size-base: 1rem in Bootstrap 4)
2
+ $x1: null;
2
3
 
3
4
  @function font-px-to-rem($target-font-size-px: $font-size-base-px) {
4
5
  @return $font-size-base * ( $target-font-size-px / $font-size-base-px );
@@ -1,3 +1,4 @@
1
+ // we're keeping this file for legacy installations relying on it
1
2
  $grid-gutter-width: 19px;
2
3
  $body-color: $font-color;
3
4
  $theme-colors: (
@@ -35,6 +36,5 @@ $grid-breakpoints: (
35
36
  $container-max-widths: (
36
37
  sm: 768px,
37
38
  md: 992px,
38
- lg: 1200px,
39
- xl: 1200px
39
+ lg: 1200px
40
40
  );
@@ -1,3 +1,4 @@
1
+ // we're keeping this file for legacy installations relying on it
1
2
  $container-padding: 17px;
2
3
  $photo-width-to-height-ratio: 30001/ 37500;
3
4
  $photo-width-to-height-ratio-zoom: 28015 / 37500;
@@ -1,3 +1,4 @@
1
+ // main spree variables
1
2
  $primary-color: #0074c2;
2
3
  $secondary-color: #4c4c4c;
3
4
  $primary-background: #ffffff;
@@ -18,3 +19,56 @@ $spree-header-max-width: 1440px;
18
19
  $spree-header-mobile-height: 50px;
19
20
  $spree-header-tablet-height: 75px;
20
21
  $spree-header-desktop-height: 75px;
22
+
23
+ // bootstrap overrides
24
+ $grid-gutter-width: 19px;
25
+ $body-color: $font-color;
26
+ $theme-colors: (
27
+ // standard bootstrap colors
28
+ "primary": $primary-color,
29
+ "secondary": $secondary-color,
30
+ "danger": #f53737,
31
+ "info": #999999,
32
+ "warning": #ffc107,
33
+ "light-secondary": #999999,
34
+ "borders": $second-global-border,
35
+ "dark-borders": $global-border-style,
36
+ "light-background": $primary-background,
37
+ "dark-text": $font-color,
38
+ "overlay": rgba(76, 76, 76, 0.5),
39
+ "shadow": rgba(0, 0, 0, 0.16)
40
+ );
41
+ $enable-rounded: false;
42
+ $enable-shadows: false;
43
+ $enable-gradients: false;
44
+ $font-family-sans-serif: $font-family;
45
+ $font-weight-medium: 500;
46
+ .font-weight-medium {
47
+ font-weight: $font-weight-medium;
48
+ }
49
+ $btn-border-width: 2px;
50
+ $modal-dialog-margin: 0;
51
+ $grid-breakpoints: (
52
+ xs: 0,
53
+ sm: 576px,
54
+ md: 768px,
55
+ lg: 992px,
56
+ xl: 1200px
57
+ );
58
+ $container-max-widths: (
59
+ sm: 768px,
60
+ md: 992px,
61
+ lg: 1200px
62
+ );
63
+
64
+ // helper variables
65
+ $container-padding: 17px;
66
+ $photo-width-to-height-ratio: 30001/ 37500;
67
+ $photo-width-to-height-ratio-zoom: 28015 / 37500;
68
+ $thumbnails-carousel-single-height: 100% / $photo-width-to-height-ratio;
69
+ $thumbnails-carousel-single-height-zoom: 100% /
70
+ $photo-width-to-height-ratio-zoom;
71
+ $zoom-height-breakpoint: calc(
72
+ 650px / #{$photo-width-to-height-ratio-zoom} + 102px * 2
73
+ );
74
+ $spree-plp-filter-desktop-position: $spree-header-desktop-height + 77px;