GithubHelp home page GithubHelp logo

spree-contrib / spree-multi-domain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from railsdog/spree-multi-domain

194.0 194.0 191.0 427 KB

Multiple Spree stores on different domains - single unified backed for processing orders

Home Page: https://guides.spreecommerce.org

Ruby 94.34% HTML 5.66%

spree-multi-domain's People

Contributors

agnieszkajacek avatar ajjahn avatar aplegatt avatar bbonislawski avatar bdq avatar damianlegawiec avatar jdutil avatar joshcheek avatar jumph4x avatar ka8725 avatar mafi88 avatar majkamajka avatar mauazua avatar montebrown avatar neweblog avatar nnande avatar onedanshow avatar paulcc avatar peterberkenbosch avatar pmilewski avatar przemosk avatar pszyszkaspark avatar radar avatar rickygu avatar romul avatar safarista avatar schmijos avatar schof avatar senjai avatar vygovskysergey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spree-multi-domain's Issues

Display store-association of Taxonomy in Store

Having 5 stores with pretty similar Taxonomys causing problem with selecting the right taxonomy while editing products.

lets assume, we have 5 different fashion-shops, but every shop is having a taxonomy "Accessoires". If we edit any product, we struggle with finding the correct taxonomy. That leads us to display the store_code next to the taxonomy_name.
Same usability problem appears at the taxonomy-list (configuration)

Solution: Worth a pull request?

1
1

To fix this, we need to override the javascript of spree/backend. I'm not sure if that is the best way, but couldn't find any other.

Can't be blank message on Add to cart

Hi
In order to install Spree multi domain 2-1-stable on my spree 2-1-stable i had to install gem 'protected_attributes' otherwise it won't launch.

All works fine, i can add new store, assign products to a store, etc

But when i visit the newly created store and try to add a product to the cart, i get an error message "Can't be blank"

I also noticed an error when trying to add a new user from the admin or trying to login, that it doesn't work, looks like it sends empty parameters.

I guess this is related to gem 'protected_attributes', but i'm totally newbie, if someone can please help!

Thx

NoMethodError: current_tracker

NoMethodError in Spree/user_sessions#new

Showing /home/dennis/.rvm/gems/ruby-1.9.3-p194/bundler/gems/spree-multi-domain-7ba704369b0a/app/views/spree/shared/_google_analytics.html.erb where line #1 raised:

undefined method `current_tracker' for #<#Class:0x00000007239db0:0x0000000724fbb0>
Extracted source (around line #1):

1: <% if tracker = current_tracker %>
2:
3: <script type="text/javascript">
4: var _gaq = _gaq || [];

I'm new to ruby and rails. So I don't quite understand whats going on here. I would be nice if someone could help me.

Thank you!

Different views for different stores?

Is there a way to do this? I think it's rather common goal, because you'll probably want to have different home pages for different stores at least.

Can't get to work it with solr and sunspot modules

I tried to use it with https://github.com/romul/spree-solr-search, and I get this error
undefined method `available_facets' for #Spree::Search::MultiDomain:0x007fdcd3d5f8d8

.rvm/gems/ruby-1.9.3-p194/gems/spree_core-1.3.1/app/views/spree/shared/_taxonomies.html.erb

2: facets = @searcher.available_facets || []

