Jump to content
ibrahimovich87

Add backoffice "Manufacturers" to columns products list

Recommended Posts

Hi,

i need help to add custom columns in product list in backoffice, what i'd like is get Manufacturer value 

PS. 1.7.2.5

Thanks to all


 

Share this post


Link to post
Share on other sites

Hello,

You can add new columns with this function in your module:

public function hookActionAdminProductsListingFieldsModifier($params)
  {
    if (isset($params['select'])) {
		//get data
      $params['select'] .= ', a.new_field as new_field';
		//add new column in list
      $params['fields']['new_field'] = array(
          'title' => $this->trans('Custom field', array(), 'Admin.Global'),
          'align' => 'text-center',
          'class' => 'fixed-width-xs',
          'search' => true,
          'havingFilter' => true,
          'filter_key' => 'a!new_field'
      );
    }


If you have more questions, ask me.

Regards

 

Share this post


Link to post
Share on other sites
1 hour ago, FuenRob said:

Hello,

You can add new columns with this function in your module:


public function hookActionAdminProductsListingFieldsModifier($params)
  {
    if (isset($params['select'])) {
		//get data
      $params['select'] .= ', a.new_field as new_field';
		//add new column in list
      $params['fields']['new_field'] = array(
          'title' => $this->trans('Custom field', array(), 'Admin.Global'),
          'align' => 'text-center',
          'class' => 'fixed-width-xs',
          'search' => true,
          'havingFilter' => true,
          'filter_key' => 'a!new_field'
      );
    }


If you have more questions, ask me.

Regards

 

Hi thanks for your answer,

but the problem it's that i'm really a newbye....wich file i have to modify?

Share this post


Link to post
Share on other sites

Hello,

So in your case the best solution is to search for a module, as unfortunately there is no easier way to do this.

Regards,

Share this post


Link to post
Share on other sites
On 24/4/2018 at 5:31 PM, ibrahimovich87 said:

Sorry but it's too difficult in this mode...we've sorry but i need this but i'm a completely newbie programmer..can you help me more?

 

I can make this module. Wait.

Share this post


Link to post
Share on other sites
4 hours ago, ibrahimovich87 said:

So thank you for you help ;-) i've installed it very thanks you ;-) 

So if i would add brand too?

 

 

It should not be a problem :)

Share this post


Link to post
Share on other sites
2 hours ago, ibrahimovich87 said:

It was a problem if you make this one for me? ...you are my only salvation

 

Do you want me to add the field? Sorry, but I can not help you until next week.

Share this post


Link to post
Share on other sites
1 minute ago, FuenRob said:

 

Do you want me to add the field? Sorry, but I can not help you until next week.

If you do it for me no problem if i have to wait next week, thank you

Share this post


Link to post
Share on other sites

Is this for adding manufacturer filter field on the catalog product list or I got it all wrong?

Share this post


Link to post
Share on other sites
59 minutes ago, rygar said:

Is this for adding manufacturer filter field on the catalog product list or I got it all wrong?

 

This is to add a new field to the product list. If you do not see that new field, can you tell me your version of prestashop?

Share this post


Link to post
Share on other sites

@FuenRob thanks it is working now :) but is it possible to make it a searchable field instead of select form?

 

Share this post


Link to post
Share on other sites
On 26/4/2018 at 4:57 PM, FuenRob said:

 

Do you want me to add the field? Sorry, but I can not help you until next week.

Not problem for me to wait, tell me when you are done, and really thank you 

Share this post


Link to post
Share on other sites

Hello @rygar, i'm happy that my module works well in your prestashop. 

Hello, @ibrahimovich87, you can download new version in my github. Remember that you have to replace the files located in src/PrestaShopBundle/Resources/views/Admin/Product/ by the modules, located in view/PrestaShop/Admin/Product/

view/PrestaShop/Admin/Product/ -> src/PrestaShopBundle/Resources/views/Admin/Product/

Please, you must make a backup of the originals.

Regards

Thanks

 

Edited by FuenRob (see edit history)

Share this post


Link to post
Share on other sites
On 30/4/2018 at 6:44 PM, FuenRob said:

Hello @rygar, i'm happy that my module works well in your prestashop. 

Hello, @ibrahimovich87, you can download new version in my github. Remember that you have to replace the files located in src/PrestaShopBundle/Resources/views/Admin/Product/ by the modules, located in view/PrestaShop/Admin/Product/

view/PrestaShop/Admin/Product/ -> src/PrestaShopBundle/Resources/views/Admin/Product/

Please, you must make a backup of the originals.

Regards

Thanks

 

I've replaced it but nothis appened,

so i have upgraded module and after this i 've re-replaced files, but no changes

Share this post


Link to post
Share on other sites
3 hours ago, ibrahimovich87 said:

I've replaced it but nothis appened,

so i have upgraded module and after this i 've re-replaced files, but no changes

 

Hello, i've uploaded a new realease. I've probed in 1.7.2 and 1.7.3

