How to get some store information in my Magento 1?
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.
magento-1.9 php stores
add a comment |
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.
magento-1.9 php stores
add a comment |
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.
magento-1.9 php stores
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.
magento-1.9 php stores
magento-1.9 php stores
edited Sep 6 '17 at 19:43
Rafael Corrêa Gomes
4,28222962
4,28222962
asked Sep 6 '17 at 19:21
Julian MurilloJulian Murillo
1459
1459
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
<?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
add a comment |
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
add a comment |
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
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f192264%2fhow-to-get-some-store-information-in-my-magento-1%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
<?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
add a comment |
<?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
add a comment |
<?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 :)
<?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 :)
answered Sep 6 '17 at 21:35
PЯINCƏPЯINCƏ
7,75131137
7,75131137
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
add a comment |
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
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
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
<?php $_codeStore = Mage::app()->getStore()->getCode() ?>
OR <?php $_languageStore = Mage::app()->getStore()->getLanguageCode() ?>
– PЯINCƏ
Sep 7 '17 at 10:06
add a comment |
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
add a comment |
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
add a comment |
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();
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();
answered Sep 6 '17 at 19:39
Dava GordonDava Gordon
59117
59117
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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
add a comment |
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
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
New contributor
answered 10 mins ago
István DöbrenteiIstván Döbrentei
101
101
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f192264%2fhow-to-get-some-store-information-in-my-magento-1%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown