prestashop admin sorting and filtering in list view











up vote
0
down vote

favorite












I've create a custom module for import n products
(Prestashop 1.6.1.7)
is all ok,
but when I try to filter a search (there are 1882 records)
the filter doesn't work.
I've read other post about the problem but I don't understand if there is a problem into my controller or if I forget something.
I have one table (cpld_articles) where are stored these data



this is my controller



require_once (_PS_MODULE_DIR_ . 'forniture/classes/cpld.core.php');

class AdminFornitureController extends ModuleAdminController {

protected $position_identifier = 'id';

public function init() {



// Set variables
$this->context = Context::getContext();
$this->table = 'cpld_subcategory';
$this->article_table = 'cpld_articles';
$this->className = 'cpld';
$this->identifier = 'id';
$this->_defaultOrderBy = 'id';
$this->bootstrap = true;
$this->lang = false;

$this->addRowAction('edit');
$this->addRowAction('view');
$this->addRowAction('update');
$this->addRowAction('import');

$this->fields_list = array(
'id' => array(
'title' => $this->l('ID'),
'align' => 'center',
'width' => 50,
'type' => 'int'
),

'id_parent' => array(
'title' => $this->l('ParentID'),
'width' => 50,
'class' => 'fixed-width-xs',
'type' => 'int'
),
'categoria_app' => array(
'title' => $this->l('Categoria > Sottocategoria'),
'width' => 200
),
'titolo' => array(
'title' => $this->l('Titolo'),
'width' => 150,
'type' => 'text',
'filter_key' => $this->table.'!titolo',
),
'n_articoli' => array(
'title' => $this->l('N° Articoli'),
'width' => 50,
'type' => 'int',
),
'abilitato' => array(
'title' => $this->l('Abilitato'),
'type' => 'bool',
'active' => true,
'filter_key' => $this->table.'!abilitato',
'class' => 'fixed-width-sm'
),
//'abilitato' => array('title' => $this->l('abilitato'), 'active' => '1', 'class' => 'fixed-width-sm'),
'ricarico' => array(
'title' => $this->l('Ricarico %'),
//'type' => 'editable',
'width' => 50,
'type' => 'int',
'filter_key' => 'ricarico',
'search' => true
),
'reg_iva' => array(
'title' => $this->l('IVA'),
'width' => 50,
'type' => 'int',
'filter_key' => 'reg_iva',
'search' => true
),
'data_ins' => array(
'title' => $this->l('Date Add'),
'type' => 'datetime'
),
'data_upd' => array(
'title' => $this->l('Date Upd'),
'type' => 'datetime'
),
);

// Call of the parent constructor method
parent::init();

}


This is cpld.core.php



class cpld extends ObjectModel {

/** @var string Name */
public $id;
public $cod_int;
public $id_parent;
public $categoria_app;
public $titolo;
public $n_articoli;
public $abilitato;
public $ricarico;
public $reg_iva;
public $cat_presta;
public $data_ins;
public $data_upd;
public static $definition = array(
'table' => 'cpld_subcategory',
'primary' => 'id',
'multilang' => FALSE,
'fields' => array(
'id' => array('type' => self::TYPE_INT),
'cod_int' => array('type' => self::TYPE_INT),
'id_parent' => array('type' => self::TYPE_INT),
'categoria_app' => array('type' => self::TYPE_STRING),
'titolo' => array('type' => self::TYPE_STRING),
'n_articoli' => array('type' => self::TYPE_INT),
'abilitato' => array('type' => self::TYPE_ENUM),
'ricarico' => array('type' => self::TYPE_INT),
'reg_iva' => array('type' => self::TYPE_INT),
'cat_presta' => array('type' => self::TYPE_STRING),
'data_ins' => array('type' => self::TYPE_DATE),
'data_upd' => array('type' => self::TYPE_DATE)
),
);


Thanks for your support










share|improve this question


























    up vote
    0
    down vote

    favorite












    I've create a custom module for import n products
    (Prestashop 1.6.1.7)
    is all ok,
    but when I try to filter a search (there are 1882 records)
    the filter doesn't work.
    I've read other post about the problem but I don't understand if there is a problem into my controller or if I forget something.
    I have one table (cpld_articles) where are stored these data



    this is my controller



    require_once (_PS_MODULE_DIR_ . 'forniture/classes/cpld.core.php');

    class AdminFornitureController extends ModuleAdminController {

    protected $position_identifier = 'id';

    public function init() {



    // Set variables
    $this->context = Context::getContext();
    $this->table = 'cpld_subcategory';
    $this->article_table = 'cpld_articles';
    $this->className = 'cpld';
    $this->identifier = 'id';
    $this->_defaultOrderBy = 'id';
    $this->bootstrap = true;
    $this->lang = false;

    $this->addRowAction('edit');
    $this->addRowAction('view');
    $this->addRowAction('update');
    $this->addRowAction('import');

    $this->fields_list = array(
    'id' => array(
    'title' => $this->l('ID'),
    'align' => 'center',
    'width' => 50,
    'type' => 'int'
    ),

    'id_parent' => array(
    'title' => $this->l('ParentID'),
    'width' => 50,
    'class' => 'fixed-width-xs',
    'type' => 'int'
    ),
    'categoria_app' => array(
    'title' => $this->l('Categoria > Sottocategoria'),
    'width' => 200
    ),
    'titolo' => array(
    'title' => $this->l('Titolo'),
    'width' => 150,
    'type' => 'text',
    'filter_key' => $this->table.'!titolo',
    ),
    'n_articoli' => array(
    'title' => $this->l('N° Articoli'),
    'width' => 50,
    'type' => 'int',
    ),
    'abilitato' => array(
    'title' => $this->l('Abilitato'),
    'type' => 'bool',
    'active' => true,
    'filter_key' => $this->table.'!abilitato',
    'class' => 'fixed-width-sm'
    ),
    //'abilitato' => array('title' => $this->l('abilitato'), 'active' => '1', 'class' => 'fixed-width-sm'),
    'ricarico' => array(
    'title' => $this->l('Ricarico %'),
    //'type' => 'editable',
    'width' => 50,
    'type' => 'int',
    'filter_key' => 'ricarico',
    'search' => true
    ),
    'reg_iva' => array(
    'title' => $this->l('IVA'),
    'width' => 50,
    'type' => 'int',
    'filter_key' => 'reg_iva',
    'search' => true
    ),
    'data_ins' => array(
    'title' => $this->l('Date Add'),
    'type' => 'datetime'
    ),
    'data_upd' => array(
    'title' => $this->l('Date Upd'),
    'type' => 'datetime'
    ),
    );

    // Call of the parent constructor method
    parent::init();

    }


    This is cpld.core.php



    class cpld extends ObjectModel {

    /** @var string Name */
    public $id;
    public $cod_int;
    public $id_parent;
    public $categoria_app;
    public $titolo;
    public $n_articoli;
    public $abilitato;
    public $ricarico;
    public $reg_iva;
    public $cat_presta;
    public $data_ins;
    public $data_upd;
    public static $definition = array(
    'table' => 'cpld_subcategory',
    'primary' => 'id',
    'multilang' => FALSE,
    'fields' => array(
    'id' => array('type' => self::TYPE_INT),
    'cod_int' => array('type' => self::TYPE_INT),
    'id_parent' => array('type' => self::TYPE_INT),
    'categoria_app' => array('type' => self::TYPE_STRING),
    'titolo' => array('type' => self::TYPE_STRING),
    'n_articoli' => array('type' => self::TYPE_INT),
    'abilitato' => array('type' => self::TYPE_ENUM),
    'ricarico' => array('type' => self::TYPE_INT),
    'reg_iva' => array('type' => self::TYPE_INT),
    'cat_presta' => array('type' => self::TYPE_STRING),
    'data_ins' => array('type' => self::TYPE_DATE),
    'data_upd' => array('type' => self::TYPE_DATE)
    ),
    );


    Thanks for your support










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I've create a custom module for import n products
      (Prestashop 1.6.1.7)
      is all ok,
      but when I try to filter a search (there are 1882 records)
      the filter doesn't work.
      I've read other post about the problem but I don't understand if there is a problem into my controller or if I forget something.
      I have one table (cpld_articles) where are stored these data



