Roshan Bhavsar Posted August 14, 2023 Share Posted August 14, 2023 (edited) Hello, I want to add the checkbox and a text field into the options tab of the product. Prestashop version is 8.0.4. I have added a piece of code, to show the checkbox and the input field. When checkbox is checked then text box will be shown else hidden. But now I'm struggling for the saving of that checkbox and textbox values into the database. (I already created a fields into the database "is_special_product" and "special_description"). So which are the steps that are to be followed for the data is being saved into the database (for both create and edit). I did the changes in classes/product.php , AdminProductDataProvider.php, ProductOptions.php etc. So, please help mw with the same. please list out the files which are needed to be changed to do the same with changes required. Thanks in advance. Edited August 14, 2023 by Roshan Bhavsar (see edit history) Link to comment Share on other sites More sharing options...
JBW Posted August 14, 2023 Share Posted August 14, 2023 Don't change any core files directly. Please follow the docs, they explain how to handle the data too. https://devdocs.prestashop-project.org/8/modules/sample-modules/extend-product-page/ Link to comment Share on other sites More sharing options...
Roshan Bhavsar Posted August 16, 2023 Author Share Posted August 16, 2023 Thanks @JBW I'll follows the given steps. Link to comment Share on other sites More sharing options...
gusman126 Posted August 16, 2023 Share Posted August 16, 2023 Demos for prestashop 8.xhttps://github.com/PrestaShop/example-modules Link to comment Share on other sites More sharing options...
Roshan Bhavsar Posted August 21, 2023 Author Share Posted August 21, 2023 Hello guys, I'm still struggling with this. can anybody share the list of files those needs to be changed. It will be better if anybody Thanks in advance. Link to comment Share on other sites More sharing options...
gusman126 Posted August 22, 2023 Share Posted August 22, 2023 En 21/8/2023 a las 7:30 AM, Roshan Bhavsar dijo: Hello guys, I'm still struggling with this. can anybody share the list of files those needs to be changed. It will be better if anybody Thanks in advance. You must not modify files, you must make a module, above you have examples Prestashop is not an html system, you must use modules, override or another system, but never modify files or you will lose the changes when updating or you will never be able to update. learn by examples 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