spree_piwik 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +22 -1
- data/app/models/spree/piwik/client.rb +13 -2
- data/app/views/spree/_ecommerce_order.html.erb +8 -0
- data/app/views/spree/_piwik.html.erb +6 -1
- data/doc/spree_piwik.png +0 -0
- data/lib/generators/spree_piwik/install/install_generator.rb +3 -21
- data/lib/generators/templates/spree_piwik.rb +4 -0
- data/spec/features/order_process_spec.rb +20 -0
- data/spec/features/visit_product_page_spec.rb +2 -9
- data/spec/fixtures/completed_order.js +30 -0
- data/spec/models/spree/piwik/client_spec.rb +21 -0
- data/spree_piwik.gemspec +14 -13
- metadata +85 -44
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2U5ZGU3MmIzMzA5MjcwMDQ1MGVjNmQzNWFmNzBlMDJlYjBhNDQyYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDI0NzM1NGU4M2ExMzZjMzVjMjc4YzZlOWI3ZDFmOTI1NDgzZWU0OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDg0ZjI5NDQ3MzBmYjM1ODJiNTM2ZDQyYmQ1MDdiZDdhZjcxZGY4OGRiNmE1
|
10
|
+
YmY4MWE1NTczMGVkNDZhYTBiOWMzM2Y0MWVhMDdhZTU0ZTNhMjg0YjJhMGJh
|
11
|
+
MzExYzMyZDU1ZjM3MWQ4NzU5NzQ1ODlhOGY2ZWVlNTExMmQwNDY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmQwMWMxNmM5OGI5ZTlkNDE0MzNlODVhODQxOTg1YjVhNzcxODQzZWYzYzY2
|
14
|
+
Zjk3YzYyMTlmZGY4YjJmNmJiY2I2MjgyMjNjNjJhM2YxYTYyZWQ0NjI2N2Rm
|
15
|
+
MTJjMDdkNmU5MzNhMGVhMTRiZmFlMzk0MjAzMTA1OGFmZGRiYzI=
|
data/README.md
CHANGED
@@ -25,6 +25,23 @@ bundle
|
|
25
25
|
bundle exec rails g spree_piwik:install
|
26
26
|
```
|
27
27
|
|
28
|
+
Add your Piwik URL and site-id to the `config/initializers/spree_piwik.rb`
|
29
|
+
|
30
|
+
For example:
|
31
|
+
```ruby
|
32
|
+
Spree::Piwik::Config[:piwik_url] = "piwik.example.com"
|
33
|
+
Spree::Piwik::Config[:piwik_id] = 1337
|
34
|
+
|
35
|
+
```
|
36
|
+
Will use http(s)://piwik.example.com/ as url for your Piwik. And track
|
37
|
+
stats for the site that has the id 1337 in Piwik.
|
38
|
+
|
39
|
+
|
40
|
+
Screenshot
|
41
|
+
----------
|
42
|
+
|
43
|
+
![Screenshot of the Ecommerce functionality in action with this extension](doc/spree_piwik.png).
|
44
|
+
|
28
45
|
Testing
|
29
46
|
-------
|
30
47
|
|
@@ -38,4 +55,8 @@ bundle exec rake
|
|
38
55
|
When testing your applications integration with this extension you may use it's factories.
|
39
56
|
Simply add this require statement to your spec_helper:
|
40
57
|
|
41
|
-
|
58
|
+
|
59
|
+
License
|
60
|
+
-------
|
61
|
+
|
62
|
+
SpreePiwik is released under the [New BSD License](https://github.com/spree/spree/blob/master/license.md) similar to Spree.
|
@@ -18,11 +18,22 @@ module Spree
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def ecommerce_items
|
21
|
-
@order.line_items.map
|
21
|
+
@order.line_items.map do |li|
|
22
|
+
Spree::Piwik::LineItem.from_product_ish(li)
|
23
|
+
end
|
22
24
|
end
|
23
25
|
|
24
26
|
def track_cart_update?
|
25
|
-
|
27
|
+
order? && @order.cart?
|
28
|
+
end
|
29
|
+
|
30
|
+
def track_ecommerce_order?
|
31
|
+
order? && @order.complete?
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
def order?
|
36
|
+
!@order.nil?
|
26
37
|
end
|
27
38
|
end
|
28
39
|
end
|
@@ -7,9 +7,14 @@
|
|
7
7
|
<%- if piwik_client.product %>
|
8
8
|
<%= render partial: 'spree/ecommerce_view', locals: { product: piwik_client.product } %>
|
9
9
|
<% end %>
|
10
|
-
<% if piwik_client.
|
10
|
+
<% if piwik_client.order %>
|
11
11
|
<%= render :partial => 'spree/ecommerce_item', :collection => piwik_client.ecommerce_items %>
|
12
|
+
<% end %>
|
13
|
+
<% if piwik_client.track_cart_update? %>
|
12
14
|
_paq.push(['trackEcommerceCartUpdate', <%= piwik_client.order.total %>]);
|
15
|
+
<% end %>
|
16
|
+
<% if piwik_client.track_ecommerce_order? %>
|
17
|
+
<%= render :partial => 'spree/ecommerce_order', locals: { order: piwik_client.order } %>
|
13
18
|
<% end %>
|
14
19
|
_paq.push(['trackPageView']);
|
15
20
|
_paq.push(['enableLinkTracking']);
|
data/doc/spree_piwik.png
ADDED
Binary file
|
@@ -2,30 +2,12 @@
|
|
2
2
|
module SpreePiwik
|
3
3
|
module Generators
|
4
4
|
class InstallGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path("../../../templates", __FILE__)
|
5
6
|
|
6
7
|
class_option :auto_run_migrations, :type => :boolean, :default => false
|
7
8
|
|
8
|
-
def
|
9
|
-
|
10
|
-
append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/spree_piwik\n"
|
11
|
-
end
|
12
|
-
|
13
|
-
def add_stylesheets
|
14
|
-
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/spree_piwik\n", :before => /\*\//, :verbose => true
|
15
|
-
inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/spree_piwik\n", :before => /\*\//, :verbose => true
|
16
|
-
end
|
17
|
-
|
18
|
-
def add_migrations
|
19
|
-
run 'bundle exec rake railties:install:migrations FROM=spree_piwik'
|
20
|
-
end
|
21
|
-
|
22
|
-
def run_migrations
|
23
|
-
run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask 'Would you like to run the migrations now? [Y/n]')
|
24
|
-
if run_migrations
|
25
|
-
run 'bundle exec rake db:migrate'
|
26
|
-
else
|
27
|
-
puts 'Skipping rake db:migrate, don\'t forget to run it!'
|
28
|
-
end
|
9
|
+
def copy_initializer
|
10
|
+
template "spree_piwik.rb", "config/initializers/spree_piwik.rb"
|
29
11
|
end
|
30
12
|
end
|
31
13
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
feature "OrderProcess", type: :feature do
|
4
|
+
scenario "An anonymous gets a checkout confirmation" do
|
5
|
+
@order = create(:completed_order_with_totals, number: 'R1337', line_items_count: 2)
|
6
|
+
@order.products.first.update_attributes(name: "RoR Shirt")
|
7
|
+
@order.products.second.update_attributes(name: "RoR Sticker")
|
8
|
+
|
9
|
+
# FactoryGirl is not very suited for these setups.
|
10
|
+
# So we stick with the default of 100 for shipment 0 for tax.
|
11
|
+
# Sanity check.
|
12
|
+
expect(@order.ship_total).to eq 100.0
|
13
|
+
expect(@order.tax_total).to eq 0.0
|
14
|
+
|
15
|
+
visit "orders/#{@order.number}/token/#{@order.guest_token}"
|
16
|
+
|
17
|
+
tag_component = PiwikTagComponent.new
|
18
|
+
expect(tag_component.as_ecma).to eq fixture("completed_order.js")
|
19
|
+
end
|
20
|
+
end
|
@@ -6,9 +6,7 @@ feature "TrackingTagForProduct", type: :feature do
|
|
6
6
|
# So that I can allow Piwik to process reports on SKU and products.
|
7
7
|
scenario "An anonymous user is tracked on a product page" do
|
8
8
|
@product = create(:product, sku: "SKU-1", name: "RoR Shirt")
|
9
|
-
|
10
|
-
visit "/"
|
11
|
-
click_link(@product.name)
|
9
|
+
visit "/products/#{@product.slug}"
|
12
10
|
|
13
11
|
# Sanity check
|
14
12
|
expect(page).to have_content @product.name
|
@@ -30,12 +28,7 @@ feature "TrackingTagForProduct", type: :feature do
|
|
30
28
|
]
|
31
29
|
@product = create(:product, sku: "SKU-1", name: "RoR Shirt", taxons: taxons)
|
32
30
|
|
33
|
-
|
34
|
-
visit "/"
|
35
|
-
click_link(@product.name)
|
36
|
-
|
37
|
-
# Sanity check
|
38
|
-
expect(page).to have_content @product.name
|
31
|
+
visit "/products/#{@product.slug}"
|
39
32
|
|
40
33
|
tag_component = PiwikTagComponent.new
|
41
34
|
expect(tag_component).to be_in_html
|
@@ -0,0 +1,30 @@
|
|
1
|
+
var _paq = _paq || [];
|
2
|
+
(function(){ var u=(('https:' == document.location.protocol) ? 'https://example.com/' : 'http://example.com/');
|
3
|
+
_paq.push(['setSiteId', 0]);
|
4
|
+
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
5
|
+
_paq.push(['addEcommerceItem',
|
6
|
+
'SKU-1',
|
7
|
+
'RoR Shirt',
|
8
|
+
[],
|
9
|
+
10.0,
|
10
|
+
1
|
11
|
+
]);
|
12
|
+
_paq.push(['addEcommerceItem',
|
13
|
+
'SKU-2',
|
14
|
+
'RoR Sticker',
|
15
|
+
[],
|
16
|
+
10.0,
|
17
|
+
1
|
18
|
+
]);
|
19
|
+
_paq.push(['trackEcommerceOrder',
|
20
|
+
'R1337',
|
21
|
+
120.0,
|
22
|
+
20.0,
|
23
|
+
0.0,
|
24
|
+
100.0,
|
25
|
+
false
|
26
|
+
]);
|
27
|
+
_paq.push(['trackPageView']);
|
28
|
+
_paq.push(['enableLinkTracking']);
|
29
|
+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'piwik.js';
|
30
|
+
s.parentNode.insertBefore(g,s); })();
|
@@ -68,4 +68,25 @@ describe Spree::Piwik::Client, type: :model do
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
71
|
+
|
72
|
+
describe "#track_ecommerce_order?" do
|
73
|
+
context 'when order with state complete is set' do
|
74
|
+
it 'is true' do
|
75
|
+
order = double(:order, complete?: true)
|
76
|
+
expect(Spree::Piwik::Client.new(order: order).track_ecommerce_order?).to eq true
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
context 'when order state is not complete' do
|
81
|
+
it 'is false' do
|
82
|
+
order = double(:order, complete?: false)
|
83
|
+
expect(Spree::Piwik::Client.new(order: order).track_ecommerce_order?).to eq false
|
84
|
+
end
|
85
|
+
end
|
86
|
+
context 'when order is empty' do
|
87
|
+
it 'is false' do
|
88
|
+
expect(subject.track_ecommerce_order?).to eq false
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
71
92
|
end
|
data/spree_piwik.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'spree_piwik'
|
5
|
-
s.version = '0.0
|
5
|
+
s.version = '1.0.0'
|
6
6
|
s.summary = 'Adds piwik tracking with Ecommerce tracking'
|
7
7
|
s.description = File.read(File.join(File.dirname(__FILE__), 'README.md'))
|
8
8
|
s.required_ruby_version = '>= 1.9.3'
|
@@ -10,26 +10,27 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.author = 'Bèr Kessels'
|
11
11
|
s.email = 'ber@berk.es'
|
12
12
|
s.homepage = 'http://berk.es'
|
13
|
+
s.license = 'BSD-3'
|
13
14
|
|
14
15
|
s.files = `git ls-files`.split("\n")
|
15
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
17
|
s.require_path = 'lib'
|
17
18
|
s.requirements << 'none'
|
18
19
|
|
19
|
-
s.add_dependency 'spree_core', '~> 2.3
|
20
|
+
s.add_dependency 'spree_core', '~> 2.3'
|
20
21
|
|
21
|
-
s.add_development_dependency 'therubyracer'
|
22
|
+
s.add_development_dependency 'therubyracer', '~> 0.12'
|
22
23
|
s.add_development_dependency 'capybara', '~> 2.4'
|
23
|
-
s.add_development_dependency 'coffee-rails'
|
24
|
-
s.add_development_dependency 'database_cleaner'
|
24
|
+
s.add_development_dependency 'coffee-rails', '~> 4.1'
|
25
|
+
s.add_development_dependency 'database_cleaner', '~> 1.4'
|
25
26
|
s.add_development_dependency 'factory_girl', '~> 4.5'
|
26
|
-
s.add_development_dependency 'ffaker'
|
27
|
+
s.add_development_dependency 'ffaker', '~> 1'
|
27
28
|
s.add_development_dependency 'rspec-rails', '~> 3.1'
|
28
|
-
s.add_development_dependency 'spring-commands-rspec'
|
29
|
-
s.add_development_dependency 'rkelly-remix'
|
30
|
-
s.add_development_dependency 'launchy'
|
31
|
-
s.add_development_dependency 'sass-rails', '~> 4.0
|
32
|
-
s.add_development_dependency 'selenium-webdriver'
|
33
|
-
s.add_development_dependency 'simplecov'
|
34
|
-
s.add_development_dependency 'sqlite3'
|
29
|
+
s.add_development_dependency 'spring-commands-rspec', '~> 1'
|
30
|
+
s.add_development_dependency 'rkelly-remix', '~> 0'
|
31
|
+
s.add_development_dependency 'launchy', '~> 2.4'
|
32
|
+
s.add_development_dependency 'sass-rails', '~> 4.0'
|
33
|
+
s.add_development_dependency 'selenium-webdriver', '~> 2.44'
|
34
|
+
s.add_development_dependency 'simplecov', '~> 0'
|
35
|
+
s.add_development_dependency 'sqlite3', '~> 1.3'
|
35
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_piwik
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bèr Kessels
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.3
|
19
|
+
version: '2.3'
|
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: 2.3
|
26
|
+
version: '2.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: therubyracer
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '0.12'
|
34
34
|
type: :development
|
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: '0'
|
40
|
+
version: '0.12'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: capybara
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,30 +56,30 @@ dependencies:
|
|
56
56
|
name: coffee-rails
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '4.1'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '4.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: database_cleaner
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '1.4'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '1.4'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: factory_girl
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,16 +98,16 @@ dependencies:
|
|
98
98
|
name: ffaker
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '1'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '1'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec-rails
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,100 +126,100 @@ dependencies:
|
|
126
126
|
name: spring-commands-rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ~>
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '1'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ~>
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
138
|
+
version: '1'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rkelly-remix
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ~>
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ~>
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: launchy
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ~>
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
159
|
+
version: '2.4'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ~>
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '2.4'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: sass-rails
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - ~>
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 4.0
|
173
|
+
version: '4.0'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - ~>
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 4.0
|
180
|
+
version: '4.0'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: selenium-webdriver
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- -
|
185
|
+
- - ~>
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: '
|
187
|
+
version: '2.44'
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- -
|
192
|
+
- - ~>
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: '
|
194
|
+
version: '2.44'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: simplecov
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- -
|
199
|
+
- - ~>
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0'
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- -
|
206
|
+
- - ~>
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: sqlite3
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- -
|
213
|
+
- - ~>
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: '
|
215
|
+
version: '1.3'
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
|
-
- -
|
220
|
+
- - ~>
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: '
|
222
|
+
version: '1.3'
|
223
223
|
description: ! 'SpreePiwik
|
224
224
|
|
225
225
|
==========
|
@@ -265,6 +265,34 @@ description: ! 'SpreePiwik
|
|
265
265
|
```
|
266
266
|
|
267
267
|
|
268
|
+
Add your Piwik URL and site-id to the `config/initializers/spree_piwik.rb`
|
269
|
+
|
270
|
+
|
271
|
+
For example:
|
272
|
+
|
273
|
+
```ruby
|
274
|
+
|
275
|
+
Spree::Piwik::Config[:piwik_url] = "piwik.example.com"
|
276
|
+
|
277
|
+
Spree::Piwik::Config[:piwik_id] = 1337
|
278
|
+
|
279
|
+
|
280
|
+
```
|
281
|
+
|
282
|
+
Will use http(s)://piwik.example.com/ as url for your Piwik. And track
|
283
|
+
|
284
|
+
stats for the site that has the id 1337 in Piwik.
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
Screenshot
|
289
|
+
|
290
|
+
----------
|
291
|
+
|
292
|
+
|
293
|
+
![Screenshot of the Ecommerce functionality in action with this extension](doc/spree_piwik.png).
|
294
|
+
|
295
|
+
|
268
296
|
Testing
|
269
297
|
|
270
298
|
-------
|
@@ -290,7 +318,14 @@ description: ! 'SpreePiwik
|
|
290
318
|
Simply add this require statement to your spec_helper:
|
291
319
|
|
292
320
|
|
293
|
-
|
321
|
+
|
322
|
+
License
|
323
|
+
|
324
|
+
-------
|
325
|
+
|
326
|
+
|
327
|
+
SpreePiwik is released under the [New BSD License](https://github.com/spree/spree/blob/master/license.md)
|
328
|
+
similar to Spree.
|
294
329
|
|
295
330
|
'
|
296
331
|
email: ber@berk.es
|
@@ -315,6 +350,7 @@ files:
|
|
315
350
|
- app/models/spree/piwik_configuration.rb
|
316
351
|
- app/overrides/add_piwik_tracking_tag_to_layout.rb
|
317
352
|
- app/views/spree/_ecommerce_item.html.erb
|
353
|
+
- app/views/spree/_ecommerce_order.html.erb
|
318
354
|
- app/views/spree/_ecommerce_view.html.erb
|
319
355
|
- app/views/spree/_piwik.html.erb
|
320
356
|
- bin/rails
|
@@ -322,12 +358,16 @@ files:
|
|
322
358
|
- config/locales/en.yml
|
323
359
|
- config/routes.rb
|
324
360
|
- config/spring.rb
|
361
|
+
- doc/spree_piwik.png
|
325
362
|
- lib/generators/spree_piwik/install/install_generator.rb
|
363
|
+
- lib/generators/templates/spree_piwik.rb
|
326
364
|
- lib/spree/piwik/engine.rb
|
327
365
|
- lib/spree_piwik.rb
|
328
366
|
- spec/features/interact_with_cart_spec.rb
|
367
|
+
- spec/features/order_process_spec.rb
|
329
368
|
- spec/features/visit_home_pages_spec.rb
|
330
369
|
- spec/features/visit_product_page_spec.rb
|
370
|
+
- spec/fixtures/completed_order.js
|
331
371
|
- spec/fixtures/empty_cart.js
|
332
372
|
- spec/fixtures/index_example_com.js
|
333
373
|
- spec/fixtures/multiple_products_in_cart.js
|
@@ -344,7 +384,8 @@ files:
|
|
344
384
|
- spec/support/helpers/fixture_helpers.rb
|
345
385
|
- spree_piwik.gemspec
|
346
386
|
homepage: http://berk.es
|
347
|
-
licenses:
|
387
|
+
licenses:
|
388
|
+
- BSD-3
|
348
389
|
metadata: {}
|
349
390
|
post_install_message:
|
350
391
|
rdoc_options: []
|