Search code examples
magentoconfigstorepayment

How to get order store config variable in Admin


I created a module where it return via xml the payment details in Magento Admin order page. It works very well with a single store config data.

But if I have diferents payment credentials for Store Id 1 and store Id 2 [p.e. for backoffice key 1111-1111-1111-1111 (store 1) and other 2222-2222-2222-2222 (store 2), I only can return the default values for admin view with this function...

$subent_id = Mage::getStoreConfig('payment/multibancopayment/subentidade');

Does any one khow how i can get store specific data based in order store id? Example: in admin order page details, if the order was made in store 1 I need 1111-1111-1111-1111, but if was made in store 2, I need 2222-2222-2222-2222. For now I'm just getting default values with the function above.

MB payment


Solution

  • Did you try

    $subent_id = Mage::getStoreConfig('payment/multibancopayment/subentidade', $storeIdHere);
    

    See /app/Mage.php

    /**
     * Retrieve config value for store by path
     *
     * @param string $path
     * @param mixed $store
     * @return mixed
     */
    public static function getStoreConfig($path, $store = null)
    {
        return self::app()->getStore($store)->getConfig($path);
    }
    

    Entire class here