      this is my controller



      require_once (_PS_MODULE_DIR_ . 'forniture/classes/cpld.core.php');

      class AdminFornitureController extends ModuleAdminController {

      protected $position_identifier = 'id';

      public function init() {



      // Set variables
      $this->context = Context::getContext();
      $this->table = 'cpld_subcategory';
      $this->article_table = 'cpld_articles';
      $this->className = 'cpld';
      $this->identifier = 'id';
      $this->_defaultOrderBy = 'id';
      $this->bootstrap = true;
      $this->lang = false;

      $this->addRowAction('edit');
      $this->addRowAction('view');
      $this->addRowAction('update');
      $this->addRowAction('import');

      $this->fields_list = array(
      'id' => array(
      'title' => $this->l('ID'),
      'align' => 'center',
      'width' => 50,
      'type' => 'int'
      ),

      'id_parent' => array(
      'title' => $this->l('ParentID'),
      'width' => 50,
      'class' => 'fixed-width-xs',
      'type' => 'int'
      ),
      'categoria_app' => array(
      'title' => $this->l('Categoria > Sottocategoria'),
      'width' => 200
      ),
      'titolo' => array(
      'title' => $this->l('Titolo'),
      'width' => 150,
      'type' => 'text',
      'filter_key' => $this->table.'!titolo',
      ),
      'n_articoli' => array(
      'title' => $this->l('N° Articoli'),
      'width' => 50,
      'type' => 'int',
      ),
      'abilitato' => array(
      'title' => $this->l('Abilitato'),
      'type' => 'bool',
      'active' => true,
      'filter_key' => $this->table.'!abilitato',
      'class' => 'fixed-width-sm'
      ),
      //'abilitato' => array('title' => $this->l('abilitato'), 'active' => '1', 'class' => 'fixed-width-sm'),
      'ricarico' => array(
      'title' => $this->l('Ricarico %'),
      //'type' => 'editable',
      'width' => 50,
      'type' => 'int',
      'filter_key' => 'ricarico',
      'search' => true
      ),
      'reg_iva' => array(
      'title' => $this->l('IVA'),
      'width' => 50,
      'type' => 'int',
      'filter_key' => 'reg_iva',
      'search' => true
      ),
      'data_ins' => array(
      'title' => $this->l('Date Add'),
      'type' => 'datetime'
      ),
      'data_upd' => array(
      'title' => $this->l('Date Upd'),
      'type' => 'datetime'
      ),
      );

      // Call of the parent constructor method
      parent::init();

      }


      This is cpld.core.php



      class cpld extends ObjectModel {

      /** @var string Name */
      public $id;
      public $cod_int;
      public $id_parent;
      public $categoria_app;
      public $titolo;
      public $n_articoli;
      public $abilitato;
      public $ricarico;
      public $reg_iva;
      public $cat_presta;
      public $data_ins;
      public $data_upd;
      public static $definition = array(
      'table' => 'cpld_subcategory',
      'primary' => 'id',
      'multilang' => FALSE,
      'fields' => array(
      'id' => array('type' => self::TYPE_INT),
      'cod_int' => array('type' => self::TYPE_INT),
      'id_parent' => array('type' => self::TYPE_INT),
      'categoria_app' => array('type' => self::TYPE_STRING),
      'titolo' => array('type' => self::TYPE_STRING),
      'n_articoli' => array('type' => self::TYPE_INT),
      'abilitato' => array('type' => self::TYPE_ENUM),
      'ricarico' => array('type' => self::TYPE_INT),
      'reg_iva' => array('type' => self::TYPE_INT),
      'cat_presta' => array('type' => self::TYPE_STRING),
      'data_ins' => array('type' => self::TYPE_DATE),
      'data_upd' => array('type' => self::TYPE_DATE)
      ),
      );


      Thanks for your support










      share|improve this question













      I've create a custom module for import n products
      (Prestashop 1.6.1.7)
      is all ok,
      but when I try to filter a search (there are 1882 records)
      the filter doesn't work.
      I've read other post about the problem but I don't understand if there is a problem into my controller or if I forget something.
      I have one table (cpld_articles) where are stored these data



