spree_frontend 4.2.3 → 4.3.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/app/assets/config/spree_frontend_manifest.js +4 -0
  4. data/app/assets/images/card-image.svg +4 -0
  5. data/app/assets/images/file-image.svg +4 -0
  6. data/app/assets/images/image.svg +4 -0
  7. data/app/assets/images/noimage/large.png +0 -0
  8. data/app/assets/images/noimage/mini.png +0 -0
  9. data/app/assets/images/noimage/plp.svg +23 -0
  10. data/app/assets/images/noimage/product.png +0 -0
  11. data/app/assets/images/noimage/small.png +0 -0
  12. data/app/assets/javascripts/spree.js +78 -0
  13. data/app/assets/javascripts/spree/api/main.js +36 -0
  14. data/app/assets/javascripts/spree/api/storefront/cart.js +49 -0
  15. data/app/assets/javascripts/spree/frontend.js +3 -0
  16. data/app/assets/javascripts/spree/frontend/checkout.js +16 -0
  17. data/app/assets/javascripts/spree/frontend/checkout/payment.js +18 -5
  18. data/app/assets/javascripts/spree/frontend/currency.js +11 -9
  19. data/app/assets/javascripts/spree/frontend/locale.es6 +13 -0
  20. data/app/assets/javascripts/spree/frontend/views/spree/home/product_carousels.js +3 -3
  21. data/app/assets/javascripts/spree/frontend/views/spree/products/index.js +0 -9
  22. data/app/assets/javascripts/spree/frontend/views/spree/products/price_filters.es6 +46 -0
  23. data/app/assets/stylesheets/spree/frontend/application.scss +1 -0
  24. data/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss +8 -0
  25. data/app/assets/stylesheets/spree/frontend/helpers/spree/frontend_helper.scss +41 -0
  26. data/app/assets/stylesheets/spree/frontend/variables/variables.scss +2 -2
  27. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +17 -5
  28. data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/_index.scss +1 -0
  29. data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/product_buy_bar.scss +20 -0
  30. data/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss +54 -67
  31. data/app/assets/stylesheets/spree/frontend/views/spree/shared/category_nav_bar.scss +3 -3
  32. data/app/assets/stylesheets/spree/frontend/views/spree/shared/footer.scss +4 -0
  33. data/app/assets/stylesheets/spree/frontend/views/spree/shared/main_nav_bar.scss +12 -1
  34. data/app/controllers/spree/addresses_controller.rb +14 -19
  35. data/app/controllers/spree/checkout_controller.rb +5 -3
  36. data/app/controllers/spree/cms_pages_controller.rb +29 -0
  37. data/app/controllers/spree/content_controller.rb +0 -2
  38. data/app/controllers/spree/errors_controller.rb +11 -0
  39. data/app/controllers/spree/home_controller.rb +34 -1
  40. data/app/controllers/spree/locale_controller.rb +7 -1
  41. data/app/controllers/spree/orders_controller.rb +9 -7
  42. data/app/controllers/spree/products_controller.rb +14 -13
  43. data/app/controllers/spree/store_controller.rb +25 -1
  44. data/app/controllers/spree/taxons_controller.rb +12 -5
  45. data/app/helpers/spree/addresses_helper.rb +9 -4
  46. data/app/helpers/spree/cms_pages_helper.rb +23 -0
  47. data/app/helpers/spree/frontend_helper.rb +109 -10
  48. data/app/helpers/spree/navigation_helper.rb +73 -4
  49. data/app/helpers/spree/products_filters_helper.rb +168 -0
  50. data/app/helpers/spree/store_helper.rb +3 -1
  51. data/app/views/spree/checkout/_address.html.erb +1 -1
  52. data/app/views/spree/checkout/_credit_card.html.erb +1 -0
  53. data/app/views/spree/cms_pages/show.html.erb +16 -0
  54. data/app/views/spree/errors/forbidden.html.erb +0 -0
  55. data/app/views/spree/errors/unauthorized.html.erb +0 -0
  56. data/app/views/spree/home/index.html.erb +19 -118
  57. data/app/views/spree/layouts/spree_application.html.erb +1 -1
  58. data/app/views/spree/products/_description.html.erb +16 -19
  59. data/app/views/spree/products/_filters_desktop.html.erb +50 -15
  60. data/app/views/spree/products/_filters_mobile.html.erb +38 -10
  61. data/app/views/spree/products/_sort_desktop.html.erb +17 -11
  62. data/app/views/spree/products/_sort_mobile.html.erb +16 -0
  63. data/app/views/spree/products/index.html.erb +1 -1
  64. data/app/views/spree/shared/_carousel_4_products.html.erb +2 -2
  65. data/app/views/spree/shared/_checkout_header.html.erb +22 -21
  66. data/app/views/spree/shared/_copyright.html.erb +1 -1
  67. data/app/views/spree/shared/_footer.html.erb +15 -9
  68. data/app/views/spree/shared/_head.html.erb +1 -1
  69. data/app/views/spree/shared/_header.html.erb +3 -3
  70. data/app/views/spree/shared/_main_nav_bar.html.erb +61 -43
  71. data/app/views/spree/shared/_mobile_navigation.html.erb +30 -19
  72. data/app/views/spree/shared/_nav_bar.html.erb +1 -1
  73. data/app/views/spree/shared/_option_values.html.erb +2 -21
  74. data/app/views/spree/shared/_order_details.html.erb +1 -1
  75. data/app/views/spree/shared/_paths.html.erb +8 -0
  76. data/app/views/spree/shared/_properties.html.erb +4 -0
  77. data/app/views/spree/shared/_translations.html.erb +2 -1
  78. data/app/views/spree/shared/carousel/_single.html.erb +1 -1
  79. data/app/views/spree/shared/carousel/_thumbnails.html.erb +1 -1
  80. data/app/views/spree/shared/cms/pages/_edit_mode.html.erb +13 -0
  81. data/app/views/spree/shared/cms/sections/_featured_article.html.erb +27 -0
  82. data/app/views/spree/shared/cms/sections/_hero_image.html.erb +60 -0
  83. data/app/views/spree/shared/cms/sections/_image_gallery.html.erb +171 -0
  84. data/app/views/spree/shared/cms/sections/_product_carousel.html.erb +5 -0
  85. data/app/views/spree/shared/cms/sections/_rich_text_content.html.erb +3 -0
  86. data/app/views/spree/shared/cms/sections/_side_by_side_images.html.erb +118 -0
  87. data/app/views/spree/taxons/_header.html.erb +6 -1
  88. data/app/views/spree/users/show.html.erb +1 -1
  89. data/config/initializers/assets.rb +4 -13
  90. data/config/routes.rb +9 -3
  91. data/lib/generators/spree/frontend/install/install_generator.rb +5 -5
  92. data/lib/generators/spree/frontend/install/templates/app/assets/config/manifest.js +2 -0
  93. data/lib/generators/spree/frontend/install/templates/vendor/assets/javascripts/spree/frontend/all.js +8 -0
  94. data/lib/generators/spree/frontend/install/templates/vendor/assets/stylesheets/spree/frontend/all.css +9 -0
  95. data/lib/spree/frontend.rb +6 -3
  96. data/lib/spree/frontend/engine.rb +6 -0
  97. data/spec/fixtures/files/store_favicon.ico +0 -0
  98. data/spree_frontend.gemspec +12 -8
  99. data/vendor/assets/javascripts/cleave.js +8 -0
  100. data/vendor/assets/javascripts/fetch.umd.js +531 -0
  101. data/vendor/assets/javascripts/jquery.payment.js +652 -0
  102. data/vendor/assets/javascripts/jsuri.js +458 -0
  103. data/vendor/assets/javascripts/polyfill.min.js +1 -0
  104. metadata +130 -84
  105. data/app/assets/images/homepage/big_category_banner.jpg +0 -0
  106. data/app/assets/images/homepage/big_category_banner_mobile.jpg +0 -0
  107. data/app/assets/images/homepage/big_category_banner_tablet_landscape.jpg +0 -0
  108. data/app/assets/images/homepage/big_category_banner_tablet_portrait.jpg +0 -0
  109. data/app/assets/images/homepage/category_banner_lower.jpg +0 -0
  110. data/app/assets/images/homepage/category_banner_lower_mobile.jpg +0 -0
  111. data/app/assets/images/homepage/category_banner_lower_tablet_landscape.jpg +0 -0
  112. data/app/assets/images/homepage/category_banner_lower_tablet_portrait.jpg +0 -0
  113. data/app/assets/images/homepage/category_banner_upper.jpg +0 -0
  114. data/app/assets/images/homepage/category_banner_upper_mobile.jpg +0 -0
  115. data/app/assets/images/homepage/category_banner_upper_tablet_landscape.jpg +0 -0
  116. data/app/assets/images/homepage/category_banner_upper_tablet_portrait.jpg +0 -0
  117. data/app/assets/images/homepage/main_banner.jpg +0 -0
  118. data/app/assets/images/homepage/main_banner_mobile.jpg +0 -0
  119. data/app/assets/images/homepage/main_banner_tablet_landscape.jpg +0 -0
  120. data/app/assets/images/homepage/main_banner_tablet_portrait.jpg +0 -0
  121. data/app/assets/images/homepage/promo_banner_left.jpg +0 -0
  122. data/app/assets/images/homepage/promo_banner_left_mobile.jpg +0 -0
  123. data/app/assets/images/homepage/promo_banner_left_tablet_landscape.jpg +0 -0
  124. data/app/assets/images/homepage/promo_banner_left_tablet_portrait.jpg +0 -0
  125. data/app/assets/images/homepage/promo_banner_right.jpg +0 -0
  126. data/app/assets/images/homepage/promo_banner_right_mobile.jpg +0 -0
  127. data/app/assets/images/homepage/promo_banner_right_tablet_landscape.jpg +0 -0
  128. data/app/assets/images/homepage/promo_banner_right_tablet_portrait.jpg +0 -0
  129. data/app/assets/images/meganav/promo_banner_left-first-category.jpg +0 -0
  130. data/app/assets/images/meganav/promo_banner_left-second-category.jpg +0 -0
  131. data/app/assets/images/meganav/promo_banner_left-third-category.jpg +0 -0
  132. data/app/assets/images/meganav/promo_banner_right-first-category.jpg +0 -0
  133. data/app/assets/images/meganav/promo_banner_right-second-category.jpg +0 -0
  134. data/app/assets/images/meganav/promo_banner_right-third-category.jpg +0 -0
  135. data/app/assets/images/noimage/big_category_banner.jpg +0 -0
  136. data/app/assets/images/noimage/big_category_banner_mobile.jpg +0 -0
  137. data/app/assets/images/noimage/big_category_banner_tablet_landscape.jpg +0 -0
  138. data/app/assets/images/noimage/big_category_banner_tablet_portrait.jpg +0 -0
  139. data/app/assets/images/noimage/category_banner.jpg +0 -0
  140. data/app/assets/images/noimage/category_banner_mobile.jpg +0 -0
  141. data/app/assets/images/noimage/category_banner_plp.jpg +0 -0
  142. data/app/assets/images/noimage/category_banner_tablet_landscape.jpg +0 -0
  143. data/app/assets/images/noimage/category_banner_tablet_portrait.jpg +0 -0
  144. data/app/assets/images/noimage/main_banner.jpg +0 -0
  145. data/app/assets/images/noimage/main_banner_mobile.jpg +0 -0
  146. data/app/assets/images/noimage/main_banner_tablet_landscape.jpg +0 -0
  147. data/app/assets/images/noimage/main_banner_tablet_portrait.jpg +0 -0
  148. data/app/assets/images/noimage/product_photo.jpg +0 -0
  149. data/app/assets/images/noimage/promo_banner.jpg +0 -0
  150. data/app/assets/images/noimage/promo_banner_megamenu.jpg +0 -0
  151. data/app/assets/images/noimage/promo_banner_mobile.jpg +0 -0
  152. data/app/assets/images/noimage/promo_banner_tablet_landscape.jpg +0 -0
  153. data/app/assets/images/noimage/promo_banner_tablet_portrait.jpg +0 -0
  154. data/app/assets/javascripts/spree/frontend/locale.js +0 -13
  155. data/app/assets/javascripts/spree/frontend/multi_currency.js +0 -13
  156. data/lib/generators/spree/frontend/install/templates/config/initializers/spree_storefront.rb +0 -1
  157. data/lib/generators/spree/frontend/install/templates/config/spree_storefront.yml +0 -99
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05b5069abfe9af2bec98806376c49b38dda8d0dca644f8de44c26dd20f3a4489
4
- data.tar.gz: 8c3ecd79fa07b0cd8e12d08a0e36315a6f1e5a73f3f48c7fda4b778455a8f491
3
+ metadata.gz: 1d33bc829b31e15e9ff3fb6b935d5f0c8efe605bdb39eec91697295159834b97
4
+ data.tar.gz: 324b305b9b070290425491a7f42f5d9873736d8458b4d74f59e5385f51a53fee
5
5
  SHA512:
