Wednesday, 3 July 2013

Magento Shop by country & currency


  1. Create one store and create store view under this store.
  2. Set currency setup as per each storeview also set the allow currency
  3. Go to the System -> Manage Currency -> Rates
    set the rates as per the currency
  4. Go to System -> web -> Add Store Code to Urls = yes
You can create one phtml file and call into your header

Write the below code there for show in fronted and redirect after checked the option
<?php
$cStrCd = Mage::app()->getStore()->getCode();
$allStores = Mage::app()->getStores();
echo 'Shop :';
foreach ($allStores as $_eachStoreId => $val)
{
$_storeCode = Mage::app()->getStore($_eachStoreId)->getCode();
$_storeName = Mage::app()->getStore($_eachStoreId)->getName();
$_storeId = Mage::app()->getStore($_eachStoreId)->getId();
$_storeSymbol = Mage::app()->getStore($_eachStoreId)->getCurrentCurrencyCode();
$_storeUrl = Mage::app()->getStore($_eachStoreId)->getUrl();
if($cStrCd == $_storeCode) { $check = 'checked="true"'; }
else { $check = ''; }
?>
<input type="radio" <?php echo $check; ?> name="site" onclick="window.location='<?php echo $_storeUrl; ?>';"/>
<img src="<?php echo $this->getSkinUrl() ?>images/flag/png/<?php echo $_storeCode.'.png'; ?>" />
<a href="<?php echo $_storeUrl; ?>"><?php echo $_storeName; ?></a>
<?php
}
?>
<script type="text/javascript">
/* <![CDATA[ */
function sub() {
window.location.href = site;
}
function goTo(URL) {
site = URL;
}
/* ]]> */
</script>

No comments:

Post a Comment

Thanks for your comments.