and with https://github.com/iloveitaly/spree_sunspot_search as well
undefined method `sunspot' for #Spree::Search::MultiDomain:0x007fa5a066ad30

.rvm/gems/ruby-1.9.3-p194/gems/spree_core-1.3.1/app/views/spree/shared/_products.html.erb

45: <%= paginate @searcher.sunspot.hits %>

Maybe this is not a problem with spree-multi-domain, and it need to be solved with solr and sunspot plugins, but spree-solr-search is suggested by the community, so what I can do?

Thank you

Supporting Tax Zones

This gem doesn't support regions. It would be nice if we could attach a tax zone to a store which then is the default for visitors of that specific store.

The problem here is that the general concept of regions in spree is not that sophisticated. As far as I understand it's not that easy to switch tax zones per user. Nevertheless I'd like to propose it here as a new feature.

SearchBar needs to list just Taxonomys by Store

Inside the Searcbar the "select#taxon" needs to show just the Taxonomies from current_store.
Also the searchfilter needs to be reviewed. If we choose "All Departments" the lookup needs to be done within our store_taxonomies, not within all taxonomies.

Promotion::Rule Store throws exception

applicable? is not implemented.

This will fix it, or you guys might add it your next commit

Spree::Promotion::Rules::Store.class_eval do
  def applicable?(promotable)
    promotable.is_a?(Spree::Order)
  end
end

Spree 3.0 Update

Will there be an update for spree 3.0 (which has just recently has been released)?

Help please

Hi, sorry this is not an issue. I need help setting this up. I am very new to rails but trying to learn much as I can. I have tried cloning spree-multi-domin, but was unsuccessful and ran into many errors. Do I need to have an existing app then fork multi-domain extension? do I also need to install and have spree running before adding this extension? and last what version of rails should I use for this extension? Most of my problems seem to happen because of incompatibility. I would appreciate any help. Thank you in advance!

Available shipping methods by store

Hi guys

Exists order.available_payment_methods but don't exists something for shipping methods. How can i get only shipping methods by store on delivery step?

Sorry for grammar, regards

1-3 stable?

From Versionfile last one is 1-1 stable, but from branches i can select 1-3 stable.
So wanted to ask 1-3 stable fully work?

2-0-stable Branch?

Is anyone working on a 2-0-stable branch for this extension yet? Thanks!

missing paperclip validation in store model

please note than when using Rails4 and PaperClip 2.4, attempting to upload a store logo image produces the following error:

Paperclip::Errors::MissingRequiredValidatorError

Translate for :name

Translations of Spree.t(: name) are always Store Name, this causes the form fields look wrong, and give an incorrect interpretation.

Cart shared between domains?

It's ok that the Cart is shared between different domains? I don't know if this is the default behavior or is a bug.

In any case, is there a way to have independent shopping carts between different domains?

Thanks!

rake db:migrate doesn't work

Hi! I'm using ruby-1.8.7 and spree-0.11.1. I installed the this extension in my spree and when I execute the db:migrate I get the errors:

Could not load extension from file: multi_domain_extension.
#<NameError: uninitialized constant MultiDomainExtension>
Could not load routes from : /home/mfilipe/Workspace/bores-ecommerce/vendor/extensions/multi_domain/config/routes.rb.

Does anyone know how I fix that?
#<NoMethodError: undefined method `application' for Rails:Module>

Translation Missing for Spree 2

The translations changed in Spree 2, and how certain columns, buttons, etc. have "translation missing". I've attached an example image from the admin.

screen shot 2013-05-24 at 11 34 21 pm

[BUG] Loading wrong Taxonomies on Startpage

I installed SpreeCommerce and added multi-domain-support
setted up the domains

  • store-a.local (store_id 1)
  • store-b.local (store_id 2)

i created 2 taxonomies

  • store-a-taxonomie (store_id 1)
  • store-b-taxonomie (store_id 2)

i expect the behavior, that store-a.local shows me store-a-taxonomie.
unfortunetly if i visit store-a.local or store-b.local BOTH taxonomies are shown.

i checked out the code and figured out that the basic spree controller is not loading the taxonomies by the shop correctly.

https://github.com/spree/spree-multi-domain/blob/master/lib/spree_multi_domain/multi_domain_helpers.rb
provides us the method

def get_taxonomies
  @taxonomies ||= current_store.present? ? Spree::Taxonomy.where(["store_id = ?", current_store.id]) : Spree::Taxonomy
  @taxonomies = @taxonomies.includes(:root => :children)
  @taxonomies
end

https://github.com/spree/spree/blob/master/frontend/app/controllers/spree/home_controller.rb

When i looked up the HomeController of Spree i pointed out, that the taxonomies are not loaded regarding the store_id

def index
  @searcher = build_searcher(params)
  @products = @searcher.retrieve_products
  @taxonomies = Spree::Taxonomy.includes(root: :children)
end

it needs to be changed to

@taxonomies = get_taxonomies

to work the proper way, as expected.

Hotfix would be overriding the controller in my app/controllers/spree/home_controller.rb
are there any other suggestions how to get the correct behaviour working?

cheers

Help with running new specs 2-1-stable

Hi guys, me and my team just started using this gem and we run into an issue we don't know how to solve it.

We are adding the feature for having Taxonomies by domain and we want to add a spec for it.

