title: Changing URL and retaining values on dropdown onChange event
body: <p>I have created a Magento site that has Japanese and English store. For both of these stores, I have almost the same products. I just added additional attributes to add the english texts where necessary such as the name. So for example, in my Japanese store, the product's name is "靴" then in English store it's "Shoes". Given this, I have to make adjustments to my url and breadcrumbs to accommodate both languages.</p>
  
  <p>Anyway, I added a currency selector for my English store which works perfectly. The only problem I'm having with it is that it reloads my page completely and the changes I made in the url and breadcrumbs disappear and goes back to default. My url and breadcrumbs should look like this in the English store:</p>
  
  <pre><code>url: http://mywebsite.com/mycategory/shoes.html?cat=mycategory&amp;prod=shoes
  breadcrumbs: Home &gt; My Category &gt; Shoes
  </code></pre>
  
  <p>But whenever I try to change the currency, it reloads my page and I end up with this url and breadcrumb:</p>
  
  <pre><code>url: http://mywebsite.com/mycategory/shoes.html
  breadcrumbs: Home &gt; My Category &gt; 靴
  </code></pre>
  
  <p>The code for my currency dropdown looks like so:</p>
  
  <pre><code>&lt;?php $_product = Mage::registry('current_product');
  $root = Mage::app()-&gt;getStore()-&gt;getRootCategoryId();
  
  //UPDATE:
  $currency = Mage::app()-&gt;getRequest()-&gt;getParam('currency');
  Mage::app()-&gt;getStore()-&gt;setCurrentCurrencyCode($currency);
  //if I try to echo these two, it both returns the correct current currency
  
  $cats = $_product-&gt;getCategoryCollection()
          -&gt;addAttributeToSelect('name')
          -&gt;addAttributeToFilter('parent_id', $root);     
  foreach($cats as $_cat):
      $cat_name = $_cat-&gt;getName();
  endforeach;
  
  //UPDATE:
  $productUrl = $_product-&gt;getProductUrl."?cat=".urlencode($cat_name)."&amp;prodname=".urlencode($_product-&gt;getName_en());
  
  if($this-&gt;getCurrencyCount() &gt; 1): ?&gt;
  &lt;label for="custom-currency-selector"&gt;&lt;?php echo $this-&gt;__('Select Currency:') ?&gt;&lt;/label&gt;
  
  //UPDATE: changed window.location.href to setLocation
  &lt;select onchange="setLocation('&lt;?php echo $productUrl ?&gt;' + '&amp;currency=' + this.value") name="custom-currency-selector" id="custom-currency-selector"&gt;
      &lt;?php foreach ($this-&gt;getCurrencies() as $_code =&gt; $_name): ?&gt;
  
    //UPDATE: option value
    //if I echo $this-&gt;getCurrentCurrencyCode(), its value is different from the current. It returns the previously selected currency
    &lt;option value="&lt;?php echo $_code; ?&gt;"
          &lt;?php if($_code == $this-&gt;getCurrentCurrencyCode()): ?&gt;
              selected="SELECTED"
          &lt;?php endif; ?&gt;&gt;
          &lt;?php echo $_code ?&gt;
      &lt;/option&gt;
      &lt;?php endforeach; ?&gt;
  &lt;/select&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>I tried changing the onchange event value to window.location.href=this.value+'' but that isn't working at all. My url is not retained. So my question is, how can I change the currency while retaining the changes I created for my url and breadcrumbs?</p>
  
  <p>Update:
  As per Natalie's suggestion, I've changed $this->getSwitchCurrencyUrl($_code) to simply $_code and made some more change to my currency.phtml to accommodate my needs. I am now able to retain my url params and change the currency. The problem now is that even though I am able to set the currency programmatically, the select option and currency would not change immediately. For example if my current currency is $ and I try to change to JPY, what happens is it remains $ then for the second time, I select EUR, JPY currency is used instead then the next currency used would be EUR. Basically, my code seems to get the previously selected currency instead of the current one. Why is this happening and how can I fix this?</p>