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
- loading xml files in
app/etc/*.xml - loading xml files `app/etc/modules/*.xml'
- merging
config.xmlfiles active modules - merging in values set in
core_config_data(viasystem -> configurationin 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
Post a Comment