magento - What is getConfigData? -


what getconfigdata? , diff between getconfigdata , getstoreconfigdata in magento.

$this->getconfigdata('shippingspecificcountry', $store_id); 

i tried current store id , 0, both gives empty array.

can explain above method.

your question use little more context -- lacking that.

the mage::getstoreconfig method static method on global mage class, , provides access configuration values stored in magento's configuration tree. magento's configuration tree created

  1. loading xml files in app/etc/*.xml
  2. loading xml files `app/etc/modules/*.xml'
  3. merging config.xml files active modules
  4. merging in values set in core_config_data (via system -> configuration in admin)

because magento's configuration big, many module developers add methods getconfigdata or getconfig make fetching specific configuration values easy. example, consider oversimplified example

mage::getstoreconfig('foo/baz/bar') 

vs.

$this->getconfig('bar');  .... public function getconfigdata($key) {     return mage::getstoreconfig('foo/baz/' . $bar); } 

the second allows client programmer more concise code.

you can see example of in base class magento's various shipping carriers

public function getconfigdata($field) {     if (empty($this->_code)) {         return false;     }     $path = 'carriers/'.$this->_code.'/'.$field;     return mage::getstoreconfig($path, $this->getstore()); } 

here getconfigdata method automatically configuration key in carriers node -- using carrier's _code sub-node, , checking instantiated carrier object store code.

the getconfigdata method behave differently depending on class/object you're using, that's enough pointed in right direction.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -