Jump to content

Add custom fields in admin category page Presta 1.7.6


Recommended Posts

Hi everyone !

As you can see , I've difficulties to add a custom field into category admin page.

More precisely, i found this hook : hookActionCategoryFormBuilderModifier 

but i can't register it , like it doesn't exist in prestashop.

However i find it on presta documentation.

 

image.thumb.png.22322e770e93b6c2f1e498e49078ff06.png

on the other hand actionCustomerFormBuilderModifer works correctly

Does anybody have already make this ? could you please help me ...

Thanks for your help

Link to comment
Share on other sites

Hi,

It's because this hook is used for symfony forms. Customer form is already migrated to symfony but category form is not yet.

You want to use hookActionCategoryFormModifier hook as for now...

Here is the link which explains how to identify is it simfony or not. https://www.h-hennes.fr/blog/2019/07/25/prestashop-1-7-identifier-si-un-controller-admin-a-ete-migre-vers-symfony/

Thanks

Edited by Verlonimo (see edit history)
  • Like 1
Link to comment
Share on other sites

Hi , and thx for your answer.

Category Form was migrated.

I found a part of the problem.

This presta was a 1.7.3 upgrade to 1.7.6 and hookActionCategoryFormModifier was not in Db.

It was upgraded by Oneclick Module .

I had it and i can fix to the hook. But it doesn't work. I think another think is missing but what ...

Does anybody have an idea ?

Thx a lot.

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

Hi,

My bad. It looks like admin category page is also using symfony. Sorry for misleading...

Have you tried to print_r something with that hook?

Have you registered that hook in a module?

Where i exactly u want to add your custom field?

 

I think this is what you looking for? https://www.h-hennes.fr/blog/2019/08/05/prestashop-1-7-ajouter-des-champs-dans-un-formulaire-dadministration/

It's in french but you can use google translate as i do :)

Hope that helps.

 

Thanks

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Merci pour ton aide Verlonimo,

Le français ne va pas poser problème 😉.

Oui print_r() die() rien.

J'ai ajouté le hook en bdd et me suis gréffé dessus. 

Je souhaiterais ajouté des champs sur la page admin des catégories.

J'ai testé sur une install propre de presta en 1.7.6 ça fonctionne niquel.

Là c'est un presta qui a été migré via le module natif de presta , et à mon avis il doit manquer des choses. Pas facile de trouver.

En tout cas merci pour ton aide.

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

Ah Sorry i thought you were french 😃

Yes i see your link , thx for your help. I finally found where was my problem.

 

while i was trying to use the hook i modified my module and it was disabled.

Stupid error

To sum up:

The only problem was that the hookActionFormBuilderModifer was missing in Db.

Besides the hookActionAfterUpdateCategoryFormHandler too.

probably due to an error during migration.

 

 

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...