spree_frontend 4.2.0.beta → 4.2.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/info.svg +7 -0
  3. data/app/assets/javascripts/spree/frontend.js +1 -1
  4. data/app/assets/javascripts/spree/frontend/cart.js +23 -1
  5. data/app/assets/javascripts/spree/frontend/checkout/address.js +60 -43
  6. data/app/assets/javascripts/spree/frontend/checkout/payment.js +19 -17
  7. data/app/assets/javascripts/spree/frontend/checkout/shipment.js +15 -2
  8. data/app/assets/javascripts/spree/frontend/views/spree/product/related.js +2 -2
  9. data/app/assets/javascripts/spree/frontend/views/spree/products/cart_form.js +1 -1
  10. data/app/assets/stylesheets/spree/frontend.css +0 -1
  11. data/app/assets/stylesheets/spree/frontend/components-custom/inputs.scss +6 -0
  12. data/app/assets/stylesheets/spree/frontend/functions.scss +1 -0
  13. data/app/assets/stylesheets/spree/frontend/helpers/spree/frontend_helper.scss +7 -0
  14. data/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss +1 -2
  15. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss +27 -26
  16. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +6 -4
  17. data/app/assets/stylesheets/spree/frontend/views/spree/orders/show.scss +3 -0
  18. data/app/assets/stylesheets/spree/frontend/views/spree/users/show.scss +0 -6
  19. data/app/controllers/concerns/spree/checkout/address_book.rb +9 -7
  20. data/app/controllers/spree/addresses_controller.rb +1 -0
  21. data/app/controllers/spree/currency_controller.rb +2 -2
  22. data/app/controllers/spree/home_controller.rb +5 -1
  23. data/app/controllers/spree/products_controller.rb +32 -15
  24. data/app/controllers/spree/store_controller.rb +0 -12
  25. data/app/controllers/spree/taxons_controller.rb +4 -3
  26. data/app/helpers/spree/addresses_helper.rb +10 -6
  27. data/app/helpers/spree/cache_helper.rb +7 -0
  28. data/app/helpers/spree/frontend_helper.rb +19 -7
  29. data/app/helpers/spree/navigation_helper.rb +1 -1
  30. data/app/models/spree/frontend_configuration.rb +2 -1
  31. data/app/views/kaminari/twitter-bootstrap-4/_first_page.html.erb +2 -2
  32. data/app/views/kaminari/twitter-bootstrap-4/_gap.html.erb +2 -2
  33. data/app/views/kaminari/twitter-bootstrap-4/_last_page.html.erb +2 -2
  34. data/app/views/kaminari/twitter-bootstrap-4/_next_page.html.erb +2 -2
  35. data/app/views/kaminari/twitter-bootstrap-4/_page.html.erb +2 -2
  36. data/app/views/kaminari/twitter-bootstrap-4/_paginator.html.erb +2 -2
  37. data/app/views/kaminari/twitter-bootstrap-4/_prev_page.html.erb +2 -2
  38. data/app/views/spree/address/_form.html.erb +15 -16
  39. data/app/views/spree/addresses/_form.html.erb +1 -1
  40. data/app/views/spree/addresses/edit.html.erb +13 -8
  41. data/app/views/spree/addresses/new.html.erb +7 -3
  42. data/app/views/spree/checkout/_address.html.erb +14 -13
  43. data/app/views/spree/checkout/_confirm.html.erb +1 -33
  44. data/app/views/spree/checkout/_credit_card.html.erb +2 -2
  45. data/app/views/spree/checkout/_delivery_informations.html.erb +43 -36
  46. data/app/views/spree/checkout/_payment.html.erb +1 -20
  47. data/app/views/spree/checkout/_payment_sources.html.erb +17 -0
  48. data/app/views/spree/checkout/_summary.html.erb +3 -5
  49. data/app/views/spree/checkout/payment/_gateway.html.erb +1 -1
  50. data/app/views/spree/home/index.html.erb +21 -22
  51. data/app/views/spree/orders/_coupon_code.html.erb +2 -3
  52. data/app/views/spree/orders/_line_item.html.erb +1 -1
  53. data/app/views/spree/orders/_line_item_data.html.erb +2 -2
  54. data/app/views/spree/orders/edit.html.erb +2 -3
  55. data/app/views/spree/orders/show.html.erb +1 -71
  56. data/app/views/spree/products/_cart_form.html.erb +4 -7
  57. data/app/views/spree/products/_color_option_type.html.erb +1 -2
  58. data/app/views/spree/products/_filters_desktop.html.erb +1 -2
  59. data/app/views/spree/products/_gallery.html.erb +4 -6
  60. data/app/views/spree/products/_gallery_modal.html.erb +3 -5
  61. data/app/views/spree/products/_option_type.html.erb +1 -2
  62. data/app/views/spree/products/_sort_mobile.html.erb +4 -4
  63. data/app/views/spree/products/related.html.erb +11 -5
  64. data/app/views/spree/products/show.html.erb +1 -5
  65. data/app/views/spree/shared/_carousel_4_products.html.erb +6 -12
  66. data/app/views/spree/shared/_change_store.html.erb +7 -7
  67. data/app/views/spree/shared/_checkout_header.html.erb +1 -1
  68. data/app/views/spree/shared/_color_select.html.erb +3 -3
  69. data/app/views/spree/shared/_delete_address_popup.html.erb +1 -2
  70. data/app/views/spree/shared/_error_messages.html.erb +2 -2
  71. data/app/views/spree/shared/_footer.html.erb +3 -3
  72. data/app/views/spree/shared/_head.html.erb +3 -2
  73. data/app/views/spree/shared/_header.html.erb +1 -1
  74. data/app/views/spree/shared/_main_nav_bar.html.erb +1 -1
  75. data/app/views/spree/shared/_mobile_change_store.html.erb +3 -3
  76. data/app/views/spree/shared/_mobile_navigation.html.erb +1 -1
  77. data/app/views/spree/shared/_nav_bar.html.erb +4 -4
  78. data/app/views/spree/shared/_no_product_available.html.erb +1 -1
  79. data/app/views/spree/shared/_option_values.html.erb +1 -1
  80. data/app/views/spree/shared/_order_details.html.erb +117 -174
  81. data/app/views/spree/shared/_payment.html.erb +2 -2
  82. data/app/views/spree/shared/_payment_sources.html.erb +2 -2
  83. data/app/views/spree/shared/_product_added_modal.html.erb +1 -1
  84. data/app/views/spree/shared/_search.html.erb +1 -2
  85. data/app/views/spree/shared/_translations.html.erb +6 -6
  86. data/app/views/spree/shared/carousel/_single.html.erb +6 -11
  87. data/app/views/spree/shared/carousel/_thumbnails.html.erb +5 -11
  88. data/app/views/spree/users/_address.html.erb +15 -19
  89. data/app/views/spree/users/_address_controls.html.erb +10 -0
  90. data/app/views/spree/users/show.html.erb +15 -13
  91. data/config/initializers/canonical_rails.rb +1 -1
  92. data/config/routes.rb +0 -1
  93. data/spree_frontend.gemspec +2 -2
  94. metadata +20 -20
  95. data/app/assets/stylesheets/spree/frontend/address_book.scss +0 -8
  96. data/app/views/spree/products/_vendor_info.html.erb +0 -13
  97. data/app/views/spree/shared/forbidden.html.erb +0 -0
  98. 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: 011aa871d742c968b59dd68ce90f5833e27d2c78173292aadba241054e7bbf89