What files have you replaced?

Regards

Share this post


Link to post
Share on other sites
35 minutes ago, FuenRob said:

 

Hello, i've uploaded a new realease. I've probed in 1.7.2 and 1.7.3

What files have you replaced?

Regards

1.7.2.5 have replaced all file in your github-->addcolums list
so have replaced php in modules, all in hook

and > src/PrestaShopBundle/Resources/views/Admin/Product/

Share this post


Link to post
Share on other sites
29 minutes ago, ibrahimovich87 said:

1.7.2.5 have replaced all file in your github-->addcolums list
so have replaced php in modules, all in hook

and > src/PrestaShopBundle/Resources/views/Admin/Product/

 

You must replace the files:

-catalog.html.twig
-list.html.twig

From the folder: src /PrestaShopBundle/Resources/views/Admin/Product/ by those in /views/Prestashop/Admin/Product/

Regards

Share this post


Link to post
Share on other sites
15 hours ago, FuenRob said:

 

You must replace the files:

-catalog.html.twig
-list.html.twig

From the folder: src /PrestaShopBundle/Resources/views/Admin/Product/ by those in /views/Prestashop/Admin/Product/

Regards

Ok i've  replaced this file but only see categories not brand

2.png

Share this post


Link to post
Share on other sites
10 minutes ago, ibrahimovich87 said:

Ok i've  replaced this file but only see categories not brand

2.png

 

Can you clear you cache of the prestashop?

 

 

Share this post


Link to post
Share on other sites
4 hours ago, ibrahimovich87 said:

Yes...now it's function ;-) for me it's resolved.....so vert thank you Fuen

 

Yujuuuu!! it's perfect. Please, edit the title for add "Solved", and you can choose what was the answer for you that solved your problem. In this way, we help other users.

 

Thanks

Share this post


Link to post
Share on other sites
On 3/5/2018 at 1:58 PM, FuenRob said:

 

Yujuuuu!! it's perfect. Please, edit the title for add "Solved", and you can choose what was the answer for you that solved your problem. In this way, we help other users.

 

Thanks

Hi fuen...i've update to 1.7.3.o but i cannot see manufactrerr i've cleared cache...can you help me pleasE?

Share this post


Link to post
Share on other sites
On 2/5/2018 at 5:07 PM, ibrahimovich87 said:

1.7.2.5 have replaced all file in your github-->addcolums list
so have replaced php in modules, all in hook

and > src/PrestaShopBundle/Resources/views/Admin/Product/

 Hii,
Have you tried to restart the module?

Share this post


Link to post
Share on other sites

Hello!. I'm trying to do the same, followed the steps, Replaced the files in  src/PrestaShopBundle/Resources/views/Admin/Product/   but I have troubles intalling the Module. I've got an error message as I drag and drop the Module Folder onto the "upload module"box.

Where should I copy template folders files and addcolumlist.php?

Thanks

Share this post


Link to post
Share on other sites

Hello,

I'm trying the module in a PS 1.7.4.2, but nothing changes on catalog product list. I've already check cache and restart module. 

I'm wondering if this module works with 1.7.4 version. The file tree is a little bit different :

src/PrestaShopBundle/Resources/views/Admin/Product/

changes to:

/httpdocs/src/PrestaShopBundle/Resources/views/Admin/Product/CatalogPage/catalog.html.twig

and 

/httpdocs/src/PrestaShopBundle/Resources/views/Admin/Product/CatalogPage/Lists/list.html.twig

 

I've already try to replace the files on github on this path, but nothing changes.

Please, I need to add some extra columns but I can't find where to modify the files.

 

Thanks in advance!!

 

Share this post


Link to post
Share on other sites

Doesn't work in 1.7.5 because catalog.html.twig is way different.

  • Like 1

Share this post


Link to post
Share on other sites
On 6/18/2018 at 11:04 AM, FuenRob said:

 Hii,
Have you tried to restart the module?

Hi fuen have changed module to 1.7.5 can you  please update it? Very thank you

Share this post


Link to post
Share on other sites
On 2/15/2019 at 12:04 PM, ibrahimovich87 said:

Hi fuen thank's it's redy for 1.7.5? 

I cannot make it work in 1.7.5, throws error 500 (twig error loader): Template "PrestaShopBundle:Admin/Product/Include:catalog_order_carrets.html.twig" is not defined in PrestaShop/Admin/Product/CatalogPage/catalog.html.twig at line 255. 😥

Share this post


Link to post
Share on other sites
Posted (edited)
On 6/4/2019 at 6:20 PM, PrestaRob said:

Hello,

try attached module - it adds Manufacturers & Suppliers to product list in admin.

 

adminmodifications.zip

Hi

after uploading new code, Manufacturer and Supplier filters appeared, but they don't work and the old filter tabs does not work, they are inactive.

Capture.thumb.PNG.f15d709e291ef73bb6d7c9465e72acd5.PNG
 

Edited by hands0me (see edit history)

Share this post


Link to post
Share on other sites

