spree_frontend 4.2.0.rc3 → 4.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/frontend.js +38 -5
  3. data/app/assets/javascripts/spree/frontend/account.js +1 -1
  4. data/app/assets/javascripts/spree/frontend/cart.js +1 -1
  5. data/app/assets/javascripts/spree/frontend/checkout/address.js +1 -1
  6. data/app/assets/javascripts/spree/frontend/checkout/shipment.js +15 -2
  7. data/app/assets/javascripts/spree/frontend/coupon_manager.js +1 -1
  8. data/app/assets/javascripts/spree/frontend/currency.js +43 -0
  9. data/app/assets/javascripts/spree/frontend/locale.js +13 -0
  10. data/app/assets/stylesheets/spree/frontend/application.scss +0 -3
  11. data/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss +1 -0
  12. data/app/assets/stylesheets/spree/frontend/variables/helper-variables.scss +1 -0
  13. data/app/assets/stylesheets/spree/frontend/variables/variables.scss +54 -0
  14. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss +27 -22
  15. data/app/assets/stylesheets/spree/frontend/views/spree/orders/show.scss +3 -0
  16. data/app/controllers/concerns/spree/locale_urls.rb +21 -0
  17. data/app/controllers/spree/checkout_controller.rb +8 -8
  18. data/app/controllers/spree/currency_controller.rb +9 -9
  19. data/app/controllers/spree/home_controller.rb +5 -1
  20. data/app/controllers/spree/locale_controller.rb +23 -6
  21. data/app/controllers/spree/orders_controller.rb +2 -2
  22. data/app/controllers/spree/products_controller.rb +6 -5
  23. data/app/controllers/spree/store_controller.rb +11 -15
  24. data/app/controllers/spree/taxons_controller.rb +3 -2
  25. data/app/helpers/spree/addresses_helper.rb +9 -2
  26. data/app/helpers/spree/cache_helper.rb +7 -0
  27. data/app/helpers/spree/frontend_helper.rb +15 -23
  28. data/app/helpers/spree/navigation_helper.rb +6 -1
  29. data/app/helpers/spree/store_helper.rb +39 -0
  30. data/app/helpers/spree/taxons_helper.rb +1 -1
  31. data/app/models/spree/frontend_configuration.rb +2 -1
  32. data/app/views/kaminari/twitter-bootstrap-4/_first_page.html.erb +2 -2
  33. data/app/views/kaminari/twitter-bootstrap-4/_gap.html.erb +2 -2
  34. data/app/views/kaminari/twitter-bootstrap-4/_last_page.html.erb +2 -2
  35. data/app/views/kaminari/twitter-bootstrap-4/_next_page.html.erb +2 -2
  36. data/app/views/kaminari/twitter-bootstrap-4/_page.html.erb +2 -2
  37. data/app/views/kaminari/twitter-bootstrap-4/_paginator.html.erb +2 -2
  38. data/app/views/kaminari/twitter-bootstrap-4/_prev_page.html.erb +2 -2
  39. data/app/views/spree/address/_form.html.erb +15 -16
  40. data/app/views/spree/addresses/edit.html.erb +2 -2
  41. data/app/views/spree/addresses/new.html.erb +2 -2
  42. data/app/views/spree/checkout/_address.html.erb +4 -6
  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/_summary.html.erb +3 -5
  47. data/app/views/spree/checkout/payment/_gateway.html.erb +1 -1
  48. data/app/views/spree/home/index.html.erb +21 -22
  49. data/app/views/spree/locale/index.html.erb +1 -0
  50. data/app/views/spree/orders/_coupon_code.html.erb +2 -3
  51. data/app/views/spree/orders/_line_item.html.erb +2 -2
  52. data/app/views/spree/orders/_line_item_data.html.erb +1 -1
  53. data/app/views/spree/orders/edit.html.erb +2 -3
  54. data/app/views/spree/orders/show.html.erb +1 -71
  55. data/app/views/spree/products/_cart_form.html.erb +2 -3
  56. data/app/views/spree/products/_color_option_type.html.erb +2 -3
  57. data/app/views/spree/products/_filters_desktop.html.erb +1 -2
  58. data/app/views/spree/products/_gallery.html.erb +4 -6
  59. data/app/views/spree/products/_gallery_modal.html.erb +3 -5
  60. data/app/views/spree/products/_option_type.html.erb +1 -2
  61. data/app/views/spree/products/_sort_mobile.html.erb +4 -4
  62. data/app/views/spree/products/related.html.erb +11 -5
  63. data/app/views/spree/products/show.html.erb +1 -2
  64. data/app/views/spree/shared/_carousel_4_products.html.erb +6 -12
  65. data/app/views/spree/shared/_color_select.html.erb +3 -3
  66. data/app/views/spree/shared/_currency_dropdown.html.erb +13 -0
  67. data/app/views/spree/shared/_delete_address_popup.html.erb +1 -2
  68. data/app/views/spree/shared/_error_messages.html.erb +2 -2
  69. data/app/views/spree/shared/_footer.html.erb +2 -2
  70. data/app/views/spree/shared/_head.html.erb +2 -1
  71. data/app/views/spree/shared/_header.html.erb +1 -1
  72. data/app/views/spree/shared/_internationalization_options.html.erb +31 -0
  73. data/app/views/spree/shared/_line_item.html.erb +2 -2
  74. data/app/views/spree/shared/_link_to_account.html.erb +5 -5
  75. data/app/views/spree/shared/_locale_and_currency.html.erb +6 -0
  76. data/app/views/spree/shared/_locale_dropdown.html.erb +13 -0
  77. data/app/views/spree/shared/_login.html.erb +1 -1
  78. data/app/views/spree/shared/_main_nav_bar.html.erb +1 -1
  79. data/app/views/spree/shared/_mobile_internationalization_options.html.erb +37 -0
  80. data/app/views/spree/shared/_mobile_navigation.html.erb +3 -6
  81. data/app/views/spree/shared/_nav_bar.html.erb +5 -5
  82. data/app/views/spree/shared/_no_product_available.html.erb +1 -1
  83. data/app/views/spree/shared/_option_values.html.erb +1 -1
  84. data/app/views/spree/shared/_order_details.html.erb +117 -174
  85. data/app/views/spree/shared/_payment.html.erb +2 -2
  86. data/app/views/spree/shared/_payment_sources.html.erb +2 -2
  87. data/app/views/spree/shared/_product_added_modal.html.erb +3 -3
  88. data/app/views/spree/shared/_search.html.erb +1 -2
  89. data/app/views/spree/shared/_translations.html.erb +6 -6
  90. data/app/views/spree/shared/carousel/_single.html.erb +6 -11
  91. data/app/views/spree/shared/carousel/_thumbnails.html.erb +5 -11
  92. data/app/views/spree/users/_address_controls.html.erb +1 -2
  93. data/app/views/spree/users/show.html.erb +4 -4
  94. data/config/initializers/canonical_rails.rb +1 -1
  95. data/config/routes.rb +26 -30
  96. data/lib/generators/spree/frontend/copy_storefront/copy_storefront_generator.rb +1 -7
  97. data/lib/generators/spree/frontend/install/install_generator.rb +34 -0
  98. data/lib/generators/spree/frontend/install/templates/config/initializers/spree_storefront.rb +1 -0
  99. data/lib/generators/spree/frontend/install/templates/config/spree_storefront.yml +99 -0
  100. data/spree_frontend.gemspec +1 -1
  101. metadata +26 -16
  102. data/app/views/spree/shared/_change_store.html.erb +0 -25
  103. data/app/views/spree/shared/_mobile_change_store.html.erb +0 -30
  104. data/app/views/spree/shared/forbidden.html.erb +0 -0
  105. 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: 5f81a05d74462180d47969190cd9b0ba32eeb896e776706f89f288b1e52167d0
