Tip - Quick search for the invoice number



  • A must have for my shops.

    A customer has a question about his order and only gives the invoice number.

    First look for the customer, then look in his orders what he means. Search and check.

    Better and faster search in the order list for the invoice number. Either integrated as an override or as a basiscode.

    override/controllers/admin/ -> create new file “AdminOrdersController.php”

    <?php
         
        class AdminOrdersController extends AdminOrdersControllerCore
        {
            public function __construct()
            {
                parent::__construct();
         
                $this->fields_list['invoice_number'] = array(
                    'title' => $this->l('invoice'),
                    'align' => 'text-center',
                    'class' => 'fixed-width-xs'
                );
            }
        }
    
    

    0_1514214318135_10.png
    0_1514214324275_11.png



  • can an admin or moderator please move this topic to the new category Tips and Tricks



  • Thanks for this nice tip!



  • Hello,
    How to add more than one additional column? I added ‘City’ and I don’t know how to add another one like ‘postcode’.

    Thanks



  • $this->fields_list['postcode'] = array(
        'title' => $this->l('Postcode'),
        'align' => 'text-center',
        'class' => 'fixed-width-xs'
    );
    

    underneath it should be sufficient for the postcode.



  • <?php

    class AdminOrdersController extends AdminOrdersControllerCore
    {
        public function __construct()
        {
            parent::__construct();
     
            $this->fields_list['invoice_number'] = array(
                'title' => $this->l('invoice'),
                'align' => 'text-center',
                'class' => 'fixed-width-xs'
    
            $this->fields_list['postcode'] = array(
    'title' => $this->l('Postcode'),
    'align' => 'text-center',
    'class' => 'fixed-width-xs'
    

    );
    }
    }

    And after adding this I see this message.

    FatalErrorException in AdminOrdersController.php line 14:
    Parse Error: syntax error, unexpected ‘$this’ (T_VARIABLE), expecting ‘)’



  • Your code is not correct… Try this:

    <?php
         
        class AdminOrdersController extends AdminOrdersControllerCore
        {
            public function __construct()
            {
                parent::__construct();
         
                $this->fields_list['invoice_number'] = array(
                    'title' => $this->l('invoice'),
                    'align' => 'text-center',
                    'class' => 'fixed-width-xs'
                );
               $this->fields_list['postcode'] = array(
                  'title' => $this->l('Postcode'),
                  'align' => 'text-center',
                  'class' => 'fixed-width-xs'
               );
            }
        }
    


  • Thanks, it works.
    I appreciate it.


 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.