      this is my controller



      require_once (_PS_MODULE_DIR_ . 'forniture/classes/cpld.core.php');

      class AdminFornitureController extends ModuleAdminController {

      protected $position_identifier = 'id';

      public function init() {



      // Set variables
      $this->context = Context::getContext();
      $this->table = 'cpld_subcategory';
      $this->article_table = 'cpld_articles';
      $this->className = 'cpld';
      $this->identifier = 'id';
      $this->_defaultOrderBy = 'id';
      $this->bootstrap = true;
      $this->lang = false;

      $this->addRowAction('edit');
      $this->addRowAction('view');
      $this->addRowAction('update');
      $this->addRowAction('import');

      $this->fields_list = array(
      'id' => array(
      'title' => $this->l('ID'),
      'align' => 'center',
      'width' => 50,
      'type' => 'int'
      ),

      'id_parent' => array(
      'title' => $this->l('ParentID'),
      'width' => 50,
      'class' => 'fixed-width-xs',
      'type' => 'int'
      ),
      'categoria_app' => array(
      'title' => $this->l('Categoria > Sottocategoria'),
      'width' => 200
      ),
      'titolo' => array(
      'title' => $this->l('Titolo'),
      'width' => 150,
      'type' => 'text',
      'filter_key' => $this->table.'!titolo',
      ),
      'n_articoli' => array(
      'title' => $this->l('N° Articoli'),
      'width' => 50,
      'type' => 'int',
      ),
      'abilitato' => array(
      'title' => $this->l('Abilitato'),
      'type' => 'bool',
      'active' => true,
      'filter_key' => $this->table.'!abilitato',
      'class' => 'fixed-width-sm'
      ),
      //'abilitato' => array('title' => $this->l('abilitato'), 'active' => '1', 'class' => 'fixed-width-sm'),
      'ricarico' => array(
      'title' => $this->l('Ricarico %'),
      //'type' => 'editable',
      'width' => 50,
      'type' => 'int',
      'filter_key' => 'ricarico',
      'search' => true
      ),
      'reg_iva' => array(
      'title' => $this->l('IVA'),
      'width' => 50,
      'type' => 'int',
      'filter_key' => 'reg_iva',
      'search' => true
      ),
      'data_ins' => array(
      'title' => $this->l('Date Add'),
      'type' => 'datetime'
      ),
      'data_upd' => array(
      'title' => $this->l('Date Upd'),
      'type' => 'datetime'
      ),
      );

      // Call of the parent constructor method
      parent::init();

      }


      This is cpld.core.php



      class cpld extends ObjectModel {

      /** @var string Name */
      public $id;
      public $cod_int;
      public $id_parent;
      public $categoria_app;
      public $titolo;
      public $n_articoli;
      public $abilitato;
      public $ricarico;
      public $reg_iva;
      public $cat_presta;
      public $data_ins;
      public $data_upd;
      public static $definition = array(
      'table' => 'cpld_subcategory',
      'primary' => 'id',
      'multilang' => FALSE,
      'fields' => array(
      'id' => array('type' => self::TYPE_INT),
      'cod_int' => array('type' => self::TYPE_INT),
      'id_parent' => array('type' => self::TYPE_INT),
      'categoria_app' => array('type' => self::TYPE_STRING),
      'titolo' => array('type' => self::TYPE_STRING),
      'n_articoli' => array('type' => self::TYPE_INT),
      'abilitato' => array('type' => self::TYPE_ENUM),
      'ricarico' => array('type' => self::TYPE_INT),
      'reg_iva' => array('type' => self::TYPE_INT),
      'cat_presta' => array('type' => self::TYPE_STRING),
      'data_ins' => array('type' => self::TYPE_DATE),
      'data_upd' => array('type' => self::TYPE_DATE)
      ),
      );


      Thanks for your support







      list filter view prestashop-1.6






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 at 16:18









      Mac

      11




      11





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53266156%2fprestashop-admin-sorting-and-filtering-in-list-view%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53266156%2fprestashop-admin-sorting-and-filtering-in-list-view%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Guess what letter conforming each word

          Port of Spain

          Run scheduled task as local user group (not BUILTIN)