Jump to content

1.7 Adding EAN to product list and Overriding PrestaShop/Admin/Product/CatalogPage/Lists/list.html.twig


abdullacm

Recommended Posts

I have created a module and registered hook hookActionAdminProductsListingFieldsModifier, i could add the ean13 column to the list, but the filter is not working. Can anyone help me or guide me to make the filter working.

public function hookActionAdminProductsListingFieldsModifier($params)
{
    $params['sql_select']['ean13'] = array(
        'table' => 'p',
        'field' => 'ean13',
        'filtering' => 'LIKE \'%%%s%%\''
    );
}

 

override the twig files and working

modules/mymodule/views/PrestaShop/Admin/Product/CatalogPage/Lists

list.html.twig

products_table.html.twig

 

Thanks,

Edited by Abdulla CM
updated tags (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
  • 7 months later...

I added to hookActionAdminProductsListingFieldsModifier custom fielt like @Abdulla CM. I have data on product list tabele in admin but filter input not working. If i write names and submit filter in custom column, nothing happen. Please anyone can help?

public function hookActionAdminProductsListingFieldsModifier($params) {
        if (isset($params['sql_select'])) {
            $params['sql_select']['pxl_supplier'] = array(
                "table"=>"p",
                "field"=>"pxl_supplier",
                "filtering"=>"LIKE '%%%s%%'"
            );
    }

 

Edited by zolwix (see edit history)
Link to comment
Share on other sites

I found a solution - need to add a new column filter variable in the file

/src/PrestaShopBundle/Entity/AdminFilter.php

to 2 function: getProductCatalogEmptyFilter () and sanitizeFilterParameters ()

Now searching, paging and sorting with the new field search results works fine. Here you will find additional information with fles to download https://github.com/FuenRob/Modules-Prestashop-1.7/issues/1

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...