spree_frontend 3.3.0.rc2 → 3.3.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a518b3fbfbac0cb85b929063767fd585fcdbc6b
4
- data.tar.gz: 6adce459b71e99b0e8f27a2a29ae9093c6453321
3
+ metadata.gz: 3cae9b2ff3fcd6fa11abcfdc743477e2dcd4eea4
4
+ data.tar.gz: b5de683c69681772147d7750bca160981dd7a8c0
5
5
  SHA512:
6
- metadata.gz: c4395c713444b940fe67dea5a149e4a32215c210ca95a0db1c8c1cc69935b5177396d371cfc914ac9640419a83f9a1fbfe4f1e6aa3103b5286dd42e219d8474d
7
- data.tar.gz: ef7b18f157fb06feeeaab065195f7def16c34ab909256515ad2116c8849112c9725a58d36fd93e41fa7f1ffdc34b4599b75c70c0335476b71eb702290092408f
6
+ metadata.gz: 4e397ef7b99b29e88e684acaa543715f0e19a2b66403e602ae031ae26a0601beb44afbaa76bfd32742c1320313821e61e15bfde54cfd9019102af9243fd2f49f
7
+ data.tar.gz: 72123bbdc4164fd371dd3fc867b346895fa0a68cce0b826938220a7aae61ae93bebf1a3e48eeb53ef6b9496c4aa76b23dacb5cd1c38fff5f0645c875ff1108e9
@@ -9,6 +9,7 @@
9
9
  </head>
10
10
  <body class="<%= body_class %>" id="<%= @body_id || 'default' %>" data-hook="body">
11
11
  <%= render partial: 'spree/shared/google_analytics.js' %>
12
+ <%= render partial: 'spree/shared/trackers/segment/initializer.js' %>
12
13
  <%= render partial: 'spree/shared/header' %>
13
14
 
14
15
  <div class="container">
@@ -1,5 +1,8 @@
1
- <% content_for :google_analytics do %>
2
- <% if order_just_completed?(@order) %>
1
+ <% if order_just_completed?(@order) %>
2
+ <%= render partial: 'spree/shared/trackers/segment/order_complete.js',
3
+ formats: :js,
4
+ locals: { order: @order } %>
5
+ <% content_for :google_analytics do %>
3
6
  <%= render partial: 'spree/shared/google_purchase.js', locals: { order: @order } %>
4
7
  <% end %>
5
8
  <% end %>
@@ -1,4 +1,4 @@
1
- <% if tracker = Spree::Tracker.current %>
1
+ <% if tracker = Spree::Tracker.current(:google_analytics) %>
2
2
  <script>
3
3
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4
4
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@@ -0,0 +1,8 @@
1
+ <% if tracker = Spree::Tracker.current(:segment) %>
2
+ <script>
3
+ !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.1.0";
4
+ analytics.load('<%= tracker.analytics_id %>');
5
+ analytics.page()
6
+ }}();
7
+ </script>
8
+ <% end %>
@@ -0,0 +1,24 @@
1
+ <script>
2
+ if (typeof analytics !== 'undefined') {
3
+ analytics.track('Order Completed', {
4
+ order_id: '<%= order.id %>',
5
+ total: '<%= order.total %>',
6
+ shipping: '<%= order.shipment_total %>',
7
+ tax: '<%= order.additional_tax_total %>',
8
+ discount: '<%= order.promo_total %>',
9
+ coupon: '<%= order.promo_code %>',
10
+ currency: '<%= order.currency %>',
11
+ products: [
12
+ <% order.line_items.each do |line_item| %>
13
+ {
14
+ product_id: '<%= line_item.product.id %>',
15
+ sku: '<%= line_item.variant.sku %>',
16
+ name: '<%= line_item.product.name %>',
17
+ price: '<%= line_item.price %>',
18
+ quantity: '<%= line_item.quantity %>'
19
+ },
20
+ <% end %>
21
+ ]
22
+ });
23
+ }
24
+ </script>
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
 
25
25
  s.add_dependency 'bootstrap-sass', '>= 3.3.5.1', '< 3.4'
26
26
  s.add_dependency 'canonical-rails', '~> 0.2.0'
27
- s.add_dependency 'jquery-rails', '~> 4.1'
27
+ s.add_dependency 'jquery-rails', '~> 4.3'
28
28
 
29
29
  s.add_development_dependency 'capybara-accessible'
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0.rc2
4
+ version: 3.3.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-28 00:00:00.000000000 Z
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.3.0.rc2
19
+ version: 3.3.0.rc3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.3.0.rc2
26
+ version: 3.3.0.rc3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.3.0.rc2
33
+ version: 3.3.0.rc3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.3.0.rc2
40
+ version: 3.3.0.rc3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootstrap-sass
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '4.1'
81
+ version: '4.3'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '4.1'
88
+ version: '4.3'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: capybara-accessible
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -216,6 +216,8 @@ files:
216
216
  - app/views/spree/shared/_taxonomies.html.erb
217
217
  - app/views/spree/shared/_translations.html.erb
218
218
  - app/views/spree/shared/forbidden.html.erb
219
+ - app/views/spree/shared/trackers/segment/_initializer.js.erb
220
+ - app/views/spree/shared/trackers/segment/_order_complete.js.erb
219
221
  - app/views/spree/shared/unauthorized.html.erb
220
222
  - app/views/spree/taxons/_taxon.html.erb
221
223
  - app/views/spree/taxons/show.html.erb