4
- data.tar.gz: e1383ff17f1496fb69ecaa5ce6ad1a60c9f45792cc7cafc106f6c46f66f04b35
3
+ metadata.gz: 4c687a751a5affd4522bc602689a69466af4401bcda69b405b419dda929e737d
4
+ data.tar.gz: c8e4dbc7e128ab9d655ba9afdb60891d700224a9a5a8e62ab1f7d9720b30a9b2
5
5
  SHA512:
6
- metadata.gz: 8409e99f4ed56c23070669d26c81d710a997bcc46067fc6ced9691f3ab6790ceedfc35a91bcf4b5f64afedbb6701e6aca5bcf29638a0781db9e12dfe2863826f
7
- data.tar.gz: b51eae7f43fde751a3279f567ad1c4836ced9da3dbd33e6fa4e38d1038b79d262aafc6d878306a3eb9c34c4f8d465b918089acd43d7c6acac02138d0f06e1f58
6
+ metadata.gz: 238f9fb68b0c36b60aee012683d1d33854fc1c9ed28fefc94e080fb194974b8a75d9c91b2634be22b98efac96cf136a4a34228658844aec166d117c1d0d062d1
7
+ data.tar.gz: c34ae40194f58f11d2dfdf1b8f89dc57c61b84e97cc2a13b18e1f8670ce841e0c9d2e87d65e780936912bd2ef478d933de50e019830332bc57ec53bfffa46ede
@@ -0,0 +1,7 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
2
+ <g id="MiMedia---iOS-Android" serif:id="MiMedia---iOS/Android">
3
+ <g id="icon32pt_info" fill="currentColor">
4
+ <path id="Oval-58" d="M50,94C74.301,94 94,74.301 94,50C94,25.699 74.301,6 50,6C25.699,6 6,25.699 6,50C6,74.301 25.699,94 50,94ZM50,86C69.882,86 86,69.882 86,50C86,30.118 69.882,14 50,14C30.118,14 14,30.118 14,50C14,69.882 30.118,86 50,86ZM57,31.013C57,32.671 56.431,34.085 55.286,35.248C54.145,36.417 52.769,37 51.161,37C49.547,37 48.168,36.417 47.013,35.248C45.861,34.085 45.283,32.671 45.283,31.013C45.283,29.359 45.861,27.942 47.013,26.764C48.165,25.586 49.547,25 51.161,25C52.769,25 54.145,25.589 55.286,26.764C56.431,27.942 57,29.359 57,31.013ZM56.427,70.466C54.71,71.292 53.336,71.919 52.314,72.352C51.291,72.785 50.101,73 48.746,73C46.666,73 45.047,72.381 43.892,71.149C42.738,69.913 42.161,68.345 42.161,66.445C42.161,65.709 42.203,64.952 42.29,64.181C42.377,63.41 42.516,62.539 42.707,61.567L44.856,52.321C45.047,51.436 45.21,50.596 45.339,49.802C45.471,49.014 45.535,48.289 45.535,47.635C45.535,46.454 45.334,45.629 44.934,45.165C44.533,44.7 43.77,44.465 42.637,44.465C42.081,44.465 41.51,44.574 40.928,44.783C40.344,44.993 40,42.534 40,42.534C41.407,41.837 42.752,41.241 44.039,40.745C45.325,40.249 46.541,40 47.691,40C49.757,40 51.352,40.608 52.471,41.823C53.591,43.038 54.151,44.614 54.151,46.558C54.151,46.959 54.114,47.667 54.036,48.678C53.958,49.693 53.814,50.622 53.605,51.467L51.465,60.679C51.291,61.418 51.133,62.264 50.996,63.215C50.855,64.161 50.787,64.883 50.787,65.368C50.787,66.591 51.011,67.425 51.461,67.87C51.913,68.314 52.693,68.535 53.8,68.535C54.321,68.535 54.912,68.423 55.57,68.202C56.227,67.982 56.427,70.466 56.427,70.466Z"/>
5
+ </g>
6
+ </g>
7
+ </svg>
@@ -45,5 +45,5 @@ Spree.routes.ensure_cart = Spree.pathFor('ensure_cart')
45
45
  Spree.routes.api_v2_storefront_cart_apply_coupon_code = Spree.pathFor('api/v2/storefront/cart/apply_coupon_code')