First we created the dummy app and we noted that the Gemfile of this gem (branch 2-1-stable) is pointing to the master version of Spree. So we needed to change this in order to create the dummy app.

Another thing we change in order to create the dummy app was the Rakefile

It's doing this require

require 'spree/core/testing_support/common_rake'

And to make it work we changed it to this

require 'spree/testing_support/common_rake'

After we successfully created the dummy app, we created the spec and when we run the spec it raises the following error for the requires made in the spec_helper file

spree-multi-domain/gems/polyglot-0.3.3/lib/polyglot.rb:63:in require: cannot load such file -- spree/core/testing_support/factories (LoadError)

And what we did in the spec_helper file was to remove the "core" in the paths.

Finally when we try to run the specs again it raises the following exception

spree-multi-domain/gems/factory_girl-2.6.4/lib/factory_girl/definition_proxy.rb:36:in `add_attribute': Both value and block given (FactoryGirl::AttributeDefinitionError)

And we got stuck here.

Any help would be appreciated.

Thanks!

Tests don't run for 2-3-stable

I'm running the tests per

bundle exec rake test_app && bundle exec rspec

8 of them are failing. They say something about font-awesome:

1) Global controller helpers should include the right tracker
 Failure/Error: get '/'
 ActionView::Template::Error:
   File to import not found or unreadable: font-awesome.
   Load paths:
   ...

Is there any special setup before being able to run the tests?

Cannot load such file -- spree/core/controller_helpers/order (LoadError)

Error when install spree_multi_domain with command:
bundle exec rails g spree_multi_domain:install
Here is the log:
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/polyglot-0.3.3/lib/polyglot.rb:63:in require': cannot load such file -- spree/core/controller_helpers/order (LoadError) from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/polyglot-0.3.3/lib/polyglot.rb:63:inrequire'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in block in require' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:inload_dependency'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in require' from /usr/local/rvm/gems/ruby-1.9.3-p194/bundler/gems/spree-multi-domain-a63edf4f8f21/lib/spree_multi_domain/engine.rb:39:inblock in class:Engine'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.9/lib/rails/initializable.rb:30:in instance_exec' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.9/lib/rails/initializable.rb:30:inrun'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.9/lib/rails/initializable.rb:55:in block in run_initializers' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.9/lib/rails/initializable.rb:54:ineach'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.9/lib/rails/initializable.rb:54:in run_initializers' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.9/lib/rails/application.rb:136:ininitialize!'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in method_missing' from /Spree/bootstrap_misc/multidomain/config/environment.rb:5:in<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/polyglot-0.3.3/lib/polyglot.rb:63:in require' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/polyglot-0.3.3/lib/polyglot.rb:63:inrequire'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in block in require' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:inload_dependency'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in require' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.9/lib/rails/application.rb:103:inrequire_environment!'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.9/lib/rails/commands.rb:25:in <top (required)>' from script/rails:6:inrequire'
from script/rails:6:in `

'

Here is the Gemfile:

source 'https://rubygems.org'
gem 'rails', '3.2.9'
gem 'sqlite3'
group :assets do
gem 'sass-rails', '> 3.2.3'
gem 'coffee-rails', '
> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'spree', '1.2.0'
gem 'spree_usa_epay'
gem 'spree_skrill'
gem 'spree_auth_devise', :git => 'git://github.com/spree/spree_auth_devise'
gem 'spree_multi_domain', git: '[email protected]:spree/spree-multi-domain.git'

Here is the log for bundle install :

