Пример #1
0
 /**
  * @return Netz98_CustomerGroup_Block_Adminhtml_System_Config_Form
  */
 protected function _initObjects()
 {
     parent::_initObjects();
     $sections = $this->_configFields->getSection($this->getSectionCode(), $this->getWebsiteCode(), $this->getStoreCode());
     /**
      * Create config field during runtime.
      *
      * Check if we are in sales tab and sub-tab payment or shipping.
      * Then we create SimpleXMLElements for form init.
      */
     if ($sections->tab == 'sales' && in_array($sections->getName(), array('payment', 'carriers'))) {
         //
         // Standard payment and shipping sections
         //
         foreach ($sections->groups as $group) {
             foreach ($group as $subGroup) {
                 if (in_array($subGroup->getName(), array('paypal_payment_solutions', 'paypal_alternative_payment_methods', 'account'))) {
                     continue;
                 }
                 if (isset($subGroup->fields)) {
                     $this->_addFieldToConfigGroup($subGroup);
                 }
             }
         }
     } elseif ($sections->tab == 'sales' && $sections->getName() == 'paypal') {
         ///
         // PayPal
         //
         if (isset($sections->groups->express)) {
             $this->_addFieldToConfigGroup($sections->groups->express);
         }
         if (isset($sections->groups->wps)) {
             $this->_addFieldToConfigGroup($sections->groups->wps);
         }
     }
     /* elseif ($sections->tab == 'sales' && $sections->getName() == 'google') {
            //
            // Google checkout and shipping
            //
            if (isset($sections->groups->checkout)) {
                $this->_addFieldToConfigGroup($sections->groups->checkout);
            }
            if (isset($sections->groups->checkout_shipping_merchant)) {
                $this->_addFieldToConfigGroup($sections->groups->checkout_shipping_merchant);
            }
            if (isset($sections->groups->checkout_shipping_carrier)) {
                $this->_addFieldToConfigGroup($sections->groups->checkout_shipping_carrier);
            }
            if (isset($sections->groups->checkout_shipping_flatrate)) {
                $this->_addFieldToConfigGroup($sections->groups->checkout_shipping_flatrate);
            }
            if (isset($sections->groups->checkout_shipping_virtual)) {
                $this->_addFieldToConfigGroup($sections->groups->checkout_shipping_virtual);
            }
        }*/
     return $this;
 }
Пример #2
0
 /**
  * @return Wage_ShippingDescription_Block_Adminhtml_System_Config_Form
  */
 protected function _initObjects()
 {
     parent::_initObjects();
     $sections = $this->_configFields->getSection($this->getSectionCode(), $this->getWebsiteCode(), $this->getStoreCode());
     if ($sections->tab == 'sales' && in_array($sections->getName(), array('carriers'))) {
         //
         // Standard payment and shipping sections
         //
         foreach ($sections->groups as $group) {
             foreach ($group as $key => $subGroup) {
                 if (isset($subGroup->fields)) {
                     $this->_addFieldToConfigGroup($subGroup);
                 }
             }
         }
     }
     return $this;
 }
Пример #3
0
 /**
  * Initialize properties of object required for test.
  *
  * @return Mage_Adminhtml_Block_System_Config_Form
  */
 protected function _initObjects()
 {
     parent::_initObjects();
     $this->_configData = $this->_configDataStub;
     $this->_defaultFieldRenderer = new Mage_Adminhtml_Block_System_Config_Form_Field();
 }