6
- metadata.gz: 9903a5c070e3e1b5a10de47d8c9c98b9153c52bf885c7a2bb8f32463f42431ceb932f25bb7358eb92275f2573646f75d7629b616a606b92127e989ba420a01c5
7
- data.tar.gz: 57dc0a6b4f80970b1e17c1800d6364a283704b022b95e5dbadc4e2af51bc4fe9e18d06ca098b5754f3f302a40a4226867cc592a624cf5d6d416505410b6192e1
6
+ metadata.gz: 9fa6e789d9d2c72f9111f65f0a877f25ef5418a5166b0ab3fa9018fcb6df813c75c47fdf6d99271858c7ad29e30d5e70c82b28c3f3193f65f55328e220a57714
7
+ data.tar.gz: 8003796ac4b54d905d3723b69bc59090c16f9cb2a086629daff701f384b44dce88ba215d8ed1045d6ff680e29d45a1df3fc050702c30e57a4c4892f359b28bd9
data/Rakefile CHANGED
@@ -11,5 +11,5 @@ task default: :spec
11
11
  desc "Generates a dummy app for testing"
12
12
  task :test_app do
13
13
  ENV['LIB_NAME'] = 'spree/frontend'
14
- Rake::Task['common:test_app'].invoke
14
+ Rake::Task['common:test_app'].execute( { install_storefront: true, install_admin: false } )
15
15
  end