Updating [email protected]:spree/spree-multi-domain.git
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Using rake (10.0.2)
Using i18n (0.6.1)
Using multi_json (1.3.7)
Using activesupport (3.2.9)
Using builder (3.0.4)
Using activemodel (3.2.9)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.2.1)
Using actionpack (3.2.9)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.9)
Using active_utils (1.0.5)
Using json (1.7.5)
Using money (5.0.0)
Using nokogiri (1.5.5)
Using activemerchant (1.28.0)
Using arel (3.0.2)
Using tzinfo (0.3.35)
Using activerecord (3.2.9)
Using activeresource (3.2.9)
Using acts_as_list (0.1.4)
Using gyoku (0.4.6)
Using akami (1.2.0)
Using multi_xml (0.5.1)
Using httparty (0.8.3)
Using uuidtools (2.1.3)
Using aws-sdk (1.3.9)
Using bcrypt-ruby (3.0.1)
Using bundler (1.2.1)
Using cancan (1.6.7)
Using cocaine (0.4.2)
Using coffee-script-source (1.4.0)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using rdoc (3.12)
Using thor (0.16.0)
Using railties (3.2.9)
Using coffee-rails (3.2.2)
Using rails (3.2.9)
Using deface (0.9.1)
Using orm_adapter (0.0.7)
Using warden (1.1.1)
Using devise (2.0.4)
Using ffaker (1.12.1)
Using highline (1.6.11)
Using httpi (1.1.1)
Using jquery-rails (2.1.3)
Using kaminari (0.14.1)
Using nested_set (1.7.0)
Using nori (1.1.3)
Using paperclip (2.8.0)
Using polyamorous (0.5.0)
Using rabl (0.6.5)
Using ransack (0.7.0)
Using sass (3.2.3)
Using sass-rails (3.2.5)
Using wasabi (2.5.1)
Using savon (1.2.0)
Using select2-rails (0.0.9)
Using state_machine (1.1.2)
Using stringex (1.3.3)
Using spree_core (1.2.0)
Using spree_api (1.2.0)
Using spree_cmd (1.2.0)
Using spree_dash (1.2.0)
Using spree_promo (1.2.0)
Using spree_sample (1.2.0)
Using spree (1.2.0)
Using spree_auth_devise (1.0.0) from git://github.com/spree/spree_auth_devise (at master)
Using spree_multi_domain (1.0.0) from [email protected]:spree/spree-multi-domain.git (at master)
Using spree_skrill (1.0.2)
Using spree_usa_epay (1.0.2)
Using sqlite3 (1.3.6)
Using uglifier (1.3.0)
Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed.

Search for domain can return wrong results.

The by_domain scope uses a like %domain%

scope :by_domain, lambda { |domain| where("domains like ?", "%#{domain}%") }

This can cause problems if you have for example 3 stores with these domains:

munich.foo.com
de.foo.com
ch.foo.com

When search for %ch.foo.com% the first result will be munich.foo.com which is not what is expected.

changing it to domin% also won't solve the issue as this will break things when using multiple domains per store.

Bundler could not find compatible versions for gem "spree_api"

As soon as I add spree_multi_domain gem to Gemfile, when I try to bundle it I get the following error message:

Bundler could not find compatible versions for gem "spree_api":
  In Gemfile:
    spree_multi_domain (>= 0) ruby depends on
      spree_api (~> 2.2.0.beta) ruby

    spree (>= 0) ruby depends on
      spree_api (2.1.4)

This is the gem set I'm using:

gem 'spree', github: 'spree/spree', branch: '2-1-stable'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-1-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-1-stable'
gem 'spree_multi_domain', git: 'git://github.com/spree/spree-multi-domain.git'

spree_multi_domain.gemspec seems to be requiring this gem which is not available in Github.

current method in Tracker decorator have conflict with the method in Spree core

current method in Tracker decorator have conflict with the method in Spree core

