Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento: Get store contact telephone

Tags:

magento

Seems like it should be simple, but cant find a solution anywhere. I need to output the Store Contact Telephone number, which is in Store Informtion in the admin.

I need to output it in template files and CMS pages, what would the code be for each?

Thanks :)

like image 525
Michael O'Loughlin Avatar asked Mar 07 '11 15:03

Michael O'Loughlin


1 Answers

That's a Core configuration, so it's saved in core_config_data table, and the phone information is the field:

general/store_information/phone

So, all you need is to read the configuration data as

$storePhone = Mage::getStoreConfig('general/store_information/phone');

For CMS pages insert the following variable:

{{config path="general/store_information/phone"}}

You can find more info on this here, and you can always do the reverse programmatically

like image 54
balexandre Avatar answered Oct 21 '22 00:10

balexandre