/** * Add Is Virtual checkbox html to weight field * * @return string */ public function getElementHtml() { if (!$this->getForm()->getDataObject()->getTypeInstance()->hasWeight()) { $this->_virtual->setChecked('checked'); } return parent::getElementHtml() . $this->_virtual->getElementHtml() . $this->_virtual->getLabelHtml(); }
public function getAfterElementHtml() { $html = $this->getData('after_element_html'); $product = Mage::registry('product'); $storeId = $product->getStoreId(); $store = Mage::app()->getStore($storeId); $html .= '<strong>[' . (string) $store->getBaseCurrencyCode() . ']</strong>'; if (Mage::helper('tax')->priceIncludesTax($store)) { $inclTax = Mage::helper('tax')->__('Inc. Tax'); $html .= " <strong>[{$inclTax} <span id=\"dynamic-tax-{$this->getHtmlId()}\"></span>]</strong>"; } if (!is_numeric($this->getIdentifier())) { return $html; } $data = array('name' => str_replace('[price]', '[update_price]', $this->getData('name')), 'disabled' => true); $hidden = new Varien_Data_Form_Element_Hidden($data); $hidden->setForm($this->getForm()); $data['html_id'] = str_replace('[price]', '[update_price]', $this->getHtmlId()); $data['label'] = Mage::helper('adyen_subscription')->__('Update prices of all existing subscriptions (prices be updated by cron)', $this->getData('subscription_count')); $data['value'] = 1; $checkbox = new Varien_Data_Form_Element_Checkbox($data); $checkbox->setForm($this->getForm()); $checkbox->getElementHtml(); return $html . "<br />\n" . $checkbox->getElementHtml() . $checkbox->getLabelHtml(); }
public function getElementHtml() { $element = $this->getElement(); if (!$element->getValue()) { return parent::getElementHtml(); } $element->setOnkeyup("onUrlkeyChanged('" . $element->getHtmlId() . "')"); $element->setOnchange("onUrlkeyChanged('" . $element->getHtmlId() . "')"); $data = array('name' => $element->getData('name') . '_create_redirect', 'disabled' => true); $hidden = new Varien_Data_Form_Element_Hidden($data); $hidden->setForm($element->getForm()); $storeId = $element->getForm()->getDataObject()->getStoreId(); $data['html_id'] = $element->getHtmlId() . '_create_redirect'; $data['label'] = Mage::helper('catalog')->__('Create Permanent Redirect for old URL'); $data['value'] = $element->getValue(); $data['checked'] = Mage::helper('catalog')->shouldSaveUrlRewritesHistory($storeId); $checkbox = new Varien_Data_Form_Element_Checkbox($data); $checkbox->setForm($element->getForm()); return parent::getElementHtml() . '<br/>' . $hidden->getElementHtml() . $checkbox->getElementHtml() . $checkbox->getLabelHtml(); }
public function getElementHtml() { $element = $this->getElement(); $params = $this->getRequest()->getParams(); if ($params['id']) { $product = Mage::getModel('catalog/product')->load($params['id']); foreach ($product->getOptions() as $option) { } if ($product) { switch ($product->getTypeId()) { case 'simple': case 'virtual': case 'downloadable': return parent::getElementHtml(); break; case 'grouped': case 'bundle': case 'configurable': $block = $this->getLayout()->createBlock('rewardpoints/adminhtml_gridboth'); $block->setSingle(true); $block->setFilterVisible(false); $block->setPagerVisible(false); $block->setProductId($product->getId()); $block->setProduct($product); if ($product->getTypeId() == 'configurable') { $block->setIsConfigurable(); } $data = array('name' => 'mw_show_hide_set_point', 'class' => 'mw_show_hide_set_point', 'label' => 'Set for this product?', 'value' => 0, 'checked' => false); $checkbox = new Varien_Data_Form_Element_Checkbox($data); $checkbox->setForm($element->getForm()); $html_renderer = $checkbox->getElementHtml() . "<span id='mw-lb-set-point'>" . $checkbox->getLabelHtml() . "</span>" . "<div class='mw-reward-point-product'>" . $block->toHtml() . "</div>" . "<div class='mw-reward-point-input' style='display:none'>" . parent::getElementHtml() . "</div>"; return $html_renderer; break; } } } }
/** * Return HTML code for list <label> with checkbox, checked if subscribed, otherwise not * * @param array $list List data from MC * @return string HTML code */ public function listLabel($list) { $myLists = $this->getSubscribedLists(); //if is on database it gets checked $alreadyOnList = Mage::getSingleton('monkey/asyncsubscribers')->getCollection()->addFieldToFilter('lists', $list['id'])->addFieldToFilter('email', $this->_getEmail())->addFieldToFilter('processed', 0); if (count($alreadyOnList) > 0) { $myLists[] = $list['id']; } $checkbox = new Varien_Data_Form_Element_Checkbox(); $checkbox->setForm($this->getForm()); $checkbox->setHtmlId('list-' . $list['id']); $checkbox->setChecked((bool) (is_array($myLists) && in_array($list['id'], $myLists))); $checkbox->setTitle($checkbox->getChecked() ? $this->__('Click to unsubscribe from this list.') : $this->__('Click to subscribe to this list.')); $checkbox->setLabel($list['name']); $hname = $this->_htmlGroupName($list); $checkbox->setName($hname . '[subscribed]'); $checkbox->setValue($list['id']); $checkbox->setClass('monkey-list-subscriber'); return $checkbox->getLabelHtml() . $checkbox->getElementHtml(); }
/** * Return HTML code for list <label> with checkbox, checked if subscribed, otherwise not * * @param array $list List data from MC * @return string HTML code */ public function listLabel($list) { $myLists = $this->getSubscribedLists(); $checkbox = new Varien_Data_Form_Element_Checkbox(); $checkbox->setForm($this->getForm()); $checkbox->setHtmlId('list-' . $list['id']); $checkbox->setChecked((bool) (is_array($myLists) && in_array($list['id'], $myLists))); $checkbox->setTitle($checkbox->getChecked() ? $this->__('Click to unsubscribe from this list.') : $this->__('Click to subscribe to this list.')); $checkbox->setLabel($list['name']); $hname = $this->_htmlGroupName($list); $checkbox->setName($hname . '[subscribed]'); $checkbox->setValue($list['id']); $checkbox->setClass('monkey-list-subscriber'); return $checkbox->getLabelHtml() . $checkbox->getElementHtml(); }