phpaddicted Posted December 5, 2015 Share Posted December 5, 2015 Hi Team, I really loved override feature of modules and controllers and I am enjoying working with it, But I have one question. I am working on project in which we will have Multiple Shops,So for one shop if I will override IndexController.php then will it effect to other shops too? If yes, then is there any method by which I can override controller for particular shops only? Please let me know I am stuck here. Ankur Link to comment Share on other sites More sharing options...
bellini13 Posted December 5, 2015 Share Posted December 5, 2015 So for one shop if I will override IndexController.php then will it effect to other shops too? Yes it would effect all Shops If yes, then is there any method by which I can override controller for particular shops only? Yes, research the Context and Shop classes. In your controller, you would get the Shop object contained in the Context $shop = $this->context->shop; Then you could check the Shops ID and decide what needs to be done if ($shop->id_shop == 1) do something Link to comment Share on other sites More sharing options...
El Patron Posted December 6, 2015 Share Posted December 6, 2015 also modules can be 'enabled' 'disabled' by shop. so what I like to do when working with overrides is add check to see if my module is enabled if(Module::isEnabled('your_module_name') Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now