Magento: Get store address, phone number or other config information

Here is how to get the the store config information for the phone number:

<?php echo Mage::getStoreConfig(‘general/store_information/phone’);?>

And for the address:

<?php echo Mage::getStoreConfig(‘general/store_information/address’);?>

In fact you can get all sorts of interesting “config” data out using this ¬†getStoreConfig method.

In the core_config_data database table (check your table prefixes) you will see a whole load of configuration settings. These are all effectively identified by the path.  Here is list of the paths from one of my magento installations:

admin/dashboard/enable_charts
catalog/category/root_id
catalog/custom_options/date_fields_order
catalog/custom_options/time_format
catalog/custom_options/use_calendar
catalog/custom_options/year_range
catalog/downloadable/content_disposition
catalog/downloadable/disable_guest_checkout
catalog/downloadable/downloads_number
catalog/downloadable/links_target_new_window
catalog/downloadable/links_title
catalog/downloadable/order_item_status
catalog/downloadable/samples_title
catalog/downloadable/shareable
catalog/frontend/default_sort_by
catalog/frontend/flat_catalog_category
catalog/frontend/flat_catalog_product
catalog/frontend/grid_per_page
catalog/frontend/grid_per_page_values
catalog/frontend/list_allow_all
catalog/frontend/list_mode
catalog/frontend/list_per_page
catalog/frontend/list_per_page_values
catalog/frontend/parse_url_directives
catalog/layered_navigation/display_product_count
catalog/layered_navigation/price_range_calculation
catalog/navigation/max_depth
catalog/price/scope
catalog/product_image/base_width
catalog/product_image/max_dimension
catalog/product_image/small_width
catalog/productalert/allow_price
catalog/productalert/allow_stock
catalog/productalert/email_identity
catalog/productalert/email_price_template
catalog/productalert/email_stock_template
catalog/productalert_cron/error_email
catalog/productalert_cron/error_email_identity
catalog/productalert_cron/error_email_template
catalog/productalert_cron/frequency
catalog/productalert_cron/time
catalog/recently_products/compared_count
catalog/recently_products/scope
catalog/recently_products/viewed_count
catalog/review/allow_guest
catalog/search/max_query_length
catalog/search/max_query_words
catalog/search/min_query_length
catalog/search/search_type
catalog/search/show_autocomplete_results_count
catalog/search/use_layered_navigation_count
catalog/seo/category_canonical_tag
catalog/seo/category_url_suffix
catalog/seo/product_canonical_tag
catalog/seo/product_url_suffix
catalog/seo/product_use_categories
catalog/seo/save_rewrites_history
catalog/seo/search_terms
catalog/seo/site_map
catalog/seo/title_separator
catalog/sitemap/lines_perpage
catalog/sitemap/tree_mode
cataloginventory/item_options/auto_return
cataloginventory/item_options/backorders
cataloginventory/item_options/enable_qty_increments
cataloginventory/item_options/manage_stock
cataloginventory/item_options/max_sale_qty
cataloginventory/item_options/min_qty
cataloginventory/item_options/min_sale_qty
cataloginventory/item_options/notify_stock_qty
cataloginventory/options/can_back_in_stock
cataloginventory/options/can_subtract
cataloginventory/options/display_product_stock_status
cataloginventory/options/show_out_of_stock
cataloginventory/options/stock_threshold_qty
cms/wysiwyg/enabled
cms/wysiwyg/use_static_urls_in_catalog
crontab/jobs/catalog_product_alert/run/model
crontab/jobs/catalog_product_alert/schedule/cron_expr
currency/options/allow
currency/options/base
currency/options/default
design/email/css_non_inline
design/email/footer
design/email/header
design/email/logo
design/email/logo_alt
design/email/logo_height
design/email/logo_width
design/footer/absolute_footer
design/footer/copyright
design/head/default_description
design/head/default_keywords
design/head/default_robots
design/head/default_title
design/head/demonotice
design/head/includes
design/head/shortcut_icon
design/head/title_prefix
design/head/title_suffix
design/header/logo_alt
design/header/logo_src
design/header/logo_src_small
design/header/welcome
design/package/name
design/package/ua_regexp
design/pagination/anchor_text_for_next
design/pagination/anchor_text_for_previous
design/pagination/pagination_frame
design/pagination/pagination_frame_skip
design/theme/default
design/theme/default_ua_regexp
design/theme/layout
design/theme/layout_ua_regexp
design/theme/locale
design/theme/skin
design/theme/skin_ua_regexp
design/theme/template
design/theme/template_ua_regexp
design/watermark/image_imageOpacity
design/watermark/image_position
design/watermark/image_size
design/watermark/small_image_imageOpacity
design/watermark/small_image_position
design/watermark/small_image_size
design/watermark/thumbnail_imageOpacity
design/watermark/thumbnail_position
design/watermark/thumbnail_size
general/country/allow
general/country/default
general/country/eu_countries
general/country/optional_zip_countries
general/locale/code
general/locale/firstday
general/locale/timezone
general/locale/weekend
general/region/display_all
general/region/state_required
general/store_information/address
general/store_information/hours
general/store_information/merchant_country
general/store_information/merchant_vat_number
general/store_information/name
general/store_information/phone
google/analytics/account
google/analytics/active
google/analytics/anonymization
google/analytics/type
google/recaptcha/enabled
google/recaptcha/enabled_routes
google/recaptcha/secret_key
google/recaptcha/site_key
google/recaptcha/size
google/recaptcha/theme
google/recaptcha/type
imageslider/general/description
imageslider/general/enabled
imageslider/general/imageheight
imageslider/general/imagewidth
imageslider/general/loader
imageslider/general/navigation
imageslider/general/slidingeffecttime
imageslider/general/slidingtime
imageslider/general/style
imageslider/general/thumbnails
imageslider/style/captionbgcolor
imageslider/style/captiontextcolor
imageslider/style/loaderBgColor
imageslider/style/loaderColor
imageslider/style/navcolor
imageslider/style/paginationcolor
imageslider/style/paginationdotcolor
payment/hosted_pro/mobile_optimized
payment/payflow_advanced/mobile_optimized
payment/payflow_link/mobile_optimized
payment/paypal_express/skip_order_review_step
web/secure/base_url
web/seo/use_rewrites
web/unsecure/base_url

You can substitute any of those paths into the getStoreConfig() method

<?php echo Mage::getStoreConfig(‘[CHOSEN PATH’);?>

Facebook Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Apply your human brain cells and complete this highly complicated maths problem *