4
- data.tar.gz: f0d37b65f1b4a1bef39162049cc07f7201a9ba5b7417114867530c2f86a61c23
3
+ metadata.gz: bc15dc29068884259f1d7ef14b4f3f0dd8609b84c1fc994cf6221b5e618d476c
4
+ data.tar.gz: be1e02ad564e7851d38a6936d53512385cd7d37a6e29ac7b581eb6e1cbfd9b26
5
5
  SHA512:
6
- metadata.gz: caa243750a89dcb5ee49b389c30b1dda7594e2ce46cbb98d3c83c558c6af5af4e3dfc07f33b4fcca9f21bbb21af8dfef2a8a8b61264f1939a4ce262273045ae0
7
- data.tar.gz: 5853f04c6518d154deaffa26eff36966fe4a8486076cbf1143c03974cabc3502a9134239a439d8537a5254bf9cb934743a5692ba4b8486fb19f900429d95a028
6
+ metadata.gz: b88b315876bc7d0869958bb8c53498166d3b2f70faf2d16c2b21e239ef1ed99cdd1cc95358d306cdf680a3ca2f8b2c824351450a5dac719de4119a22d78dfbc6
7
+ data.tar.gz: 7864ea2c02aaaf3279b285e6dc5af7918f9a081ed200ec92515c91a1aa284e29a9c22260e66e89eb496af82d5c5e84c8d10186800d115968aaa8fec69d8405f5
@@ -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
@@ -42,8 +44,39 @@
42
44
 
