shekhar.patil Posted December 21, 2017 Share Posted December 21, 2017 Having some issue while saving the value of the custom field added in products edit page (Backoffice). I have done things in following order: 1. Added the custom field (Boolean) in Products table (database). 2. Override the product class and added the definition for the custom field. 3. Added the custom field in the ProductInformation.tpl 4. Added the field in the form.html.twig. Problem: I'm able to see the checkbox on the products edit page from Backoffice. Also, it is not checked as the default value for the field is FALSE. But unable to update the value of the field on Save button. Other things like product name or price are updating properly but the custom field value remains the same. Please help!!! Link to comment Share on other sites More sharing options...
Knowband Plugins Posted December 22, 2017 Share Posted December 22, 2017 @shekhar.patil As per the points that you have mentioned, it seems that you have missed the logic to save the value of the custom field in the DB, you are supposed to add the logic to Admin Product controller (/controllers/admin/AdminProductsController.php) for the same. P. S. Just an advice, you should not be editing the table structure of the core Product table to add a custom field to the product form, you can simply create another custom table to save the data and then use hooks to add the field and save its values. Link to comment Share on other sites More sharing options...
shekhar.patil Posted December 24, 2017 Share Posted December 24, 2017 Thanks for the reply. I have no idea how to do that. Can you plz explain in more detail. Link to comment Share on other sites More sharing options...
shekhar.patil Posted December 26, 2017 Author Share Posted December 26, 2017 On 22/12/2017 at 1:36 PM, Knowband Plugins said: @shekhar.patil As per the points that you have mentioned, it seems that you have missed the logic to save the value of the custom field in the DB, you are supposed to add the logic to Admin Product controller (/controllers/admin/AdminProductsController.php) for the same. P. S. Just an advice, you should not be editing the table structure of the core Product table to add a custom field to the product form, you can simply create another custom table to save the data and then use hooks to add the field and save its values. Hi, Thanks for the reply. I have no idea how to do that. Can you plz explain in more detail. Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted December 29, 2017 Share Posted December 29, 2017 Hi....https://www.prestashop.com/forums/topic/636339-modules-tab-not-showing-in-prestashop-v1724/?tab=comments#comment-2637031 now see here is one module "belvg_samplemodule.zip" download and try your thing with custom module Thanks Link to comment Share on other sites More sharing options...
amerigeau Posted January 29, 2018 Share Posted January 29, 2018 Hello guys, I have posted a tuto to add product fields with PrestaShop 1.7 ! Just click on the image or the link under. You can like and comment the post if it helps you https://www.arnaud-merigeau.fr/prestashop-1-7-ajouter-des-champs-texte-aux-produits/ Bye ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now