ultraxa Posted October 16, 2012 Share Posted October 16, 2012 hello I try to make a module that displays a qrcode on the order page but I have to retrieve the order number how can we get that number? thanks Link to comment Share on other sites More sharing options...
bellini13 Posted October 17, 2012 Share Posted October 17, 2012 the order number is created only after payment is processed. So you will need to clarify "order page", are you referring to the order confirmation page? Or the order detail page in the history section of my account? Link to comment Share on other sites More sharing options...
ultraxa Posted October 18, 2012 Author Share Posted October 18, 2012 i want to create a module , a qr code in the order page i can create the qr code but i want to insert in the qrcode the order number order ->id don't run ect ... Link to comment Share on other sites More sharing options...
bellini13 Posted October 18, 2012 Share Posted October 18, 2012 What is the "order page"? Provide a screen shot so I understand which page you are talking about. Link to comment Share on other sites More sharing options...
ultraxa Posted October 18, 2012 Author Share Posted October 18, 2012 the page commands from a customer Link to comment Share on other sites More sharing options...
bellini13 Posted October 19, 2012 Share Posted October 19, 2012 no idea what you are saying, please provide a screen shot Link to comment Share on other sites More sharing options...
ultraxa Posted October 19, 2012 Author Share Posted October 19, 2012 hello i create the qrcode with the google api and i want inculde the order id into the qrcode like this: http://chart.apis.google.com/chart?cht=qr&chs=200x200&chl="order_id" Link to comment Share on other sites More sharing options...
bellini13 Posted October 19, 2012 Share Posted October 19, 2012 so you are trying to add the qrcode to the back office order detail page? what version of prestashop are you using? Did you create a module to hook the adminorders page, or are you customizing the adminorders tab? Link to comment Share on other sites More sharing options...
ultraxa Posted October 19, 2012 Author Share Posted October 19, 2012 i use the 1.46 version i create a module Link to comment Share on other sites More sharing options...
bellini13 Posted October 19, 2012 Share Posted October 19, 2012 and in this module, are you using a hook or are you overriding the adminorders class? Link to comment Share on other sites More sharing options...
ultraxa Posted October 20, 2012 Author Share Posted October 20, 2012 (edited) no , i have no experience with module creation i just copied a other module have you an idea for this problem ? Edited October 20, 2012 by ultraxa (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted October 20, 2012 Share Posted October 20, 2012 yes, find another module that uses the hookadminorder function, and copy it. then implement your qrcode api in that function so it appears on the admin order page. Link to comment Share on other sites More sharing options...
ultraxa Posted October 22, 2012 Author Share Posted October 22, 2012 this is orderqrcode.php <?php class order_qrcode extends Module { private $_html = ''; private $_postErrors = array(); function __construct() { $this->name = 'order_qrcode'; $this->version = 0.1; $this->tab = 'AdminOrders'; $this->page = basename(__FILE__, '.php'); parent::__construct(); $this->displayName = $this->l('QRcode order'); $this->description = $this->l('Affiche un QRcode sur les commandes'); } function install() { if (!parent::install() OR !$this->registerHook('adminOrder') OR !Configuration::updateValue('EXPINET_TOKEN', 'mytoken')) return false; } function uninstall() { if (!parent::uninstall() OR !Configuration::deleteByName('EXPINET_TOKEN')) return false; } public function displayConf() { $this->_html .= ' <div class="conf confirm"> <img src="../img/admin/ok.gif" alt="'.$this->l('Confirmation').'" /> '.$this->l('Settings updated').' </div>'; } public function displayErrors() { $nbErrors = sizeof($this->_postErrors); $this->_html .= ' <div class="alert error"> <h3>'.($nbErrors > 1 ? $this->l('There are') : $this->l('There is')).' '.$nbErrors.' '.($nbErrors > 1 ? $this->l('errors') : $this->l('error')).'</h3> <ol>'; foreach ($this->_postErrors AS $error) $this->_html .= '<li>'.$error.'</li>'; $this->_html .= ' </ol> </div>'; } function hookAdminOrder($params) { $display = ' <p> <label>ddd</label></p> <p ><img src="http://chart.apis.google.com/chart?cht=qr&chs=200x200&chl=[b][color=#ff0000]idcode[/color][/b]"/></p>'; return $display; } } ?> Link to comment Share on other sites More sharing options...
bellini13 Posted October 22, 2012 Share Posted October 22, 2012 in the hookAdminOrder function, get the order id using... $id_order=$params['id_order']; Link to comment Share on other sites More sharing options...
ultraxa Posted October 22, 2012 Author Share Posted October 22, 2012 ok !! it's good thanks a lot Link to comment Share on other sites More sharing options...
Broomer Posted November 30, 2012 Share Posted November 30, 2012 Dear People, I really like this feature a lot, can you help me out how to get my hand on this module? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now