46
46
  Spree.routes.api_v2_storefront_cart_remove_coupon_code = Spree.pathFor('api/v2/storefront/cart/remove_coupon_code')
47
47
  Spree.routes.product = function(id) { return Spree.pathFor('products/' + id) }
48
- Spree.routes.product_related = function(id) { return Spree.routes.product(id) + '/related' }
48
+ Spree.routes.product_related = function(id) { return Spree.pathFor('products/' + id + '/related') }
49
49
  Spree.routes.product_carousel = function (taxonId) { return Spree.pathFor('product_carousel/' + taxonId) }
@@ -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
  })
@@ -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.pathFor('/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
  }
@@ -8,20 +8,7 @@ Spree.ready(function ($) {
8
8
  Spree.onPayment = function () {
9
9
  if ($('#checkout_form_payment').length) {
10
10
  if ($('#existing_cards').length) {
11
- $('#existing_cards').hide()
12
11
  $('#payment-methods').hide()
13
- $("#payment-method-fields label[data-type='card']").click(function() {
14
- $('#existing_cards').show()
15
- $('.payment-sources').show()
16
- $('.existing-cc-radio').first().prop('checked', true)
17
- })
18
- $("#payment-method-fields label:not([data-type='card'])").click(function() {
19
- $('#existing_cards').hide()
20
- $('#payment-methods').hide()
21
- $('.payment-sources').hide()
22
- $('.existing-cc-radio').prop('checked', false)
23
- $('#use_existing_card_no').prop('checked', false)
24
- })
25
12
  $('.existing-cc-radio').click(function () {
26
13
  $(this).prop('checked', true)
27
14
  $('#use_existing_card_no').prop('checked', false)
@@ -60,11 +47,26 @@ Spree.ready(function ($) {
60
47
  }
61
48
 
62
49
  $('input[type="radio"][name="order[payments_attributes][][payment_method_id]"]').click(function () {
50
+ $('#payment-methods').hide()
51
+ $('.payment-sources').hide()
63
52
  Spree.enableSave()
64
- if ($('#payment_method_' + this.value).find('fieldset').children().length == 0) {
65
- $('.payment-sources').hide()
66
- } else {
67
- $('.payment-sources').show()
53
+ if ($('#payment_method_' + this.value).find('fieldset').children().length !== 0) {
54
+ if (this.closest('label').dataset.type === 'card') {
55
+ if ($('#existing_cards').length) {
56
+ $('.existing-cc-radio').first().prop('checked', true);
57
+ $('#use_existing_card_no').prop('checked', false)
58
+ $('#use_existing_card_yes').prop('checked', true)
59
+ $('#existing_cards').show();
60
+ $('#payment-methods').hide();
61
+ $('.payment-sources').show()
62
+ }
63
+ } else {
64
+ $('.existing-cc-radio').prop('checked', false);
65
+ $('#use_existing_card_no').prop('checked', false);
66
+ $('#existing_cards').hide();
67
+ $('#payment-methods').show();
68
+ $('.payment-sources').show()
69
+ }
68
70
  }
69
71
  $('#payment-methods li').hide()
70
72
  if (this.checked) {
@@ -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
  })
@@ -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,5 @@
1
1
  /*
2
2
  * This is a manifest file that includes stylesheets for spree_frontend
3
- *= require spree/frontend/address_book
4
3
  *= require spree/frontend/application
5
4
  *= require_self
6
5
  */
@@ -50,6 +50,12 @@
50
50
  }
51
51
  }
52
52
 
53
+ .field_with_errors {
54
+ input{
55
+ border-color: $danger;
56
+ }
57
+ }
58
+
53
59
  .spree-flat-label {
54
60
  color: theme-color("secondary");
55
61
  text-transform: uppercase;
@@ -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,6 +1,7 @@
1
1
  #breadcrumbs {
2
2
  padding: 0;
3
3
  }
4
+
4
5
  .breadcrumb {
5
6
  background: none;
6
7
  padding: 0.5rem 0;
@@ -23,3 +24,9 @@
23
24
  .breadcrumb-product-name {
24
25
  padding-right: 9.5px;
25
26
  }
27
+
28
+ .truncate {
29
+ white-space: nowrap;
30
+ overflow: hidden;
31
+ text-overflow: ellipsis;
32
+ }
@@ -35,6 +35,5 @@ $grid-breakpoints: (
35
35
  $container-max-widths: (
36
36
  sm: 768px,
37
37
  md: 992px,
38
- lg: 1200px,
39
- xl: 1200px
38
+ lg: 1200px
40
39
  );
@@ -2,11 +2,6 @@
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
 
5
- div:first-child {
6
- -webkit-flex: 0;
7
- flex-shrink: 0;
8
- }
9
-
10
5
  &-order-details {
11
6
  padding-bottom: 40px;
12
7
  font-weight: 500;
@@ -36,6 +31,9 @@
36
31
  }
37
32
 
38
33
  &-line-items {
34
+ @include media-breakpoint-down(sm) {
35
+ flex-basis: 100%;
36
+ }
39
37
  @include media-breakpoint-up(lg) {
40
38
  border: none;
41
39
  flex: 1 1 0;
@@ -48,15 +46,6 @@
48
46
  &-line-item {
49
47
  $self: &;
50
48
 
51
- a {
52
- max-width: 50%;
53
- margin-right: 20px;
54
-
55
- @include media-breakpoint-up(lg) {
56
- margin-right: 40px;
57
- }
58
- }
59
-
60
49
  img {
61
50
  width: 90px;
62
51
  height: auto;
@@ -73,14 +62,28 @@
73
62
  &-name {
74
63
  font-size: font-px-to-rem(14px);
75
64
  border-top: 1px solid $global-border-style;
65
+ margin-right: 20px;
76
66
 
77
- @include media-breakpoint-up(sm) {
78
- font-size: font-px-to-rem(27px);
67
+ &-image {
68
+ padding-right: 16px;
79
69
  }
80
70
 
81
- @include media-breakpoint-up(lg) {
82
- font-size: font-px-to-rem(22px);
83
- width: 55%;
71
+ &-link {
72
+ max-width: 50%;
73
+
74
+ @include media-breakpoint-up(lg) {
75
+ margin-right: 40px;
76
+ }
77
+
78
+
79
+ @include media-breakpoint-up(sm) {
80
+ font-size: font-px-to-rem(27px);
81
+ }
82
+
83
+ @include media-breakpoint-up(lg) {
84
+ font-size: font-px-to-rem(22px);
85
+ width: 55%;
86
+ }
84
87
  }
85
88
 
86
89
  &-options {
@@ -185,6 +188,8 @@
185
188
  }
186
189
 
187
190
  &-delivery-informations {
191
+ flex-basis: 100%;
192
+
188
193
  div:first-child {
189
194
  flex-shrink: unset;
190
195
  -webkit-flex: unset;
@@ -253,13 +258,9 @@
253
258
  }
254
259
 
255
260
  #checkout-summary {
256
- margin-top: 20px;
257
- @include media-breakpoint-up(sm) {
258
- margin-top: 70px;
259
- }
260
- @include media-breakpoint-up(lg) {
261
- flex: 0 0 40%;
262
- align-self: flex-start;
261
+ flex: 1 1 0;
262
+ @include media-breakpoint-down(sm) {
263
+ margin-top: 20px;
263
264
  }
264
265
  }
265
266
  }