Jump to content

[SOLVED] Cart Rule Page adding the email address field for single customer


ronoch

Recommended Posts

Hi helper,

 

Anyone can help me that I want to add a email address field in the admin cart rule page? It is because I have created some voucher for single customer. hope that It can be showed in the admin cart rule page in BO. Thanks~ :)

 

 

post-649330-0-80750600-1398175909_thumb.png

Link to comment
Share on other sites

Hi Vekia,

 

My prestashop version is 1.5.6.2

 

Hopefully you can help me. Thanks!

 

 

 

effect:

1LoyL5j.png

 

 

open: /controllers/admin/AdminCartRulesController.php and change entire __construct() function to:

	public function __construct()
	{
		$this->table = 'cart_rule';
	 	$this->className = 'CartRule';
	 	$this->lang = true;
		$this->addRowAction('edit');
		$this->addRowAction('delete');
	 	$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
        $this->_select = 'c.*';
        $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`)';
        
		$this->fields_list = array(
			'id_cart_rule' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
			'name' => array('title' => $this->l('Name')),
            'email' => array('title'=>$this->l('email')),
			'priority' => array('title' => $this->l('Priority')),
			'code' => array('title' => $this->l('Code')),
			'quantity' => array('title' => $this->l('Quantity')),
			'date_to' => array('title' => $this->l('Until')),
			'active' => array('title' => $this->l('Status'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false),
		);

		parent::__construct();
	}
Link to comment
Share on other sites

you're welcome ;)

yeah it works, because i created code for exact version you mentioned before (this is why i asked about that, there are several differencies between PS releases)

 

i marked this topic as solved

 

with regards,

Milos

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...