@@ -0,0 +1,4 @@
1
+ //= link_tree ../images
2
+ //
3
+ //= link spree/frontend/all.js
4
+ //= link spree/frontend/all.css
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-card-image" viewBox="0 0 16 16">
2
+ <path d="M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/>
3
+ <path d="M1.5 2A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13zm13 1a.5.5 0 0 1 .5.5v6l-3.775-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12v.54A.505.505 0 0 1 1 12.5v-9a.5.5 0 0 1 .5-.5h13z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-image" viewBox="0 0 16 16">
2
+ <path d="M8.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/>
3
+ <path d="M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM3 2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8l-2.083-2.083a.5.5 0 0 0-.76.063L8 11 5.835 9.7a.5.5 0 0 0-.611.076L3 12V2z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-image" viewBox="0 0 16 16">
2
+ <path d="M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/>
3
+ <path d="M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1h12z"/>
4
+ </svg>
Binary file
Binary file
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="100%" height="100%" viewBox="0 0 180 240" 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;">
4
+ <g transform="matrix(0.32046,0,0,0.32046,7.99036,6.23638)">
5
+ <path d="M193.937,171.926C184.475,171.926 173.361,167.573 168.554,160.362C167.504,159.01 167.053,157.509 167.053,155.856C167.053,151.802 170.808,148.347 174.862,148.347C176.966,148.347 178.919,149.397 180.87,151.652C183.874,155.405 188.23,157.208 193.937,157.208C204.001,157.208 209.858,151.351 209.858,145.192C209.858,138.585 203.249,134.078 194.99,131.074C186.729,128.071 177.866,125.216 172.01,117.857C169.156,114.102 167.654,109.598 167.654,104.04C167.654,88.57 180.57,79.558 194.99,79.558C204.601,79.558 215.115,84.814 220.372,92.775C221.123,93.977 221.573,95.328 221.573,96.98C221.573,101.185 217.968,104.49 213.763,104.49C211.51,104.49 209.558,103.288 207.756,100.886C204.601,96.529 200.396,94.277 194.99,94.277C187.178,94.277 182.673,98.633 182.673,104.04C182.673,109.598 189.282,113.352 197.542,116.356C205.803,119.511 214.665,122.665 220.522,130.624C223.376,134.68 224.877,139.485 224.877,145.192C224.877,161.263 210.61,171.926 193.937,171.926ZM250.97,193.166C250.97,197.832 247.51,200.691 243.447,200.691C239.384,200.691 235.923,197.832 235.923,193.166L235.923,111.909C235.923,94.003 250.368,79.558 268.275,79.558C286.183,79.558 300.627,94.003 300.627,111.909L300.627,139.749C300.627,157.654 286.183,172.1 268.275,172.1C261.504,172.1 255.786,169.993 250.97,165.63L250.97,193.166ZM250.97,139.749C250.97,149.378 258.644,157.053 268.275,157.053C277.905,157.053 285.579,149.378 285.579,139.749L285.579,111.909C285.579,102.279 277.905,94.605 268.275,94.605C258.644,94.605 250.97,102.279 250.97,111.909L250.97,139.749ZM358.379,100.963C356.404,100.963 354.583,100.203 352.913,98.533L352.609,98.229C349.725,95.953 346.539,94.738 342.743,94.738C333.787,94.738 328.321,100.963 328.321,113.258L328.321,163.81C328.321,168.516 324.83,171.4 320.731,171.4C316.631,171.4 313.14,168.516 313.14,163.81L313.14,113.258C313.14,94.283 323.918,79.558 342.743,79.558C350.027,79.558 358.832,82.897 363.843,87.907C365.361,89.576 366.12,91.247 366.12,93.219C366.12,97.319 362.477,100.963 358.379,100.963ZM436.715,122.363C436.715,126.419 433.261,129.872 429.206,129.872L387.15,129.872L387.15,139.636C387.15,148.646 395.863,156.907 405.926,156.907C411.933,156.907 416.739,154.956 420.495,151.2C422.145,148.946 424.098,147.746 426.501,147.746C430.558,147.746 434.313,151.2 434.313,155.254C434.313,158.259 432.66,160.211 430.858,162.013C424.7,168.622 416.289,171.926 405.926,171.926C388.353,171.926 372.13,157.509 372.13,139.636L372.13,111.849C372.13,93.977 386.551,79.557 404.423,79.557C422.296,79.557 436.715,93.977 436.715,111.849L436.715,122.363ZM421.696,114.853L421.696,111.849C421.696,102.236 414.035,94.578 404.423,94.578C394.81,94.578 387.15,102.236 387.15,111.849L387.15,114.853L421.696,114.853ZM511.723,122.363C511.723,126.419 508.269,129.872 504.214,129.872L462.16,129.872L462.16,139.636C462.16,148.646 470.871,156.907 480.934,156.907C486.941,156.907 491.749,154.956 495.503,151.2C497.155,148.946 499.106,147.746 501.511,147.746C505.566,147.746 509.321,151.2 509.321,155.254C509.321,158.259 507.669,160.211 505.866,162.013C499.708,168.622 491.298,171.926 480.934,171.926C463.361,171.926 447.138,157.509 447.138,139.636L447.138,111.849C447.138,93.977 461.559,79.557 479.431,79.557C497.305,79.557 511.723,93.977 511.723,111.849L511.723,122.363ZM496.704,114.853L496.704,111.849C496.704,102.236 489.043,94.578 479.431,94.578C469.819,94.578 462.16,102.236 462.16,111.849L462.16,114.853L496.704,114.853Z" style="fill:rgb(0,102,204);fill-rule:nonzero;"/>
6
+ <path d="M57.551,159.794C57.551,165.5 52.927,170.124 47.221,170.124C41.516,170.124 36.892,165.5 36.892,159.794C36.892,154.088 41.516,149.464 47.221,149.464C52.927,149.464 57.551,154.088 57.551,159.794" style="fill:rgb(0,102,204);fill-rule:nonzero;"/>
7
+ <path d="M100.978,159.794C100.978,165.5 96.352,170.124 90.648,170.124C84.943,170.124 80.319,165.5 80.319,159.794C80.319,154.088 84.943,149.464 90.648,149.464C96.352,149.464 100.978,154.088 100.978,159.794" style="fill:rgb(0,102,204);fill-rule:nonzero;"/>
8
+ <path d="M94.443,139.135L43.428,139.135C39.331,139.135 35.639,136.666 34.075,132.879L20.637,100.346L10.119,100.346C4.531,100.346 0,95.815 0,90.227C0,84.639 4.531,80.108 10.119,80.108L27.406,80.108C31.503,80.108 35.195,82.578 36.758,86.364L50.196,118.897L87.742,118.897L101.569,86.278C103.751,81.131 109.69,78.733 114.836,80.91C119.98,83.092 122.384,89.03 120.203,94.176L103.76,132.965C102.174,136.705 98.506,139.135 94.443,139.135" style="fill:rgb(0,102,204);fill-rule:nonzero;"/>
9
+ <path d="M105.747,46.537C101.875,42.505 95.47,42.376 91.439,46.248L78.842,58.342L78.842,10.12C78.842,4.53 74.313,0.001 68.723,0.001C63.135,0.001 58.605,4.53 58.605,10.12L58.605,58.106L46.482,46.297C42.479,42.399 36.072,42.481 32.173,46.485C28.273,50.489 28.357,56.895 32.36,60.795L61.663,89.336C61.797,89.467 61.941,89.582 62.08,89.703C62.154,89.768 62.225,89.835 62.3,89.898C62.645,90.181 63.002,90.439 63.373,90.671C63.425,90.702 63.481,90.731 63.534,90.764C63.898,90.982 64.272,91.175 64.656,91.344C64.691,91.359 64.721,91.38 64.757,91.395C64.781,91.406 64.805,91.413 64.828,91.422C65.058,91.518 65.291,91.6 65.526,91.678C65.612,91.707 65.697,91.741 65.783,91.767C66.013,91.836 66.247,91.891 66.48,91.944C66.573,91.966 66.666,91.994 66.759,92.011C66.993,92.058 67.228,92.089 67.464,92.118C67.557,92.129 67.648,92.149 67.742,92.157C68.058,92.189 68.374,92.204 68.691,92.204C68.701,92.204 68.711,92.206 68.722,92.206L68.723,92.206C68.75,92.206 68.778,92.202 68.804,92.202C69.1,92.2 69.396,92.187 69.69,92.159C69.864,92.143 70.038,92.11 70.21,92.085C70.355,92.063 70.501,92.048 70.645,92.02C70.851,91.981 71.055,91.925 71.258,91.874C71.366,91.845 71.476,91.824 71.582,91.793C71.792,91.731 71.996,91.655 72.202,91.579C72.3,91.543 72.402,91.513 72.5,91.473C72.696,91.394 72.887,91.302 73.08,91.21C73.185,91.16 73.291,91.115 73.393,91.062C73.568,90.97 73.737,90.868 73.908,90.766C74.024,90.696 74.143,90.63 74.257,90.556C74.406,90.458 74.551,90.349 74.696,90.243C74.825,90.148 74.955,90.055 75.081,89.954C75.207,89.851 75.329,89.74 75.451,89.631C75.545,89.548 75.642,89.473 75.733,89.386L105.457,60.845C109.488,56.974 109.618,50.568 105.747,46.537" style="fill:rgb(153,204,0);fill-rule:nonzero;"/>
10
+ <path d="M70.287,208.737C60.149,208.737 49.575,204.919 38.207,197.286C33.568,194.171 32.332,187.884 35.447,183.245C38.563,178.607 44.849,177.371 49.49,180.485C67.208,192.383 77.219,189.517 87.633,181.039C91.967,177.511 98.341,178.163 101.869,182.497C105.396,186.832 104.744,193.206 100.409,196.733C90.579,204.736 80.662,208.737 70.287,208.737" style="fill:rgb(153,204,0);fill-rule:nonzero;"/>
11
+ </g>
12
+ <g transform="matrix(0.723327,0,0,0.716405,24.4284,25.3505)">
13
+ <g transform="matrix(9.26626,0,0,9.26626,16.011,72.835)">
14
+ <path d="M6.002,5.5C6.002,6.323 5.325,7 4.502,7C3.679,7 3.002,6.323 3.002,5.5C3.002,4.677 3.679,4 4.502,4C5.325,4 6.002,4.677 6.002,5.5Z" style="fill:rgb(125,125,125);fill-rule:nonzero;"/>
15
+ </g>
16
+ <g transform="matrix(9.26626,0,0,9.26626,16.011,72.835)">
17
+ <path d="M1.5,2C0.677,2 -0,2.677 0,3.5L0,12.5C0,13.323 0.677,14 1.5,14L14.5,14C15.323,14 16,13.323 16,12.5L16,3.5C16,2.677 15.323,2 14.5,2L1.5,2ZM14.5,3C14.774,3 15,3.226 15,3.5L15,9.5L11.225,7.553C11.033,7.457 10.8,7.495 10.648,7.646L6.938,11.356L4.278,9.584C4.081,9.453 3.816,9.479 3.648,9.646L1.002,12L1.002,12.54C1.001,12.527 1,12.513 1,12.5L1,3.5C1,3.226 1.226,3 1.5,3L14.5,3Z" style="fill:rgb(125,125,125);fill-rule:nonzero;"/>
18
+ </g>
19
+ </g>
20
+ <g transform="matrix(1.89682,0,0,1.89682,-1.5642,-167.039)">
21
+ <text x="18.181px" y="200.157px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:12px;fill:rgb(0,102,204);">NO IMAGE</text>
22
+ </g>
23
+ </svg>
Binary file
@@ -0,0 +1,78 @@
1
+ //= require jsuri
2
+ function Spree () {}
3
+
4
+ Spree.ready = function (callback) {
5
+ return jQuery(document).on('page:load turbolinks:load', function () {
6
+ return callback(jQuery)
7
+ })
8
+ }
9
+
10
+ Spree.mountedAt = function () {
11
+ return window.SpreePaths.mounted_at
12
+ }
13
+
14
+ Spree.adminPath = function () {
15
+ return window.SpreePaths.admin
16
+ }
17
+
18
+ Spree.pathFor = function (path) {
19
+ var locationOrigin = (window.location.protocol + '//' + window.location.hostname) + (window.location.port ? ':' + window.location.port : '')
20
+
21
+ return this.url('' + locationOrigin + (this.mountedAt()) + path, this.url_params).toString()
22
+ }
23
+
24
+ Spree.localizedPathFor = function(path) {
25
+ if (typeof (SPREE_LOCALE) !== 'undefined' && typeof (SPREE_CURRENCY) !== 'undefined') {
26
+ var fullUrl = new URL(Spree.pathFor(path))
27
+ var params = fullUrl.searchParams
28
+ var pathName = fullUrl.pathname
29
+
30
+ params.set('currency', SPREE_CURRENCY)
31
+
32
+ if (pathName.match(/api\/v/)) {
33
+ params.set('locale', SPREE_LOCALE)
34
+ } else {
35
+ pathName = (this.mountedAt()) + SPREE_LOCALE + '/' + path
36
+ }
37
+ return fullUrl.origin + pathName + '?' + params.toString()
38
+ }
39
+ return Spree.pathFor(path)
40
+ }
41
+
42
+ Spree.adminPathFor = function (path) {
43
+ return this.pathFor('' + (this.adminPath()) + path)
44
+ }
45
+
46
+ Spree.url = function (uri, query) {
47
+ if (uri.path === void 0) {
48
+ // eslint-disable-next-line no-undef
49
+ uri = new Uri(uri)
50
+ }
51
+ if (query) {
52
+ $.each(query, function (key, value) {
53
+ return uri.addQueryParam(key, value)
54
+ })
55
+ }
56
+ return uri
57
+ }
58
+
59
+ Spree.ajax = function (urlOrSettings, settings) {
60
+ var url
61
+ if (typeof urlOrSettings === 'string') {
62
+ return $.ajax(Spree.url(urlOrSettings).toString(), settings)
63
+ } else {
64
+ url = urlOrSettings['url']
65
+ delete urlOrSettings['url']
66
+ return $.ajax(Spree.url(url).toString(), urlOrSettings)
67
+ }
68
+ }
69
+
70
+ Spree.routes = {
71
+ states_search: Spree.pathFor('api/v1/states'),
72
+ apply_coupon_code: function (orderId) {
73
+ return Spree.pathFor('api/v1/orders/' + orderId + '/apply_coupon_code')
74
+ },
75
+ cart: Spree.pathFor('cart')
76
+ }
77
+
78
+ Spree.url_params = {}
@@ -0,0 +1,36 @@
1
+ //= require spree
2
+
3
+ var SpreeAPI = {
4
+ oauthToken: null, // user Bearer token to authorize operations for the given user
5
+ orderToken: null // order token to authorize operations on current order (cart)
6
+ }
7
+
8
+ SpreeAPI.Storefront = {}
9
+ SpreeAPI.Platform = {}
10
+
11
+ // API routes
12
+ Spree.routes.api_v2_storefront_cart_create = Spree.pathFor('api/v2/storefront/cart')
13
+ Spree.routes.api_v2_storefront_cart_add_item = Spree.pathFor('api/v2/storefront/cart/add_item')
14
+ Spree.routes.api_v2_storefront_cart_apply_coupon_code = Spree.pathFor('api/v2/storefront/cart/apply_coupon_code')
15
+
16
+ // helpers
17
+ SpreeAPI.handle500error = function () {
18
+ alert('Internal Server Error')
19
+ }
20
+
21
+ SpreeAPI.prepareHeaders = function (headers) {
22
+ if (typeof headers === 'undefined') {
23
+ headers = {}
24
+ }
25
+
26
+ // if signed in we need to pass the Bearer authorization token
27
+ // so backend will recognize that actions are authorized in scope of this user
28
+ if (SpreeAPI.oauthToken) {
29
+ headers['Authorization'] = 'Bearer ' + SpreeAPI.oauthToken
30
+ }
31
+
32
+ // default headers, required for POST/PATCH/DELETE requests
33
+ headers['Accept'] = 'application/json'
34
+ headers['Content-Type'] = 'application/json'
35
+ return headers
36
+ }
@@ -0,0 +1,49 @@
1
+ //= require spree/api/main
2
+
3
+ SpreeAPI.Storefront.createCart = function (successCallback, failureCallback) {
4
+ fetch(Spree.routes.api_v2_storefront_cart_create, {
5
+ method: 'POST',
6
+ headers: SpreeAPI.prepareHeaders()
7
+ }).then(function (response) {
8
+ switch (response.status) {
9
+ case 422:
10
+ response.json().then(function (json) { failureCallback(json.error) })
11
+ break
12
+ case 500:
13
+ SpreeAPI.handle500error()
14
+ break
15
+ case 201:
16
+ response.json().then(function (json) {
17
+ SpreeAPI.orderToken = json.data.attributes.token
18
+ successCallback()
19
+ })
20
+ break
21
+ }
22
+ })
23
+ }
24
+
25
+ SpreeAPI.Storefront.addToCart = function (variantId, quantity, options, successCallback, failureCallback) {
26
+ fetch(Spree.routes.api_v2_storefront_cart_add_item, {
27
+ method: 'POST',
28
+ headers: SpreeAPI.prepareHeaders({ 'X-Spree-Order-Token': SpreeAPI.orderToken }),
29
+ body: JSON.stringify({
30
+ variant_id: variantId,
31
+ quantity: quantity,
32
+ options: options
33
+ })
34
+ }).then(function (response) {
35
+ switch (response.status) {
36
+ case 422:
37
+ response.json().then(function (json) { failureCallback(json.error) })
38
+ break
39
+ case 500:
40
+ SpreeAPI.handle500error()
41
+ break
42
+ case 200:
43
+ response.json().then(function (json) {
44
+ successCallback(json.data)
45
+ })
46
+ break
47
+ }
48
+ })
49
+ }
@@ -10,6 +10,7 @@
10
10
  //= require spree/api/main
