i started camaping on groupon, my customers received voucher codes.
now i want to display (only if voucher code was used) voucher code on orders product list
Posted 26 April 2014 - 08:28 PM
i started camaping on groupon, my customers received voucher codes.
now i want to display (only if voucher code was used) voucher code on orders product list
Posted 27 April 2014 - 10:31 AM
in this case it's necessary to modify controller named AdminOrdersController located in directory:
/controllers/admin/ filename: AdminOrdersController.php
use this __construct() function instead of original:
public function __construct() { $this->bootstrap = true; $this->table = 'order'; $this->className = 'Order'; $this->lang = false; $this->addRowAction('view'); $this->explicitSelect = true; $this->allow_export = true; $this->deleted = false; $this->context = Context::getContext(); $this->_select = ' ocr.`name` AS vname, a.id_currency, a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new, country_lang.name as cname, IF(a.valid, 1, 0) badge_success'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'order_cart_rule` AS ocr ON ocr.`id_order` = a.`id_order` LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) INNER JOIN `'._DB_PREFIX_.'address` address ON address.id_address = a.id_address_delivery INNER JOIN `'._DB_PREFIX_.'country` country ON address.id_country = country.id_country INNER JOIN `'._DB_PREFIX_.'country_lang` country_lang ON (country.`id_country` = country_lang.`id_country` AND country_lang.`id_lang` = '.(int)$this->context->language->id.') LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`) LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$this->context->language->id.')'; $this->_orderBy = 'id_order'; $this->_orderWay = 'DESC'; $statuses = OrderState::getOrderStates((int)$this->context->language->id); foreach ($statuses as $status) $this->statuses_array[$status['id_order_state']] = $status['name']; $this->fields_list = array( 'id_order' => array( 'title' => $this->l('ID'), 'align' => 'text-center', 'class' => 'fixed-width-xs' ), 'reference' => array( 'title' => $this->l('Reference') ), 'vname' => array( 'title' => $this->l('voucher name') ), 'new' => array( 'title' => $this->l('New client'), 'align' => 'text-center', 'type' => 'bool', 'tmpTableFilter' => true, 'orderby' => false ), 'customer' => array( 'title' => $this->l('Customer'), 'havingFilter' => true, ), );
effect:
Posted 12 May 2015 - 05:12 AM
This is great Coding technique.. you are genius We offer Best Service for prestashop http://evincetech.co...tomisation.html