title: Adding a new column in the list of orders PrestaShop 1.7.7.0
body: <p>I want to add a new column in the order table grid in PrestaShop 1.7.7.0.</p>
  <p>Currently, I've only managed to add a new column that gets its values based on the SQL query (code below).
  However, I need to redo it so that it gets $ id_order from the current row of the table and processes it according to some function. Before it was done like this:</p>
  <p>AdminOrdersController.php</p>
  <pre><code>$this-&gt;fields_list = array(
      'id_order' =&gt; array(
          'title' =&gt; $this-&gt;trans('ID', array(), 'Admin.Global'),
          'align' =&gt; 'text-center',
          'class' =&gt; 'fixed-width-xs',
      ),
  (...)
      'ms_pelne' =&gt; array(
          'title' =&gt; $this-&gt;trans('Pełne', array(), 'Admin.Global'),
          'align' =&gt; 'text-center',
          'callback' =&gt; 'msSprawdzZamowienie',
          'orderby' =&gt; false,
          'search' =&gt; false,
          'remove_onclick' =&gt; true,
      ),
  ));
  
  public function msSprawdzZamowienie($id_order, $tr)
  {
     (...)
  }
  </code></pre>
  <p>Currently, unfortunately it does not work ...
  My present code is:</p>
  <pre><code>&lt;?php
  use PrestaShop\PrestaShop\Core\Grid\Column\Type\DataColumn;
  use PrestaShop\PrestaShop\Core\Grid\Filter\Filter;
  use Symfony\Component\Form\Extension\Core\Type\TextType;
  
  use PrestaShop\PrestaShop\Core\Grid\Column\Type\Common\BadgeColumn;
  use PrestaShop\PrestaShop\Core\Grid\Column\ColumnCollection;
  
  if (!defined('_PS_VERSION_')) {
      exit;
  }
  
  class ms_MontowniaStron extends Module
  {
  
      // const CLASS_NAME = 'ms_mstron2';
  
      public function __construct()
      {
          $this-&gt;name = 'ms_montowniastron';
          $this-&gt;tab = 'front_office_features';
          $this-&gt;version = '1.0.0';
          $this-&gt;author = 'ms';
          $this-&gt;need_instance = 0;
          $this-&gt;ps_versions_compliancy = [
              'min' =&gt; '1.7',
              'max' =&gt; _PS_VERSION_
          ];
          $this-&gt;bootstrap = false;
  
          parent::__construct();
  
          $this-&gt;displayName = $this-&gt;l('MS Pełne Zamówienie');
          $this-&gt;description = $this-&gt;l('Moduł pozwalający na wyświetlanie informacji o pełnym zamówieniu.');
  
          $this-&gt;confirmUninstall = $this-&gt;l('Are you sure you want to uninstall?');
      }
  
  
  
  
      /**
       * Install module and register hooks to allow grid modification.
       *
       * @see https://devdocs.prestashop.com/1.7/modules/concepts/hooks/use-hooks-on-modern-pages/
       *
       * @return bool
       */
      public function install()
      {
          if (!parent::install()
              //Installation des hooks
              || !$this-&gt;registerHook([
                  'actionOrderGridDefinitionModifier',
                  'actionOrderGridQueryBuilderModifier',
                  'actionOrderGridDataModifier',
                  'actionOrderGridPresenterModifier'
              ])
          ) {
              return false;
          }
  
          return true;
      }
  
  
  
      public function uninstall() {
          return parent::uninstall();
      }
  
  
  
  
      /**
       * Hooks allows to modify Customer grid definition.
       * This hook is a right place to add/remove columns or actions (bulk, grid).
       *
       * @param array $params
       */
      public function hookActionOrderGridDefinitionModifier(array $params)
      {
  
  
          /** @var GridDefinitionInterface $definition */
          $definition = $params['definition'];
  
          /** @var ColumnCollection */
          $columns = $definition-&gt;getColumns();
  
          // dodajemy nową
          $definition
          -&gt;getColumns()
          -&gt;addAfter(
              'id_order',
              (new BadgeColumn('ms_full_order'))
                  -&gt;setName($this-&gt;l('Pełne'))
                  -&gt;setOptions([
                      'field' =&gt; 'ms_full_order',
                      'badge_type' =&gt; 'success',
                      'empty_value' =&gt; '--',
                  ])
          );
  
      }
  
  
      public function hookActionOrderGridQueryBuilderModifier(array $params)
      {
          
          $searchQueryBuilder = $params['search_query_builder'];
  
          $searchQueryBuilder-&gt;addSelect('(
  
              SELECT
                id_order
              FROM
                ms_orders AS msg
                LIMIT 1
                  
  
          ) as ms_full_order');
  
      }
  
  
  
  }
  ?&gt;
  </code></pre>