11
11
  //= require ./lazysizes.config
12
12
  //= require lazysizes.min
13
+ //= require accounting.min
13
14
  //= require turbolinks
14
15
  //= require spree/frontend/account
15
16
  //= require spree/frontend/api_tokens
@@ -29,6 +30,7 @@
29
30
  //= require spree/frontend/views/spree/products/description
30
31
  //= require spree/frontend/views/spree/products/index
31
32
  //= require spree/frontend/views/spree/products/modal_carousel
33
+ //= require spree/frontend/views/spree/products/price_filters
32
34
  //= require spree/frontend/views/spree/shared/carousel
33
35
  //= require spree/frontend/views/spree/shared/carousel/single
34
36
  //= require spree/frontend/views/spree/shared/carousel/swipes
@@ -46,6 +48,7 @@ Spree.routes.api_tokens = Spree.pathFor('api_tokens')
46
48
  Spree.routes.ensure_cart = Spree.pathFor('ensure_cart')
47
49
  Spree.routes.api_v2_storefront_cart_apply_coupon_code = Spree.localizedPathFor('api/v2/storefront/cart/apply_coupon_code')
48
50
  Spree.routes.api_v2_storefront_cart_remove_coupon_code = function(couponCode) { return Spree.localizedPathFor('api/v2/storefront/cart/remove_coupon_code/' + couponCode) }
