public function getFormActionUrl() { if ($this->getRequest()->getControllerModule() === Mage::helper('autobuypromotions')->getControllerModule()) { return $this->getUrl('*/promo_autoBuyPromotions/save'); } return parent::getFormActionUrl(); }
public function __construct() { parent::__construct(); $percent = Amasty_Rules_Helper_Data::TYPE_XY_PERCENT; $fixed = Amasty_Rules_Helper_Data::TYPE_XY_FIXED; // ampromo - is correct name, it is for comatibility with Auto Add Promo Items $this->_formScripts[] = " \n\t\t\tfunction ampromo_hide() {\n\t\t\t\t\$('rule_discount_qty').up().up().show();\n\t\t\t\t\$('rule_discount_step').up().up().show();\n\t\t\t\t\$('rule_apply_to_shipping').up().up().show();\n\t\t\t\t\$('rule_actions_fieldset').up().show();\n\t\t\t\t\n\t\t\t\t\$('rule_promo_sku').up().up().hide();\n\t\t\t\t\$('rule_promo_cats').up().up().hide();\n\t\t\t\n\t\t\t\tif ('ampromo_cart' == \$('rule_simple_action').value) {\n\t\t\t\t \$('rule_actions_fieldset').up().hide(); \n\t\t\t\t\t\$('rule_discount_qty').up().up().hide();\n\t\t\t\t\t\$('rule_discount_step').up().up().hide();\n\t\t\t\t\t\n\t\t\t\t\t\$('rule_apply_to_shipping').up().up().hide();\n\t\t\t\t\t\$('rule_promo_sku').up().up().show();\n\t\t\t\t} \n\t\t\t\tif ('ampromo_items' == \$('rule_simple_action').value){\n\t\t\t\t\t\$('rule_apply_to_shipping').up().up().hide();\n\t\t\t\t\t\$('rule_promo_sku').up().up().show();\n\t\t\t\t}\n\t\t\t\tif ('{$percent}' == \$('rule_simple_action').value || '{$fixed}' == \$('rule_simple_action').value){\n\t\t\t\t\t\$('rule_promo_sku').up().up().show();\n\t\t\t\t\t\$('rule_promo_cats').up().up().show();\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tampromo_hide(); \n "; }
protected function _prepareLayout() { parent::_prepareLayout(); $role = Mage::getSingleton('aitpermissions/role'); if ($role->isPermissionsEnabled()) { $blockModel = Mage::registry('current_promo_quote_rule'); if ($blockModel->getWebsiteIds() && is_array($blockModel->getWebsiteIds())) { foreach ($blockModel->getWebsiteIds() as $blockWebsiteId) { if (!in_array($blockWebsiteId, $role->getAllowedWebsiteIds())) { $this->_removeButton('delete'); $this->_removeButton('save'); $this->_removeButton('save_and_continue_edit'); $this->_removeButton('save_and_continue'); Mage::getSingleton('adminhtml/session')->addError(Mage::helper('aitpermissions')->__('Sorry, you can not edit this rule because it is activated for the websites you do not have permissions for.')); break; } } } } return $this; }
public function __construct() { parent::__construct(); $this->_formScripts[] = " \n\t\t\tfunction ampromo_hide() {\n\t\t\t\t\$('rule_discount_qty').up().up().show();\n\t\t\t\t\$('rule_discount_step').up().up().show();\n var s = \$('rule_apply_to_shipping');\n if (s) s.up().up().show();\n\t\t\t\t\$('rule_actions_fieldset').up().show();\n\t\t\t\t\$('rule_promo_sku').up().up().hide();\n\t\t\t\n\t\t\t\tif ('ampromo_cart' == \$('rule_simple_action').value) {\n\t\t\t\t \$('rule_actions_fieldset').up().hide(); \n\t\t\t\t\t\$('rule_discount_qty').up().up().hide();\n\t\t\t\t\t\$('rule_discount_step').up().up().hide();\n\t\t\t\t\t\n\t\t\t\t\tif (s) s.up().up().hide();\n\t\t\t\t\t\$('rule_promo_sku').up().up().show();\n\t\t\t\t} \n\t\t\t\tif ('ampromo_items' == \$('rule_simple_action').value){\n\t\t\t\t\tif (s) s.up().up().hide();\n\t\t\t\t\t\$('rule_promo_sku').up().up().show();\n\t\t\t\t}\n\t\t\t}\n\t\t\tampromo_hide();\n "; }