Hi Everybody,

Anybody had found a solution on this ?

 

Thanks !

Ludovic

Share this post


Link to post
Share on other sites

Little update:

{% include 'PrestaShopBundle:Admin/Product/Include:catalog_order_carrets.html.twig' with {

I didn't find any catalog_order_carret.html.twig in my src folder, maybe the error comes from this.

But, I don't know by which file is replaced.

 

Thanks,

Ludo

Share this post


Link to post
Share on other sites

Is any way to save filter? When I reload page or make bulk actions new filters are empty, but core filters still working. Thank you!

Share this post


Link to post
Share on other sites

It's the same for me than for hands0me

New filters do appear but they are not envolved on the query when search button is clicked

Share this post


Link to post
Share on other sites
Posted (edited)

Hello excuse me. I am sorry if my english is bad

How to adding new field in customers backoffice

My version prestashop 1.7.6

please help me

Edited by yahyaefendy (see edit history)

Share this post


Link to post
Share on other sites
Posted (edited)

Edit: sorry for the up but it's the first result on google

prestashop 1.7.3+

I think it's a clean example (adapt to your need, here it' is for manufacturer in products admin list)

After install https://www.prestashop.com/forums/applications/core/interface/file/attachment.php?id=226225, modify AdminFilter.php in /admin/autoupgrade (make a search on this folder) and open AdminFilter.php

After the line

'filter_column_name_category' => '',

add the line

'filter_column_manufacturer' => '',

And after the line

'filter_column_name_category' => FILTER_SANITIZE_STRING,

Add the line

'filter_column_manufacturer' => FILTER_SANITIZE_STRING,

Clean your cache in /var/.../dev + prod (delete dev & prod folders)

Reload the page Catalog > products

Joyeux noël

overrideproductslistwithmanufacturer.zip

Edited by Stigz (see edit history)

Share this post


Link to post
Share on other sites
18 hours ago, Stigz said:

Edit: sorry for the up but it's the first result on google 

prestashop 1.7.3+

I think it's a clean example (adapt to your need, here it' is for manufacturer in products admin list)

After install https://www.prestashop.com/forums/applications/core/interface/file/attachment.php?id=226225, modify AdminFilter.php in /admin/autoupgrade (make a search on this folder) and open AdminFilter.php

After the line


'filter_column_name_category' => '',

add the line


'filter_column_manufacturer' => '',

And after the line


'filter_column_name_category' => FILTER_SANITIZE_STRING,

Add the line


'filter_column_manufacturer' => FILTER_SANITIZE_STRING,

Clean your cache in /var/.../dev + prod (delete dev & prod folders)

Reload the page Catalog > products

Joyeux noël

overrideproductslistwithmanufacturer.zip

try in 1.7.4 and work, but... i can't find anything, if I try, look for price, category, manufacturer, whatever ... it does not work and returns me to the administrator's main :(

and this step I have not done because I do not understand .. (modify AdminFilter.php in /admin/autoupgrade

can help me?

Share this post


Link to post
Share on other sites
Posted (edited)

AdminFilter.php is in \admin\autoupgrade\latest\src\PrestaShopBundle\Entity\

You can add the lines in this file as mentioned before

Clean your cache + delete /dev and /prod folder in /var/cache

reload your admin page at BO > Catalog > products

If it does not work already, now go to \src\PrestaShopBundle\Entity\ to find the other AdminFilter.php and add also the lines as mentioned before

Re-clean your cache.

If the module continue to not working correctly with prestashop 1.7.4, I make a try with prestashop 1.7.4...

1394198627_Screenshot_2019-08-30Produits.thumb.png.518c9b434f5efe19cd008487138e7442.png

 

Edited by Stigz
private values on screenshot (see edit history)

Share this post


Link to post
Share on other sites

touché in this line:🤗

\src\PrestaShopBundle\Entity\

now works in 1.7.4

REALLY THX! very nice work Stigz

 

 

Share this post


Link to post
Share on other sites

Hello I installed the module on Pres 1.7.5.1. Everything works ok. I only have problems remembering new filters. Editing the AdminFilter .php file throws out the

Quote

Warning: Invalid argument supplied for foreach () error in the /.../Admin / ProductController .php on line 307 file

 

Share this post


Link to post
Share on other sites

This si a free addon for 1.7.3+ https://www.prestashop.com/forums/applications/core/interface/file/attachment.php?id=226225

with some configuration needed

If you need only to go on the market place, it's here for module https://addons.prestashop.com/en/2-modules-prestashop

and here for theme https://addons.prestashop.com/en/3-templates-prestashop

Edited by Stigz (see edit history)

Share this post


Link to post
Share on other sites

hello, if I wanted to insert a different column that I have in a different table... how can I do?

ES.
I have an additional table with "id_product" and "date". I would like to insert the "date" column associated with the product, thanks

Share this post


Link to post
Share on other sites

Hello!

Is it possible to filter products with/without images in backoffice?

How can I do this?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More