spree_multi_domain 3.0.4 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Versionfile +5 -0
- data/app/controllers/admin/products_controller_decorator.rb +2 -2
- data/app/controllers/products_controller_decorator.rb +4 -3
- data/app/views/admin/products/_index_headers.html.erb +1 -1
- data/app/views/shared/_google_analytics.html.erb +35 -56
- data/config/locales/en.yml +2 -1
- data/config/locales/fr.yml +9 -0
- data/config/locales/ru.yml +9 -0
- data/{lib/generators/templates/db → db}/migrate/20091202122944_create_stores.rb +0 -0
- data/{lib/generators/templates/db → db}/migrate/20091202123245_add_order_store.rb +0 -0
- data/{lib/generators/templates/db → db}/migrate/20100114020535_add_store_to_tracker.rb +0 -0
- data/{lib/generators/templates/db → db}/migrate/20100227175140_add_default_store.rb +0 -0
- data/{lib/generators/templates/db → db}/migrate/20100227180338_create_products_stores.rb +0 -0
- data/{lib/generators/templates/db → db}/migrate/20100616204303_store_id_for_taxonomies.rb +0 -0
- data/{lib/generators/templates/db → db}/migrate/20110223141800_add_email_to_stores.rb +0 -0
- data/lib/spree_multi_domain_hooks.rb +50 -14
- data/lib/tasks/install.rake +19 -0
- data/spree_multi_domain.gemspec +2 -4
- metadata +16 -13
- data/lib/generators/spree_multi_domain/install_generator.rb +0 -15
data/Versionfile
ADDED
@@ -3,9 +3,10 @@ ProductsController.class_eval do
|
|
3
3
|
|
4
4
|
private
|
5
5
|
def can_show_product
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
@product ||= Product.find_by_permalink!(params[:id])
|
7
|
+
if @product.stores.empty? || @product.stores.include?(@site)
|
8
|
+
render :file => "public/404.html", :status => 404
|
9
|
+
end
|
9
10
|
end
|
10
11
|
|
11
12
|
end
|
@@ -1 +1 @@
|
|
1
|
-
<th><%=
|
1
|
+
<th><%= t("stores") %></th>
|
@@ -1,62 +1,41 @@
|
|
1
1
|
<% if tracker = current_tracker %>
|
2
2
|
|
3
3
|
<script type="text/javascript">
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
var _gaq = _gaq || [];
|
5
|
+
_gaq.push(['_setAccount', '<%= tracker.analytics_id -%>']);
|
6
|
+
_gaq.push(['_trackPageview']);
|
7
|
+
|
8
|
+
<%- if flash[:commerce_tracking] -%>
|
9
|
+
|
10
|
+
_gaq.push(['_addTrans',
|
11
|
+
'<%= "#{"QA-" if request.server_name =~ /^(dev.|localhost)/ }#{@order.number}" %>', // order ID - required
|
12
|
+
'<%= tracker.store.name -%>', // affiliation or store name
|
13
|
+
'<%= @order.total -%>', // total - required
|
14
|
+
'<%= @order.adjustments.tax.sum(:amount).to_s -%>', // tax
|
15
|
+
'<%= @order.adjustments.shipping.sum(:amount).to_s -%>', // shipping
|
16
|
+
'<%= @order.ship_address.city if @order.ship_address -%>', // city
|
17
|
+
'<%= @order.ship_address.state.name if @order.ship_address and @order.ship_address.state -%>', // state or province
|
18
|
+
'<%= @order.ship_address.country.name if @order.ship_address && @order.ship_address.country -%>' // country
|
19
|
+
]);
|
7
20
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
21
|
+
<%- @order.line_items.each do |line_item| -%>
|
22
|
+
_gaq.push(['_addItem',
|
23
|
+
'<%= "#{"QA-" if request.server_name =~ /^(dev.|localhost)/ }#{@order.number}" %>', // order ID - required
|
24
|
+
'<%= line_item.variant.sku -%>', // SKU/code - required
|
25
|
+
'<%= line_item.variant.product.name -%>', // product name
|
26
|
+
'-', // category or variation
|
27
|
+
'<%= line_item.price -%>', // unit price - required
|
28
|
+
'<%= line_item.quantity -%>' // quantity - required
|
29
|
+
]);
|
30
|
+
<%- end -%>
|
31
|
+
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
|
32
|
+
|
33
|
+
<%- end -%>
|
34
|
+
|
35
|
+
(function() {
|
36
|
+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
37
|
+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
38
|
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
39
|
+
})();
|
12
40
|
</script>
|
13
|
-
|
14
|
-
<% if @analytics_page %>
|
15
|
-
<script type="text/javascript">document.strTrackPageView="<%= @analytics_page %>";</script>
|
16
|
-
<% end %>
|
17
|
-
|
18
|
-
<!-- Primary Tracking -->
|
19
|
-
<script type="text/javascript" src="/javascripts/VKIga.js"></script>
|
20
|
-
|
21
|
-
<% if flash[:commerce_tracking] %>
|
22
|
-
<script type="text/javascript">
|
23
|
-
|
24
|
-
try {
|
25
|
-
// report e-commerce transaction information when applicable
|
26
|
-
/*
|
27
|
-
* transaction ID - prepend dev/QA sites with 'QA-'
|
28
|
-
* affiliate - always empty string
|
29
|
-
* total - order total including tax & shipping
|
30
|
-
* tax
|
31
|
-
* shipping
|
32
|
-
* ship-to city
|
33
|
-
* ship-to province
|
34
|
-
* ship-to country
|
35
|
-
*/
|
36
|
-
VKIPageTracker._addTrans(
|
37
|
-
"<%= "#{"QA-" if request.server_name =~ /^(dev.|localhost)/ }#{@order.number}" %>",
|
38
|
-
"",
|
39
|
-
"<%= @order.total %>",
|
40
|
-
"<%= @order.adjustments.tax.sum(:amount).to_s %>",
|
41
|
-
"<%= @order.adjustments.shipping.sum(:amount).to_s %>",
|
42
|
-
"<%= @order.ship_address.city if @order.ship_address %>",
|
43
|
-
"<%= @order.ship_address.state.name if @order.ship_address && @order.ship_address.state %><%= @order.ship_address.state_name if @order.ship_address && @order.ship_address.state.nil? %>",
|
44
|
-
"<%= @order.ship_address.country.name if @order.ship_address && @order.ship_address.country %>"
|
45
|
-
);
|
46
|
-
<% @order.line_items.each do |line_item| -%>
|
47
|
-
VKIPageTracker._addItem(
|
48
|
-
"<%= "#{"QA-" if request.server_name =~ /^(dev.|localhost)/ }#{@order.number}" %>",
|
49
|
-
"<%= line_item.variant.sku %>",
|
50
|
-
"<%= line_item.variant.product.name %>",
|
51
|
-
"-",
|
52
|
-
"<%= line_item.price %>",
|
53
|
-
"<%= line_item.quantity %>"
|
54
|
-
);
|
55
|
-
<% end -%>
|
56
|
-
VKIPageTracker._trackTrans();
|
57
|
-
} catch (err) {
|
58
|
-
}
|
59
|
-
|
60
|
-
</script>
|
61
|
-
<% end %>
|
62
41
|
<% end %>
|
data/config/locales/en.yml
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,19 +1,55 @@
|
|
1
|
-
|
1
|
+
Deface::Override.new(
|
2
|
+
:virtual_path => "admin/products/index",
|
3
|
+
:name => "multi_domain_admin_products_index_headers",
|
4
|
+
:insert_before => "[data-hook='admin_products_index_header_actions']",
|
5
|
+
:partial => "admin/products/index_headers",
|
6
|
+
:disabled => false)
|
2
7
|
|
3
|
-
|
4
|
-
|
5
|
-
|
8
|
+
Deface::Override.new(
|
9
|
+
:virtual_path => "admin/products/index",
|
10
|
+
:name => "multi_domain_admin_products_index_rows",
|
11
|
+
:insert_before => "[data-hook='admin_products_index_row_actions']",
|
12
|
+
:partial => "admin/products/index_rows",
|
13
|
+
:disabled => false)
|
14
|
+
|
15
|
+
Deface::Override.new(
|
16
|
+
:virtual_path => "admin/products/index",
|
17
|
+
:name => "multi_domain_admin_products_index_search",
|
18
|
+
:insert_top => "[data-hook='admin_products_index_search']",
|
19
|
+
:partial => "admin/products/index_search_fields",
|
20
|
+
:disabled => false)
|
6
21
|
|
7
|
-
|
22
|
+
Deface::Override.new(
|
23
|
+
:virtual_path => "admin/products/_form",
|
24
|
+
:name => "multi_domain_admin_product_form_meta",
|
25
|
+
:insert_bottom => "[data-hook='admin_product_form_meta']",
|
26
|
+
:partial => "admin/products/stores",
|
27
|
+
:disabled => false)
|
8
28
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
29
|
+
Deface::Override.new(
|
30
|
+
:virtual_path => "admin/trackers/index",
|
31
|
+
:name => "multi_domain_admin_trackers_index_headers",
|
32
|
+
:insert_before => "[data-hook='admin_trackers_index_headers'] th:last",
|
33
|
+
:text => "<th><%= I18n.t(:store) %></th>",
|
34
|
+
:disabled => false)
|
14
35
|
|
15
|
-
|
16
|
-
|
17
|
-
|
36
|
+
Deface::Override.new(
|
37
|
+
:virtual_path => "admin/trackers/index",
|
38
|
+
:name => "multi_domain_admin_trackers_index_rows",
|
39
|
+
:insert_before => "[data-hook='admin_trackers_index_rows'] td:last",
|
40
|
+
:partial => "admin/trackers/index_rows",
|
41
|
+
:disabled => false)
|
18
42
|
|
19
|
-
|
43
|
+
Deface::Override.new(
|
44
|
+
:virtual_path => "admin/trackers/_form",
|
45
|
+
:name => "multi_domain_additional_tracker_fields",
|
46
|
+
:replace => "[data-hook='additional_tracker_fields']",
|
47
|
+
:partial => "admin/trackers/store",
|
48
|
+
:disabled => false)
|
49
|
+
|
50
|
+
Deface::Override.new(
|
51
|
+
:virtual_path => "admin/configurations/index",
|
52
|
+
:name => "multi_domain_admin_configurations_menu",
|
53
|
+
:insert_bottom => "[data-hook='admin_configurations_menu']",
|
54
|
+
:text => "<%= configurations_menu_item(I18n.t('stores_admin'), admin_stores_url, I18n.t('manage_stores')) %>",
|
55
|
+
:disabled => false)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
namespace :spree_multi_domain do
|
2
|
+
desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
|
3
|
+
task :install do
|
4
|
+
Rake::Task['spree_multi_domain:install:migrations'].invoke
|
5
|
+
end
|
6
|
+
|
7
|
+
namespace :install do
|
8
|
+
desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
|
9
|
+
task :migrations do
|
10
|
+
source = File.join(File.dirname(__FILE__), '..', '..', 'db')
|
11
|
+
destination = File.join(Rails.root, 'db')
|
12
|
+
puts "INFO: Mirroring assets from #{source} to #{destination}"
|
13
|
+
Spree::FileUtilz.mirror_files(source, destination)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
data/spree_multi_domain.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.platform = Gem::Platform::RUBY
|
3
3
|
s.name = 'spree_multi_domain'
|
4
|
-
s.version = '3.0.
|
4
|
+
s.version = '3.0.5'
|
5
5
|
s.summary = 'Adds multiple site support to Spree'
|
6
6
|
s.description = 'Multiple Spree stores on different domains - single unified backed for processing orders.'
|
7
7
|
s.required_ruby_version = '>= 1.8.7'
|
@@ -16,7 +16,5 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.require_path = 'lib'
|
17
17
|
s.requirements << 'none'
|
18
18
|
|
19
|
-
s.
|
20
|
-
|
21
|
-
s.add_dependency('spree_core', '>= 0.40.0')
|
19
|
+
s.add_dependency('spree_core', '>= 0.60.0')
|
22
20
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 3
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 3.0.
|
8
|
+
- 5
|
9
|
+
version: 3.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Brian Quinn
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-05-29 00:00:00 +04:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -28,9 +28,9 @@ dependencies:
|
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
segments:
|
30
30
|
- 0
|
31
|
-
-
|
31
|
+
- 60
|
32
32
|
- 0
|
33
|
-
version: 0.
|
33
|
+
version: 0.60.0
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
36
|
description: Multiple Spree stores on different domains - single unified backed for processing orders.
|
@@ -45,6 +45,7 @@ files:
|
|
45
45
|
- .gitignore
|
46
46
|
- README.md
|
47
47
|
- Rakefile
|
48
|
+
- Versionfile
|
48
49
|
- app/controllers/admin/products_controller_decorator.rb
|
49
50
|
- app/controllers/admin/stores_controller.rb
|
50
51
|
- app/controllers/products_controller_decorator.rb
|
@@ -65,18 +66,20 @@ files:
|
|
65
66
|
- app/views/admin/trackers/_store.html.erb
|
66
67
|
- app/views/shared/_google_analytics.html.erb
|
67
68
|
- config/locales/en.yml
|
69
|
+
- config/locales/fr.yml
|
70
|
+
- config/locales/ru.yml
|
68
71
|
- config/routes.rb
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
- lib/generators/templates/db/migrate/20110223141800_add_email_to_stores.rb
|
72
|
+
- db/migrate/20091202122944_create_stores.rb
|
73
|
+
- db/migrate/20091202123245_add_order_store.rb
|
74
|
+
- db/migrate/20100114020535_add_store_to_tracker.rb
|
75
|
+
- db/migrate/20100227175140_add_default_store.rb
|
76
|
+
- db/migrate/20100227180338_create_products_stores.rb
|
77
|
+
- db/migrate/20100616204303_store_id_for_taxonomies.rb
|
78
|
+
- db/migrate/20110223141800_add_email_to_stores.rb
|
77
79
|
- lib/spree/search/multi_domain.rb
|
78
80
|
- lib/spree_multi_domain.rb
|
79
81
|
- lib/spree_multi_domain_hooks.rb
|
82
|
+
- lib/tasks/install.rake
|
80
83
|
- spree_multi_domain.gemspec
|
81
84
|
has_rdoc: true
|
82
85
|
homepage: http://spreecommerce.com
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module SpreeMultiDomain
|
2
|
-
module Generators
|
3
|
-
class InstallGenerator < Rails::Generators::Base
|
4
|
-
source_root File.expand_path("../../templates", __FILE__)
|
5
|
-
|
6
|
-
desc "Configures your Rails application for use with spree_multi_domain"
|
7
|
-
|
8
|
-
def copy_migrations
|
9
|
-
directory "db"
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|