ArgumentError - wrong number of arguments (0 for 1):
/spree-multi-domain/app/models/spree/tracker_decorator.rb:4:in current' app/views/spree/shared/_google_analytics.html.erb:1:in_a7721bcc461d6fdcbf5840cd55249711'
actionview (4.1.4) lib/action_view/template.rb:145:in `block in render'

Per-Domain Layouts not working

I did a fresh install of spree 1.3.1 and installing nothing but the spree-multi-domain gem. I then created 2 stores (codes default and ypd). The different urls are loading the proper store, but following the directions on the wiki says to put the layout in app/views/layouts/store#code/ directory

This is a little confusing anyway because spree views are in app/views/spree/directory but I've tried every variation of directories inside the app/views directory and can't get the layouts to load anything but the default store

Unable show product

https://docs.google.com/file/d/0B_8ss4pdFPCwYjBfMktRWFU5dEU/edit?usp=sharing

when I check the server logs:
Filter chain halted as :can_show_product rendered or redirected

Started GET "/products/gelas" for 127.0.0.1 at 2013-04-24 10:13:46 +0700
Processing by Spree::ProductsController#show as HTML
  Parameters: {"id"=>"gelas"}
  Spree::User Load (0.3ms)  SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."id" = 1 LIMIT 1
  Spree::Order Load (0.3ms)  SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."user_id" = 1 AND "spree_orders"."completed_at" IS NULL ORDER BY created_at ASC LIMIT 1
  Spree::Store Load (0.1ms)  SELECT "spree_stores".* FROM "spree_stores" WHERE (domains like '%localhost%') LIMIT 1
  Spree::Store Load (0.1ms)  SELECT "spree_stores".* FROM "spree_stores" WHERE "spree_stores"."default" = 't' LIMIT 1
  Spree::Order Load (0.2ms)  SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."id" = 1 AND "spree_orders"."currency" = 'USD' LIMIT 1
  Spree::Adjustment Load (0.2ms)  SELECT "spree_adjustments".* FROM "spree_adjustments" WHERE "spree_adjustments"."adjustable_type" = 'Spree::Order' AND "spree_adjustments"."adjustable_id" IN (1) ORDER BY created_at ASC
  CACHE (0.0ms)  SELECT "spree_stores".* FROM "spree_stores" WHERE (domains like '%localhost%') LIMIT 1
  CACHE (0.0ms)  SELECT "spree_stores".* FROM "spree_stores" WHERE "spree_stores"."default" = 't' LIMIT 1
  CACHE (0.0ms)  SELECT "spree_stores".* FROM "spree_stores" WHERE (domains like '%localhost%') LIMIT 1
  CACHE (0.0ms)  SELECT "spree_stores".* FROM "spree_stores" WHERE "spree_stores"."default" = 't' LIMIT 1
   (0.1ms)  SELECT COUNT(*) FROM "spree_roles" INNER JOIN "spree_roles_users" ON "spree_roles"."id" = "spree_roles_users"."role_id" WHERE "spree_roles_users"."user_id" = 1 AND "spree_roles"."name" = 'admin'
  Spree::Product Load (0.1ms)  SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."permalink" = 'gelas' LIMIT 1
  Spree::Store Load (0.1ms)  SELECT "spree_stores".* FROM "spree_stores" INNER JOIN "spree_products_stores" ON "spree_stores"."id" = "spree_products_stores"."store_id" WHERE "spree_products_stores"."product_id" = 1
Deface: 1 overrides found for 'spree/layouts/spree_application'
Deface: 'add_analytics_header' matched 1 times with 'head'
  Rendered public/404.html within spree/layouts/spree_application (0.1ms)
  Rendered /home/cybergarage/.rvm/gems/ruby-2.0.0-p0/gems/spree_core-1.3.2/app/views/spree/shared/_head.html.erb (109.2ms)
  Spree::Variant Load (0.2ms)  SELECT "spree_variants".* FROM "spree_variants" WHERE "spree_variants"."product_id" = 1 AND "spree_variants"."is_master" = 't' LIMIT 1
  Spree::Price Load (0.1ms)  SELECT "spree_prices".* FROM "spree_prices" WHERE "spree_prices"."variant_id" = 1 AND "spree_prices"."currency" = 'USD' LIMIT 1
  Spree::Taxon Load (0.2ms)  SELECT "spree_taxons".* FROM "spree_taxons" INNER JOIN "spree_products_taxons" ON "spree_taxons"."id" = "spree_products_taxons"."taxon_id" WHERE "spree_products_taxons"."product_id" = 1
Deface: 1 overrides found for 'spree/shared/_nav_bar'
Deface: 'auth_shared_login_bar' matched 1 times with 'li#search-bar'
  Spree::Taxon Load (0.2ms)  SELECT "spree_taxons".* FROM "spree_taxons" WHERE "spree_taxons"."parent_id" IS NULL ORDER BY "spree_taxons"."lft"
  Rendered /home/cybergarage/.rvm/gems/ruby-2.0.0-p0/gems/spree_core-1.3.2/app/views/spree/shared/_search.html.erb (1.8ms)
  Rendered /home/cybergarage/.rvm/gems/ruby-2.0.0-p0/gems/spree_core-1.3.2/app/views/spree/shared/_nav_bar.html.erb (8.9ms)
  CACHE (0.0ms)  SELECT "spree_stores".* FROM "spree_stores" WHERE (domains like '%localhost%') LIMIT 1
  CACHE (0.0ms)  SELECT "spree_stores".* FROM "spree_stores" WHERE "spree_stores"."default" = 't' LIMIT 1
  CACHE (0.0ms)  SELECT "spree_stores".* FROM "spree_stores" WHERE (domains like '%localhost%') LIMIT 1
  CACHE (0.0ms)  SELECT "spree_stores".* FROM "spree_stores" WHERE "spree_stores"."default" = 't' LIMIT 1
   (0.1ms)  SELECT COUNT(*) FROM "spree_line_items" WHERE "spree_line_items"."order_id" = 1
  Rendered /home/cybergarage/.rvm/gems/ruby-2.0.0-p0/gems/spree_core-1.3.2/app/views/spree/shared/_main_nav_bar.html.erb (3.5ms)
  Rendered /home/cybergarage/.rvm/gems/ruby-2.0.0-p0/gems/spree_core-1.3.2/app/views/spree/shared/_header.html.erb (28.4ms)
  Rendered /home/cybergarage/.rvm/gems/ruby-2.0.0-p0/gems/spree_core-1.3.2/app/views/spree/shared/_footer.html.erb (0.2ms)
  Spree::Tracker Load (0.1ms)  SELECT "spree_trackers".* FROM "spree_trackers" INNER JOIN "spree_stores" ON "spree_stores"."id" = "spree_trackers"."store_id" WHERE "spree_trackers"."active" = 't' AND "spree_trackers"."environment" = 'development' AND (spree_stores.domains LIKE '%localhost%') LIMIT 1
  Rendered /home/cybergarage/.rvm/gems/ruby-2.0.0-p0/bundler/gems/spree-multi-domain-e3656c58cf69/app/views/spree/shared/_google_analytics.html.erb (1.0ms)
Filter chain halted as :can_show_product rendered or redirected

Missing Error Handing in rake task `spree_multi_domain:install`

The install_generator task could be improved by proper error handling. The following is going to fail if I my javascript files aren't located under vendor/assets

def add_javascripts
    append_file "vendor/assets/javascripts/spree/backend/all.js", "//= require spree/backend/spree_multi_domain\n"
end

The error output is a bit weird if you're not used to rake tasks:

`binread': No such file or directory @ rb_sysopen - /***/vendor/assets/javascripts/spree/backend/all.js (Errno::ENOENT)

