35

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 :)

Joe Mastey
  • 26,809
  • 13
  • 80
  • 104
Michael O'Loughlin
  • 567
  • 2
  • 6
  • 18

1 Answers1

88

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

balexandre
  • 73,608
  • 45
  • 233
  • 342
  • Good hint. I only found that `{{config path...}}` thing works for `general/store_information/...`, but not for `general/imprint/fax` for example. – Anse Oct 11 '16 at 15:13
  • In newer Magento CE versions, these variables seem to need to be allowed for usage in static blocks. See System > Permissions > Variables – Anse Oct 12 '16 at 12:58