How to get url for specific store in magento
magento, php
Solution
`Mage::getUrl()` can take two parameters:
Parameter 1 - $routePath -> The route path expressed in the form of "module/controller/action"
Parameter 2 - $routeParams -> This is an array that converts key/values into pairs of path directories.
Magento will use the correct domain as the base URL if you add the `_store` param. e.g.
Mage::getUrl('comm/comm/redirect', array(
'_store'=>'your_store_id'
));
OR
Mage::getUrl('comm/comm/redirect', array(
'_store'=>'your_store_code'
));
For additional reference and a complete list of options available visit: http://www.magentocommerce.com/wiki/5_-_modules_and_development/reference/geturl_function_parameters
Problem
I am developing a custom payment module and i need help in one thing! when i click on place order on my onepagecheckout in magento url i am redirecting to my payment gateway which i am getting by this code ``` Mage::getUrl('comm/comm/redirect') ``` this generated the redirect url My problem is when running multistore in magento for store www.abc.com this redirects works good and returns (www.abc.com/index.php/comm/comm/redirect) But for another store www.def.com also it is redirecting to this same url (www.abc.com/index.php/comm/comm/redirect) which it should be (www.def.com/index.php/comm/comm/redirect) so that this store redirects to its own specific payment gateway. How could i get the specific store url when clicking on place order. Thanks for the help