Problem with products_controller_decorator.rb... all stores can show every product details

all my stores actually can show every product...

Can someone explain me the app/controllers/spree/products_controller_decorator.rb?

What's @site variable?

in my opinion we should change @site with current_store from helper and change the operand in not include

if @product.stores.empty? or not @product.stores.include?(current_store)

a better and more elegant way would be pre-filter products with a default scope maybe...

only Products beloning to Store are allowed to be populated to an order

I'm not good on forking/pushing, so might be please somebody feel free to implement it into the master.

currently we are able to populate EVERY variant_id to an order. customers might play around with it (if you run 5 stores with same products and different prices, that will help you stop losing money).
unless the product doesn't belong to the store, just redirect to startpage.

Spree::OrdersController.class_eval do
  before_filter :product_belongs_to_store, only: [:populate]
  private    
  def product_belongs_to_store
    redirect_to "/", message: "Couldn't find Product" unless Spree::Variant.find(params[:variant_id]).product.store == current_store
   end  
end

wrong layout rendered / weired behavior on last commit

7ab14fe

i'm getting some weired behaviour.

when i submit a promotion-code which doesn't exist (or can't be used, whatever) its using the wrong layout (default)

Rendered /home/tim/.rvm/gems/ruby-2.1.1/bundler/gems/spree_bootstrap_frontend-4ef908e9699c/app/views/spree/orders/edit.html.erb within spree/layouts/spree_application (145.6ms)

i tried to debug it, but not able to. just wanted to report it.

Product gets dissociated of its current stores due to callback misbehavior

Related (hopefully) to #97.

Currently, the set_stores callback is called before an update is made to a Product or to one of its associations via nested attributes. In the latter case, this causes the product to dissociate from the store (or stores) because the store_ids aren't passed in the parameters, effectively meeting the condition which I think was meant to work only if you are editing the product details, specifically, if this product would be part of this or that store. This is indeed buggy behavior.

The following feels like a sketchy workaround, but it does the job:

def set_stores
  if user_comes_from_product_details? && no_stores_selected?
    @product.store_ids = nil
  end                                                                        
end

def user_comes_from_product_details?
  params = Spree::Core::Engine.routes.recognize_path(request.referer)
  params[:controller] == "spree/admin/products" && params[:action] == "edit"
end

def no_stores_selected?
  params[:product][:store_ids].blank?
end

Does any of this make any sense? Could I achieve what I want in another, better way?

Thanks a lot,

H.

Products display even when not assigned to a "Store"

Reproduce the issue:

  1. rails _3.2.13_ new spree-multi-site
  2. cd spree-multi-site
  3. bundle install
  4. spree install -A
  5. Spree installs and receive "Spree has been installed successfully. You're all ready to go!" confirmation
  6. Gemfile includes standard Rails gems and these lines for Spree at the bottom
gem 'spree', '2.0.0'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git'
  1. rails s to confirm everything is working
  2. Add gem 'spree_multi_domain', git: 'git://github.com/spree/spree-multi-domain.git' to Gemfile
  3. bundle install
  4. bundle exec rails g spree_multi_domain:install
  5. Agree to run migrations when prompted
  6. Add "spree1.dev" and "spree2.dev" to my hosts file
  7. rails s
  8. Log in to admin and added two new stores, "spree1.dev" and "spree2.dev"
  9. Visit http://spree1.dev:3000

Expected Results / Actual Results

I am expecting to see no products for either store, spree1.dev or spree2.dev, since I have not set any products to belong to either store. However, when I "Shop by Categories", "Clothing" says "No products found" but lists all the products in this category. This is true for both stores. Other categories do not display any products.

image

Clicking on a product returns this:
image

Rails / Spree Versions

Rails 3.2.13
Spree (2.0.0)
spree_api (= 2.0.0)
spree_backend (= 2.0.0)
spree_cmd (= 2.0.0)
spree_core (= 2.0.0)
spree_dash (= 2.0.0)
spree_frontend (= 2.0.0)
spree_sample (= 2.0.0)
spree_api (2.0.0)
spree_gateway 1.2.0.rc2
spree_auth_devise 1.0.0
spree_multi_domain 1.0.0

Thanks
Matt

Domain Logo not saved

When i save a logo for a domain, it is not saved. Going back into the admin screen shows the image is 404 - its looking for the right file, but can't find it. I've recreated this issue using both the pow server, and just in webrick & going to localhost:3000

ActionController::RoutingError (No route matches [GET] "/images/stores/2/medium/happydog.jpg"):
ActionController::RoutingError (No route matches [GET] "/images/stores/2/medium/happydog.jpg"):
  vendor/bundle/gems/actionpack-4.0.5/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  vendor/bundle/gems/actionpack-4.0.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  vendor/bundle/gems/railties-4.0.5/lib/rails/rack/logger.rb:38:in `call_app'
  vendor/bundle/gems/railties-4.0.5/lib/rails/rack/logger.rb:20:in `block in call'
  vendor/bundle/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68:in `block in tagged'
  vendor/bundle/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:26:in `tagged'
  vendor/bundle/gems/activesupport-4.0.5/lib/active_support/tagged_logging.rb:68:in `tagged'
  vendor/bundle/gems/railties-4.0.5/lib/rails/rack/logger.rb:20:in `call'
  vendor/bundle/gems/actionpack-4.0.5/lib/action_dispatch/middleware/request_id.rb:21:in `call'
  vendor/bundle/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
  vendor/bundle/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
  vendor/bundle/gems/activesupport-4.0.5/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  vendor/bundle/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
  vendor/bundle/gems/actionpack-4.0.5/lib/action_dispatch/middleware/static.rb:64:in `call'
  vendor/bundle/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
  vendor/bundle/gems/railties-4.0.5/lib/rails/engine.rb:511:in `call'
  vendor/bundle/gems/railties-4.0.5/lib/rails/application.rb:97:in `call'
  vendor/bundle/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
  vendor/bundle/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
  vendor/bundle/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
  /Users/willbarker/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
  /Users/willbarker/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
  /Users/willbarker/.rbenv/versions/2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'


  Rendered vendor/bundle/gems/actionpack-4.0.5/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms)
  Rendered vendor/bundle/gems/actionpack-4.0.5/lib/action_dispatch/middleware/templates/routes/_route.html.erb (0.9ms)
  Rendered vendor/bundle/gems/actionpack-4.0.5/lib/action_dispatch/middleware/templates/routes/_route.html.erb (158.6ms)
  Rendered vendor/bundle/gems/actionpack-4.0.5/lib/action_dispatch/middleware/templates/routes/_table.html.erb (1.5ms)
  Rendered vendor/bundle/gems/actionpack-4.0.5/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (441.3ms)

