Milovan Posted June 25, 2019 Share Posted June 25, 2019 So, extending Product with custom field is easy. You override Product.php, extenidng ProductCore etc. But what bothers me is that, in order to add custom field on Product, I also have to modify MySQL table for Product. Is that the right procedure? If yes, then won't there be an Prestashop update issue, where for example, you update core, but it's own product table is changed? According to documentation, we should not alter PS tables: https://devdocs.prestashop.com/1.7/modules/creation/good-practices/ https://www.prestashop.com/forums/topic/902131-create-your-own-tables-or-using-existing-ones/?tab=comments#comment-2969838 Is there a way to extend Product but without modifying it's table? 1 Link to comment Share on other sites More sharing options...
NemoPS Posted June 29, 2019 Share Posted June 29, 2019 Yeah, there will be issues, and no, there is no other way. Unless you add a separate table, which you can also do, but you lose the benefits of a class property. Alternatively you can implement some code that loads and saves automatically from your extra tables, but it's a lot of work 2 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