Jump to content

Add new custom field in customers list - backend - PrestaShop 1.7.


Recommended Posts

Hi all, 

I need to add two new fields in customers listing, in backend, in PrestaShop 1.7.

These two new fields are two new fields created in the table named ps_customer, in particular, optin1 and optin2.

I read official doc, like this: https://devdocs.prestashop.com/1.7/modules/concepts/templating/admin-views/

But I have not it clear at all, for customers listings...

Could you help me?

Thanks in advance.

Share this post


Link to post
Share on other sites

I solved it, thanks to these two posts:

1. https://devdocs.prestashop.com/1.7/development/components/grid/tutorials/modify-grid-in-module/

2. https://webkul.com/blog/adding-a-new-column-in-prestashop-new-symfony-admin-controller-grid-page-with-module/

Summary, thanks to hooks actionCustomerGridDefinitionModifier and actionCustomerGridQueryBuilderModifier

Best regards.

  • Like 2

Share this post


Link to post
Share on other sites

  • 4 months later...
On 12/3/2019 at 9:30 AM, garciasanchezdani said:

I solved it, thanks to these two posts:

1. https://devdocs.prestashop.com/1.7/development/components/grid/tutorials/modify-grid-in-module/

2. https://webkul.com/blog/adding-a-new-column-in-prestashop-new-symfony-admin-controller-grid-page-with-module/

Summary, thanks to hooks actionCustomerGridDefinitionModifier and actionCustomerGridQueryBuilderModifier

Best regards.

Hello,

yeah it looks like easy one, but I have one question - where exactly I should put code from Webkuls tutorial? It should be new module? Or put it in some controller?

 

Best regards

Share this post


Link to post
Share on other sites

  • 1 month later...
  • 4 months later...
4 hours ago, garciasanchezdani said:

Yes, always try to use overrides or hooks.

thank  you for your response @garciasanchezdani.

but other questions is .. ..

 

we can override this files ?

 

Quote

use PrestaShop\PrestaShop\Core\Grid\Column\Type\DataColumn;
use PrestaShop\PrestaShop\Core\Grid\Filter\Filter;
use Symfony\Component\Form\Extension\Core\Type\TextType;

https://webkul.com/blog/adding-a-new-column-in-prestashop-new-symfony-admin-controller-grid-page-with-module/

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

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