gemfile.lock:
https://gist.github.com/asecondwill/16309d43e0ae36787a44

NameError

$ bundle exec rails g spree_multi_domain:install

/Users/metalbig/.rvm/gems/ruby-1.9.3-p194@global/gems/activesupport-3.2.8/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method': undefined method `current_order' for class `Spree::Order' (NameError)
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194@global/gems/activesupport-3.2.8/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method_chain'
  from /Users/metalbig/.bundler/ruby/1.9.1/spree-multi-domain-551d77590761/lib/spree_multi_domain/engine.rb:49:in `block (2 levels) in <class:Engine>'
  from /Users/metalbig/.bundler/ruby/1.9.1/spree-multi-domain-551d77590761/lib/spree_multi_domain/engine.rb:39:in `module_eval'
  from /Users/metalbig/.bundler/ruby/1.9.1/spree-multi-domain-551d77590761/lib/spree_multi_domain/engine.rb:39:in `block in <class:Engine>'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
  from /Users/metalbig/Desktop/sandbox/ruby-box/project-box/hubzer/config/environment.rb:5:in `<top (required)>'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194@global/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194@global/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194@global/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194@global/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194@global/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application.rb:103:in `require_environment!'
  from /Users/metalbig/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:25:in `<top (required)>'
  from script/rails:6:in `require'
  from script/rails:6:in `<main>'

SQLite3::SQLException: duplicate column name: store_id

How to reproduce:

  1. rails new mystore
  2. add the following to Gemfile:
    gem 'spree', '2.3.6'
    gem 'spree_gateway', github: 'spree/spree_gateway', branch: '2-3-stable'
    gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-3-stable'
    gem 'spree_multi_domain', git: 'git://github.com/spree/spree-multi-domain.git', branch: '2-3-stable'
  3. bundle exec rails g spree:install
  4. bundle exec rails g spree_multi_domain:install
    ~/mystore/db/migrate/20141220232549_add_order_store.spree_multi_domain.rb:7:in `up'
    SQLite3::SQLException: duplicate column name: store_id

uninitialized constant Spree::Admin::ProductsController

Hello, I created a rails 4.1.6 project and then I added to my gemfile
gem 'spree_multi_domain', git: 'git://github.com/spree/spree-multi-domain.git'

Then when I run:
bundle exec rails g spree_multi_domain:install

I get the next error:
uninitialized constant Spree::Admin::ProductsController (NameError)

/Users/toptierlabs/.rvm/gems/ruby-2.1.1/bundler/gems/spree-multi-domain-c8782907a414/app/controllers/spree/admin/products_controller_decorator.rb:1:in <top (required)>': uninitialized constant Spree::Admin::ProductsController (NameError) from /Users/toptierlabs/.rvm/gems/ruby-2.1.1/bundler/gems/spree-multi-domain-c8782907a414/lib/spree_multi_domain/engine.rb:10:inblock (2 levels) in activate'
from /Users/toptierlabs/.rvm/gems/ruby-2.1.1/bundler/gems/spree-multi-domain-c8782907a414/lib/spree_multi_domain/engine.rb:9:in glob' from /Users/toptierlabs/.rvm/gems/ruby-2.1.1/bundler/gems/spree-multi-domain-c8782907a414/lib/spree_multi_domain/engine.rb:9:inblock in activate'
from /Users/toptierlabs/.rvm/gems/ruby-2.1.1/bundler/gems/spree-multi-domain-c8782907a414/lib/spree_multi_domain/engine.rb:8:in each' from /Users/toptierlabs/.rvm/gems/ruby-2.1.1/bundler/gems/spree-multi-domain-c8782907a414/lib/spree_multi_domain/engine.rb:8:inactivate'
.....

I was looking into the repo but I don't have idea what happen.

Thanks, Matias

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.