I set a magento website with several stores, I'm making a list of all thoses stores in a page where the user can pick up the nearest one using a form like this
<form action="<?php echo ;?>" method="post">
<input type="submit" value="select store" />
</form>
<form action="<?php echo ;?>" method="post">
<input type="submit" value="select store" />
</form>
In the action attribute I would like to set the url of each store according to his Id... Is it possible? Is there a better way to proceed (maybe avoiding GET parameter)?
Edit: Finally I achieve what I was looking for with this snippet
echo '<p><a href="' . Mage::getUrl() . '?___store=' . $store . '">pick up this restaurant</a></p>';
It's quite close of what clockworkgeek suggest
echo '<p><a href="' .Mage::getUrl('', array('___store'=>$store)) . '">pick up this restaurant</a></p>';
but results are differents:
my test:
http://test.mysite.com/?___store=3
clockworkgeek code:
http://test.mysite.com/___store/3/
The first link is working fine, the second lead to a 404 one...
Also I try this code which is producing nothing, Any idea why ?
Mage::app()->setCurrentStore(5);
$this->_redirect('');
The redirection is working fine, but I'm still on the same store, Is it the good way of using setCurrentStore function?
then I finally have a go with this one, but I can find suitable example on the net about it... how can I using it, and related question how can i Hve the list of all the magento controllers ?
$this->_forward('defaultNoRoute');
thx