spree-contrib / spree-multi-domain

Multiple Spree stores on different domains - single unified backed for processing orders
https://guides.spreecommerce.org
194 stars 191 forks source link

When create orders via API, order.store don't saved #92

Closed ronzalo closed 10 years ago

ronzalo commented 10 years ago

I'm creating an app via spree_api, and the question, it's api supported by multi-domain?

Regards !

ghost commented 10 years ago

no, currently its not included, but its easy to do. all you need to do is to attach the current_store to the api object.

you can override every function of the spree_core or this gem with class_eval.

example:

lets say the spree-core has a method foo you need to override class ApiController def foo end end

so you go under

app/controllers/api_controller_decorator.rb

Spree::ApiController.class_eavl do

you reopen the class and can override anything or add new stuff

before_filter do
  #do some needed stuff
end

def foo

override foo with your stuff

end

def yourfoo

implement addition functions

end end

its simple, just give it a try

cheers

Am 11.04.2014 22:06, schrieb Gonzalo Moreno:

I'm creating an app via spree_api, and the question, it's api supported by multi-domain?

Regards !

— Reply to this email directly or view it on GitHub https://github.com/spree/spree-multi-domain/issues/92.

ronzalo commented 10 years ago

@fu-media Yes, it works