51
+ Spree.routes.api_v2_storefront_destroy_credit_card = function(id) { return Spree.localizedPathFor('api/v2/storefront/account/credit_cards/' + id) }
49
52
  Spree.routes.product = function(id) { return Spree.localizedPathFor('products/' + id) }
50
53
  Spree.routes.product_related = function(id) { return Spree.localizedPathFor('products/' + id + '/related') }
51
54
  Spree.routes.product_carousel = function (taxonId) { return Spree.localizedPathFor('product_carousel/' + taxonId) }
@@ -59,3 +59,19 @@ Spree.ready(function () {
59
59
 
60
60
  return Spree.Checkout
61
61
  })
62
+
63
+ $('.js-remove-credit-card').click(function() {
64
+ if (confirm(Spree.translations.credit_card_remove_confirmation)) {
65
+ return $.ajax({
66
+ async: false,
67
+ method: 'DELETE',
68
+ url: Spree.routes.api_v2_storefront_destroy_credit_card(this.dataset.id),
69
+ dataType: 'json',
70
+ headers: {
71
+ 'Authorization': 'Bearer ' + SpreeAPI.oauthToken
72
+ }
73
+ }).done(function() {
74
+ location.reload();
75
+ })
76
+ }
77
+ })
@@ -27,11 +27,29 @@ Spree.ready(function ($) {
27
27
  if ($(CARD_NUMBER_SELECTOR).length > 0 &&
28
28
  $(CARD_EXPIRATION_SELECTOR).length > 0 &&
29
29
  $(CARD_CODE_SELECTOR).length > 0) {
30
+ var cardCodeCleave;
31
+ var updateCardCodeCleave = function (length) {
32
+ if (cardCodeCleave) cardCodeCleave.destroy()
33
+
34
+ cardCodeCleave = new Cleave(CARD_CODE_SELECTOR, {
35
+ numericOnly: true,
36
+ blocks: [length]
37
+ })
38
+ }
39
+
40
+ updateCardCodeCleave(3)
41
+
30
42
  /* eslint-disable no-new */
31
43
  new Cleave(CARD_NUMBER_SELECTOR, {
32
44
  creditCard: true,
33
45
  onCreditCardTypeChanged: function (type) {
34
46
  $('.ccType').val(type)
47
+
48
+ if (type === 'amex') {
49
+ updateCardCodeCleave(4)
50
+ } else {
51
+ updateCardCodeCleave(3)
52
+ }
35
53
  }
36
54
  })
37
55
  /* eslint-disable no-new */
@@ -39,11 +57,6 @@ Spree.ready(function ($) {
39
57
  date: true,
40
58
  datePattern: ['m', 'Y']
41
59
  })
42
- /* eslint-disable no-new */
43
- new Cleave(CARD_CODE_SELECTOR, {
44
- numericOnly: true,
45
- blocks: [3]
46
- })
47
60
  }
48
61
 
49
62
  $('input[type="radio"][name="order[payments_attributes][][payment_method_id]"]').click(function () {
@@ -29,15 +29,17 @@ document.addEventListener('turbolinks:load', function(event) {
29
29
  // fix back button issue with different currency set
30
30
  // invalidate page if cached page has different currency then the current one
31
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)
32
+ if (typeof (SPREE_DEFAULT_CURRENCY) !== 'undefined' && typeof (SPREE_CURRENCY) !== 'undefined') {
33
+ if (SPREE_CURRENCY === SPREE_DEFAULT_CURRENCY) {
34
+ var regexAnyCurrency = new RegExp('currency=')
35
+ if (event.data.url.match(regexAnyCurrency) && !event.data.url.match(SPREE_CURRENCY)) {
36
+ Spree.setCurrency(SPREE_CURRENCY)
37
+ }
38
+ } else {
39
+ var regex = new RegExp('currency=' + SPREE_CURRENCY)
40
+ if (!event.data.url.match(regex)) {
41
+ Spree.setCurrency(SPREE_CURRENCY)
42
+ }
41
43
  }
42
44
  }
43
45
  })
@@ -0,0 +1,13 @@
1
+ document.addEventListener('turbolinks:load', () => {
2
+ const localeSelect = document.querySelectorAll('select[name=switch_to_locale]')
3
+
4
+ if (localeSelect.length) {
5
+ localeSelect.forEach((element) => {
6
+ element.addEventListener('change', () => {
7
+ Spree.clearCache()
8
+ Spree.showProgressBar()
9
+ element.form.submit()
10
+ })
11
+ })
12
+ }
13
+ })
@@ -23,13 +23,13 @@ Spree.loadCarousel = function (element, div) {
23
23
  }
24
24
 
25
25
  Spree.loadsCarouselElements = function () {
26
- $('div[data-product-carousel]').each(function (_index, element) { Spree.loadCarousel(element, this) })
26
+ $('div[data-product-carousel-taxon-id]').each(function (_index, element) { Spree.loadCarousel(element, this) })
27
27
  }
28
28
 
29
29
  document.addEventListener('turbolinks:load', function () {
30
- var homePage = $('body#home')
30
+ var carouselPresent = $('div[data-product-carousel-taxon-id]')
31
31
 
32
- if (homePage.length) {
32
+ if (carouselPresent.length) {
33
33
  // load Carousels straight away if they are in the viewport
34
34
  Spree.loadsCarouselElements()
35
35
 
@@ -99,13 +99,4 @@ Spree.ready(function ($) {
99
99
  $('.plp-overlay-ul-li').removeClass('plp-overlay-ul-li--active')
100
100
  $(this).addClass('plp-overlay-ul-li--active');
101
101
  });
102
-
103
- $('.plp-overlay-buttons .done-btn').click(function (event) {
104
- if (window.URLSearchParams) {
105
- event.preventDefault();
106
- var searchParams = new URLSearchParams(location.search);
107
- searchParams.delete('menu_open');
108
- setNewUrl(searchParams);
109
- }
110
- });
111
102
  });
@@ -0,0 +1,46 @@
1
+ Spree.ready(function() {
2
+ class PriceRangeFilter {
3
+ constructor(inputsContainer, filterButton) {
4
+ this.inputsContainer = inputsContainer
5
+ this.filterButton = filterButton
6
+
7
+ this.priceInputs = inputsContainer.querySelectorAll('input')
8
+ this.minPriceInput = inputsContainer.querySelector('input[name="min_price"]')
9
+ this.maxPriceInput = inputsContainer.querySelector('input[name="max_price"]')
10
+ }
11
+
12
+ handlePriceChange() {
13
+ this.priceInputs.forEach((priceInput) => {
14
+ priceInput.addEventListener('change', () => {
15
+ this.updatePricesForFiltering(
16
+ parseInt(this.minPriceInput.value) || 0,
17
+ parseInt(this.maxPriceInput.value) || 'Infinity'
18
+ )
19
+ })
20
+ })
21
+ }
22
+
23
+ updatePricesForFiltering(minPrice, maxPrice) {
24
+ const formattedPriceRange = `${minPrice}-${maxPrice}`
25
+ const url = new URL(this.filterButton.href)
26
+
27
+ url.searchParams.set('price', formattedPriceRange)
28
+ this.filterButton.href = `${url.pathname}${url.search}`
29
+ }
30
+ }
31
+
32
+ // we have 2 elements for filtering prices - desktop and mobile
33
+ const desktopElement = document.getElementById('filterPriceRangeDesktop')
34
+ if (desktopElement) {
35
+ const desktopFilterButton = desktopElement.querySelector('a')
36
+ const desktopPriceRangeFilter = new PriceRangeFilter(desktopElement, desktopFilterButton)
37
+ desktopPriceRangeFilter.handlePriceChange()
38
+ }
39
+
40
+ const mobileElement = document.getElementById('filterPriceRangeMobile')
41
+ if (mobileElement) {
42
+ const mobileFilterButton = document.getElementById('filterProductsButtonMobile')
43
+ const mobilePriceRangeFilter = new PriceRangeFilter(mobileElement, mobileFilterButton)
44
+ mobilePriceRangeFilter.handlePriceChange()
45
+ }
46
+ });