0

I got the following two statements for my dutch store (Magento 1.9.3.4), with the following issues:

<?php $_BaseUrl=Mage::app()->getStore()->getHomeUrl() ; ?>

With this statement I am getting the home page plus '/nl', but I just need it without the 'nl'. Example: I get www.homepage.com/nl instead of www.homepage.com

<?php $countryId=Mage::app()->getStore()->getCode(); ?>

With this second statement, I get 'Netherlands' instead of 'nl'

Could you guys help me to achieve what I want? PHP version is 5.6.31

Thanks for your collaborations.

0

<?php $_BaseUrl = Mage::app()->getStore()->getHomeUrl(); ?> = www.homepage.com/nl

<?php $_BaseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?> = www.homepage.com/

Happy coding :)

  • This worked out :) now trying to figure out how to get 'nl' instead of 'Netherlands' or 'nl_NL' – Julian Murillo Sep 7 '17 at 9:47
  • <?php $_codeStore = Mage::app()->getStore()->getCode() ?> OR <?php $_languageStore = Mage::app()->getStore()->getLanguageCode() ?> – PЯINCƏ Sep 7 '17 at 10:06
0

Im guessing your looking to get the locale for this result or you could just do a preg_replace

// Gets the current store's details
$store = Mage::app()->getStore();

// Gets the current store's id
$storeId = Mage::app()->getStore()->getStoreId();

// Gets the current store's code
$storeCode = Mage::app()->getStore()->getCode();

// Gets the current website's id
$websiteId = Mage::app()->getStore()->getWebsiteId();

// Gets the current store's group id
$storeGroupId = Mage::app()->getStore()->getGroupId();

// Gets the current store's name
$storeName = Mage::app()->getStore()->getName();

// Gets the current store's sort order
$storeSortOrder = Mage::app()->getStore()->getSortOrder();

// Gets the current store's status
$storeIsActive = Mage::app()->getStore()->getIsActive();

// Gets the current store's locale
$storeLocaleCode = Mage::app()->getStore()->getLocaleCode();

// Gets the current store's home url
$storeHomeUrl = Mage::app()->getStore()->getHomeUrl();
  • Hi. I tried those but It did not work. Could you provide an example on how preg_replace should work? – Julian Murillo Sep 7 '17 at 9:46
0

In Magento 1.9.4.0 and maybe all versions in 1.x use:

Mage::getStoreConfig('general/store_information/address');

and the following params, it depends what you want to get:

  • general/store_information/name
  • general/store_information/phone
  • general/store_information/merchant_country
  • general/store_information/address
  • general/store_information/merchant_vat_number
New contributor
István Döbrentei is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.