Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
How do I get the store name? 
 
Dustin
Sr. Member
 
Total Posts:  118
Joined:  2008-03-13
Columbus, OH
 

I have multiple stores and I am trying to create a general footer that can be used across all of them.

What I need to do is get the current store name.

In the footer there will be “About StoreNameHere” and “Copyright 2008 StoreNameHere”

What function would I call to get this to work?

Thanks for any help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Member
 
Avatar
Total Posts:  71
Joined:  2008-05-08
China
 

Have you tried CMS Static Block ?

If you installed the data sample, there’s “footer link” block there…

 Signature 

Hope it helps ! And please share with us if it is ! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dustin
Sr. Member
 
Total Posts:  118
Joined:  2008-03-13
Columbus, OH
 
Yoke Lee - 14 May 2008 12:59 AM

Have you tried CMS Static Block ?

If you installed the data sample, there’s “footer link” block there…

I can use that, but that still does not solve the problem of one general footer.

If I have Website A and Website B, I would still need to create a static block for each website. That is what I am trying to avoid.

I just need to find a function call that will return the current store name to dynamically change the footer per website.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dustin
Sr. Member
 
Total Posts:  118
Joined:  2008-03-13
Columbus, OH
 

I have tried putting this in the footer: $this-getName();

This does not return anything though.

Is that not supposed to return the store name?

 
Magento Community Magento Community
Magento Community
Magento Community
 
[m] zentrale
Guru
 
Avatar
Total Posts:  401
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

block of page head /app/code/core/Mage/Page/Block/Html/Head.php is using this function to load title of store:

public function getDefaultTitle()
    
{
        
return Mage::getStoreConfig('design/head/default_title');
    
}

So you can create on Module with a special Block for printing your footer information.

Cheers

Stefan

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
 
[m] zentrale
Guru
 
Avatar
Total Posts:  401
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

i also tired it this way: Add following Code to a view/phtml file and it prints the store name:

<?php echo Mage::getStoreConfig('design/head/default_title'?>

Cheers

Stefan

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Member
 
Avatar
Total Posts:  71
Joined:  2008-05-08
China
 

Hi Stefan,

I tried your code, and it prints “Magento Commerce”, while my Store name is “Main Store”
How could this be?

I’m lost.

 Signature 

Hope it helps ! And please share with us if it is ! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
[m] zentrale
Guru
 
Avatar
Total Posts:  401
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

please try this query in your DB

SELECT *
FROM `core_config_data`
WHERE `path` = 'design/head/default_title'
LIMIT 0 30

Cheers

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
 
[m] zentrale
Guru
 
Avatar
Total Posts:  401
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

go to configuration->design->html head and change standard title. This string is taken by this method
Not the store name is taken instead page title of website configuration. Sorry, i was wrong in my prior thread

cheers

Stefan

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Member
 
Avatar
Total Posts:  71
Joined:  2008-05-08
China
 

Returns empty result set a.k.a. zero rows LOL
what does this suppose to mean?

About the HTML Head… ==> it’s not the store name isn’t it ? it’s just the title in HTML head…

Thank you very much for helping me.

 Signature 

Hope it helps ! And please share with us if it is ! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
[m] zentrale
Guru
 
Avatar
Total Posts:  401
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

yes right, its the standard html head. you can configure that for multible stores in configuration->design->html

Cheers

Stefan

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Member
 
Avatar
Total Posts:  71
Joined:  2008-05-08
China
 

Thanks,

but what i need is the store name.
which is “Main Store”.

Wonder if you can help me.

 Signature 

Hope it helps ! And please share with us if it is ! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
[m] zentrale
Guru
 
Avatar
Total Posts:  401
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

you can load store with this code. But you have to set the stroeid in load(). At the moment i dont know how else you can load name of current used store in frontend.

Mage::getModel('core/store')->load(1)->getName();

Cheers

 Signature 

Account-User: S. Bothner & A. Jaus
[m] zentrale | InternetAgentur Stuttgart & München
Agentur für Beratung, Entwicklung & Marketing.
Magento™ Silver Partner & Community Pro Member
----
Ich habe Visionen - muss ich jetzt zum Arzt?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Member
 
Avatar
Total Posts:  71
Joined:  2008-05-08
China
 

I see. I’ll give it a try on Monday.
I’m faraway from my working computer now.
I’ll tell you the results soon.
Thank you !

 Signature 

Hope it helps ! And please share with us if it is ! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lance Monotone
Member
 
Avatar
Total Posts:  57
Joined:  2008-04-16
North Adams, MA. 01247
 

I found that the CMS pages were not displaying the store title as set in System -> Manage Stores -> Store View Name -> Name.  Instead they would display only the page title, i.e., ’Home page‘, instead of ’Home page - Store Name‘.

I fixed this in ’app\code\core\Mage\Cms\Block\Page.php‘ by first copying it to ’app\code\local\Mage\Cms\Block\Page.php‘. 

Then I changed line 65 from

$head->setTitle($page->getTitle());

to

$head->setTitle($page->getTitle() . " - " . (string)Mage::getStoreConfig('system/store/name'));

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53211 users|772 users currently online|107253 forum posts