/** * Add a field to the form or fieldset * Form and fieldset have same abstract * * @param Varien_Data_Form|Varien_Data_Form_Element_Fieldset $formOrFieldset * @param string $elementName * @param array $options * @param string $type * @return Varien_Data_Form_Element_Abstract */ protected function _addField($formOrFieldset, $elementName, $options = array(), $type = 'text') { $options = array_merge($options, array('name' => $elementName, 'label' => $this->_profile->getFieldLabel($elementName), 'note' => $this->_profile->getFieldComment($elementName), 'disabled' => $this->_isReadOnly)); if (in_array($elementName, array('period_unit', 'period_frequency'))) { $options['required'] = true; } return $formOrFieldset->addField($elementName, $type, $options); }
/** * Prepare profile payments info */ public function prepareFeesInfo() { $this->_shouldRenderInfo = true; $this->_addInfo(array('label' => $this->_profile->getFieldLabel('currency_code'), 'value' => $this->_profile->getCurrencyCode())); foreach (array('init_amount', 'trial_billing_amount', 'billing_amount', 'tax_amount', 'shipping_amount') as $key) { $value = $this->_profile->getData($key); if ($value) { $this->_addInfo(array('label' => $this->_profile->getFieldLabel($key), 'value' => Mage::helper('core')->formatCurrency($value, false), 'is_amount' => true)); } } }