protected function _prepareColumns() { parent::_prepareColumns(); if (!Mage::helper('smvendors')->getVendorLogin()) { $this->addColumnAfter('vendor_name', array('header' => Mage::helper('salesrule')->__('Vendor'), 'align' => 'left', 'width' => '120px', 'index' => 'vendor_name'), 'name'); $this->sortColumnsByOrder(); } return $this; }
protected function _prepareColumns() { parent::_prepareColumns(); $positionColumn = $this->getColumn('sort_order'); if ($positionColumn) { $positionColumn->setWidth('20px'); } $this->addColumnAfter('simple_action', array('header' => Mage::helper('salesrule')->__('Action'), 'width' => '120px', 'type' => 'options', 'options' => $this->getDiscountTypes(), 'index' => 'simple_action'), 'coupon_code'); $this->addColumnAfter('discount_amount', array('header' => Mage::helper('sales')->__('Discount'), 'align' => 'right', 'index' => 'discount_amount', 'getter' => array($this, 'formatDiscount')), 'simple_action'); $this->addColumnAfter('stop_rules_processing', array('header' => $this->__('Stop'), 'index' => 'stop_rules_processing', 'type' => 'options', 'options' => array(1 => Mage::helper('salesrule')->__('Yes'), 0 => Mage::helper('salesrule')->__('No'))), 'to_date'); $this->addColumn('action', array('header' => Mage::helper('catalog')->__('Action'), 'width' => '50px', 'type' => 'action', 'actions' => array(array('caption' => Mage::helper('catalog')->__('Duplicate'), 'url' => array('base' => 'ampromocopy/adminhtml_index/duplicate'), 'field' => 'rule_id')), 'filter' => false, 'sortable' => false, 'index' => 'rule_id', 'is_system' => true)); $this->sortColumnsByOrder(); return $this; }
/** * Add grid columns * * @return Mage_Adminhtml_Block_Promo_Quote_Grid */ protected function _prepareColumns() { $this->addColumn('rule_id', array('header' => Mage::helper('salesrule')->__('ID'), 'align' => 'right', 'width' => '50px', 'index' => 'rule_id')); $this->addColumn('name', array('header' => Mage::helper('salesrule')->__('Rule Name'), 'align' => 'left', 'index' => 'name')); $this->addColumn('coupon_code', array('header' => Mage::helper('salesrule')->__('Coupon Code'), 'align' => 'left', 'width' => '150px', 'index' => 'code')); $this->addColumn('from_date', array('header' => Mage::helper('salesrule')->__('Date Start'), 'align' => 'left', 'width' => '120px', 'type' => 'date', 'index' => 'from_date')); $this->addColumn('to_date', array('header' => Mage::helper('salesrule')->__('Date Expire'), 'align' => 'left', 'width' => '120px', 'type' => 'date', 'default' => '--', 'index' => 'to_date')); $this->addColumn('is_active', array('header' => Mage::helper('salesrule')->__('Status'), 'align' => 'left', 'width' => '80px', 'index' => 'is_active', 'type' => 'options', 'options' => array(1 => 'Active', 0 => 'Inactive'))); if (!Mage::app()->isSingleStoreMode()) { $this->addColumn('rule_website', array('header' => Mage::helper('salesrule')->__('Website'), 'align' => 'left', 'index' => 'website_ids', 'type' => 'options', 'sortable' => false, 'options' => Mage::getSingleton('adminhtml/system_store')->getWebsiteOptionHash(), 'width' => 200)); } $this->addColumn('sort_order', array('header' => Mage::helper('salesrule')->__('Priority'), 'align' => 'right', 'index' => 'sort_order', 'width' => 100)); $this->addColumn('times_used', array('header' => Mage::helper('salesrule')->__('Times Used'), 'align' => 'left', 'index' => 'times_used', 'width' => 100)); $this->addExportType('*/*/exportCsv', Mage::helper('coupon')->__('CSV')); // $this->addExportType('*/*/exportXml', Mage::helper('coupon')->__('XML')); parent::_prepareColumns(); return $this; }
protected function _prepareCollection() { $collection = Mage::getModel('salesrule/rule')->getResourceCollection()->addFieldToFilter("points_action", array(array(array('eq' => ''), array('null' => true)))); $this->setCollection($collection); return parent::_prepareCollection(); }
/** * Constructor */ public function __construct() { parent::__construct(); $this->_loadCustomerGroupNames(); $this->setTemplate('n98_managerules/promo_quote_grid.phtml'); }