43
45
  Spree.routes.api_tokens = Spree.pathFor('api_tokens')
44
46
  Spree.routes.ensure_cart = Spree.pathFor('ensure_cart')
45
- Spree.routes.api_v2_storefront_cart_apply_coupon_code = Spree.pathFor('api/v2/storefront/cart/apply_coupon_code')
46
- Spree.routes.api_v2_storefront_cart_remove_coupon_code = Spree.pathFor('api/v2/storefront/cart/remove_coupon_code')
47
- Spree.routes.product = function(id) { return Spree.pathFor('products/' + id) }
48
- Spree.routes.product_related = function(id) { return Spree.pathFor('products/' + id + '/related') }
49
- Spree.routes.product_carousel = function (taxonId) { return Spree.pathFor('product_carousel/' + taxonId) }
47
+ Spree.routes.api_v2_storefront_cart_apply_coupon_code = Spree.localizedPathFor('api/v2/storefront/cart/apply_coupon_code')
48
+ Spree.routes.api_v2_storefront_cart_remove_coupon_code = function(couponCode) { return Spree.localizedPathFor('api/v2/storefront/cart/remove_coupon_code/' + couponCode) }
49
+ Spree.routes.product = function(id) { return Spree.localizedPathFor('products/' + id) }
50
+ Spree.routes.product_related = function(id) { return Spree.localizedPathFor('products/' + id + '/related') }
51
+ Spree.routes.product_carousel = function (taxonId) { return Spree.localizedPathFor('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
+ }
60
+
61
+ Spree.clearCache = function () {
62
+ if (!Turbolinks.supported) { return }
63
+
64
+ Turbolinks.clearCache()
65
+ }
66
+
67
+ Spree.setCurrency = function (currency) {
68
+ Spree.clearCache()
69
+
70
+ var params = (new URL(window.location)).searchParams
71
+ if (currency === SPREE_DEFAULT_CURRENCY) {
72
+ params.delete('currency')
73
+ } else {
74
+ params.set('currency', currency)
75
+ }
76
+ var queryString = params.toString()
77
+ if (queryString !== '') { queryString = '?' + queryString }
78
+
79
+ SPREE_CURRENCY = currency
80
+
81
+ Turbolinks.visit(window.location.pathname + queryString, { action: 'replace' })
82
+ }
@@ -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)
@@ -123,7 +123,7 @@ Spree.ready(function ($) {
123
123
 
124
124
  Spree.fetchCart = function () {
125
125
  return $.ajax({
126
- url: Spree.pathFor('cart_link')
126
+ url: Spree.localizedPathFor('cart_link')
127
127
  }).done(function (data) {
128
128
  Spree.cartFetched = true
129
129
  return $('#link-to-cart').html(data)
@@ -8,7 +8,7 @@ Spree.ready(function($) {
8
8
  $.ajax({
9
9
  async: false,
10
10
  method: 'GET',
11
- url: Spree.pathFor('/api/v2/storefront/countries/' + countryId + '?include=checkout_zone_applicable_states'),
11
+ url: Spree.localizedPathFor('/api/v2/storefront/countries/' + countryId + '?include=checkout_zone_applicable_states'),
12
12
  dataType: 'json'
13
13
  }).done(function(data) {
14
14
  var json = data.included;
@@ -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
  })
@@ -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),
78
78
  dataType: 'json',
79
79
  headers: {
80
80
  'X-Spree-Order-Token': SpreeAPI.orderToken
@@ -0,0 +1,43 @@
1
+ document.addEventListener('turbolinks:load', function(event) {
2
+ // this condition checks if this is the first initial load of turbolinks application
3
+ if (!event.data.timing.visitStart) {
4
+ var currencySelect = document.querySelectorAll('select[name=switch_to_currency]')
5
+
6
+ if (currencySelect.length) {
7
+ currencySelect.forEach(function (element) {
8
+ element.addEventListener('change', function () {
9
+ Spree.showProgressBar()
10
+ var newCurrency = this.value
11
+
12
+ // we need to make AJAX call here to the backend to set currency in session
13
+ fetch(Spree.routes.set_currency(newCurrency), {
14
+ method: 'GET'
15
+ }).then(function (response) {
16
+ switch (response.status) {
17
+ case 200:
18
+ Spree.setCurrency(newCurrency)
19
+ document.getElementById('internationalization-options-desktop').classList.remove('show')
20
+ break
21
+ }
22
+ })
23
+ })
24
+ })
25
+ }
26
+ }
27
+ })
28
+
29
+ // fix back button issue with different currency set
30
+ // invalidate page if cached page has different currency then the current one
31
+ document.addEventListener('turbolinks:load', function(event) {
32
+ if (SPREE_CURRENCY === SPREE_DEFAULT_CURRENCY) {
33
+ var regexAnyCurrency = new RegExp('currency=')
34
+ if (event.data.url.match(regexAnyCurrency) && !event.data.url.match(SPREE_CURRENCY)) {
35
+ Spree.setCurrency(SPREE_CURRENCY)
36
+ }
37
+ } else {
38
+ var regex = new RegExp('currency=' + SPREE_CURRENCY)
39
+ if (!event.data.url.match(regex)) {
40
+ Spree.setCurrency(SPREE_CURRENCY)
41
+ }
42
+ }
43
+ })
@@ -0,0 +1,13 @@
1
+ document.addEventListener('turbolinks:load', function () {
2
+ var localeSelect = document.querySelectorAll('select[name=switch_to_locale]')
3
+
4
+ if (localeSelect.length) {
5
+ localeSelect.forEach(function (element) {
6
+ element.addEventListener('change', function () {
7
+ Spree.clearCache()
8
+ Spree.showProgressBar()
9
+ this.form.submit()
10
+ })
11
+ })
12
+ }
13
+ })
@@ -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,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: (
@@ -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;
@@ -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,9 +258,9 @@
253
258
  }
254
259
 
255
260
  #checkout-summary {
256
- margin-top: 20px;
257
- @include media-breakpoint-up(sm) {
258
- margin-top: 70px;
261
+ flex: 1 1 0;
262
+ @include media-breakpoint-down(sm) {
263
+ margin-top: 20px;
259
264
  }
260
265
  }
261
266
  }
@@ -261,6 +261,9 @@
261
261
  }
262
262
  #checkout-summary {
263
263
  margin-top: 30px;
264
+ @include media-breakpoint-down(sm) {
265
+ flex-basis: 100%;
266
+ }
264
267
  @include media-breakpoint-up(sm) {
265
268
  margin-top: 75px;
266
269
  }
@@ -0,0 +1,21 @@
1
+ module Spree
2
+ module LocaleUrls
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ before_action :redirect_to_default_locale
7
+ end
8
+
9
+ private
10
+
11
+ def default_url_options
12
+ super.merge(locale: locale_param, currency: currency_param)
13
+ end
14
+
15
+ def redirect_to_default_locale
16
+ return if params[:locale].blank? || supported_locale?(params[:locale])
17
+
18
+ redirect_to url_for(request.parameters.merge(locale: nil))
19
+ end
20
+ end
21
+ end
@@ -35,7 +35,7 @@ module Spree
35
35
  @order.temporary_address = !params[:save_user_address]
36
36
  unless @order.next
37
37
  flash[:error] = @order.errors.full_messages.join("\n")
38
- redirect_to(checkout_state_path(@order.state)) && return
38
+ redirect_to(spree.checkout_state_path(@order.state)) && return
39
39
  end
40
40
 
41
41
  if @order.completed?
@@ -43,7 +43,7 @@ module Spree
43
43
  flash['order_completed'] = true
44
44
  redirect_to completion_route
45
45
  else
46
- redirect_to checkout_state_path(@order.state)
46
+ redirect_to spree.checkout_state_path(@order.state)
47
47
  end
48
48
  else
49
49
  render :edit
@@ -77,7 +77,7 @@ module Spree
77
77
  if @order.state != correct_state && !skip_state_validation?
78
78
  flash.keep
79
79
  @order.update_column(:state, correct_state)
80
- redirect_to checkout_state_path(@order.state)
80
+ redirect_to spree.checkout_state_path(@order.state)
81
81
  end
82
82
  end
83
83
 
@@ -108,7 +108,7 @@ module Spree
108
108
 
109
109
  def set_state_if_present
110
110
  if params[:state]
111
- redirect_to checkout_state_path(@order.state) if @order.can_go_to_state?(params[:state]) && !skip_state_validation?
111
+ redirect_to spree.checkout_state_path(@order.state) if @order.can_go_to_state?(params[:state]) && !skip_state_validation?
112
112
  @order.state = params[:state]
113
113
  end
114
114
  end
@@ -129,8 +129,8 @@ module Spree
129
129
  end
130
130
 
131
131
  # Provides a route to redirect after order completion
132
- def completion_route(custom_params = nil)
133
- spree.order_path(@order, custom_params)
132
+ def completion_route(custom_params = {})
133
+ spree.order_path(@order, custom_params.merge(locale: locale_param))
134
134
  end
135
135
 
136
136
  def setup_for_current_state
@@ -174,14 +174,14 @@ module Spree
174
174
  params.delete(:payment_source)
175
175
 
176
176
  # Return to the Payments page if additional payment is needed.
177
- redirect_to checkout_state_path(@order.state) and return if @order.payments.valid.sum(:amount) < @order.total
177
+ redirect_to spree.checkout_state_path(@order.state) and return if @order.payments.valid.sum(:amount) < @order.total
178
178
  end
179
179
  end
180
180
 
181
181
  def remove_store_credit_payments
182
182
  if params.key?(:remove_store_credit)
183
183
  remove_store_credit_service.call(order: @order)
184
- redirect_to checkout_state_path(@order.state) and return
184
+ redirect_to spree.checkout_state_path(@order.state) and return
185
185
  end
186
186
  end
187
187