Jump to content

Adding a field


Recommended Posts

Hello, have scoured the internet this but cannot find a solution.

I want t add a field to the products table. I can do the sql part of the process, but what else do I need to do

For example the products table has name, I want to use Books and Authors, so for example the product 'name' would be a book title but I would want an additional field to represent the author and ideally, the ISBN number as well, so that is 2 fields

Can I use attributes for this though attributes seems more inclined towards size of a product

Thanks.

PS - would it be a big job to allow 'custom' fields. I know Translation could be used to rename fields but additional fields would be really useful.

Link to comment
Share on other sites

Good question, I hope someone leaves an answer:) I needed to extend some tables too but I was too afraid of making a mess, so I created a few new tables and just "joined" them together using some queries. Not the most elegant solution but a safe solution...!

Link to comment
Share on other sites

Good question, I hope someone leaves an answer:) I needed to extend some tables too but I was too afraid of making a mess, so I created a few new tables and just "joined" them together using some queries. Not the most elegant solution but a safe solution...!


Yes thanks but how do you include the tables in the prestashop pages. Adding the tables deals with the data end but how do you get that data displayed in Prestashop?
Link to comment
Share on other sites

That's a good question, I only ever did it to produce external data feeds and other internal reports which didn't need a UI.


Thanks, all it needs is a good answer!

I would have thought book sales/music sales was such a fundamental sort of online shop that the structure would have been included, but seems not, and so a Products table is a bit restricted when it only includes product name.

I am looking at adding attributes from the backoffice admin pages
Link to comment
Share on other sites

  • 2 years later...

I realize that this is an old post, but it's unanswered and a problem that is very similar to my situation. Therefore, I felt it appropriate to share what I have learned on the subject. Also, this tutorial might apply to those out there who are still running PS 1.4. Here are the basic steps:

 

  1. Add database column
  2. Override Product.php to extend ProductCore to include the new field
  3. Override BO template to allow editing of the new field
  4. Add the product to the appropriate field in the FO

I have tried the solution from Nemo that I suggested above and it for the most part worked. I can view the new field from the FO but cannot view or edit it from the BO. I seem to be having trouble getting the BO to communicate with the database. I can view data from the database from fields that already exists (like "Reference") but I cannot get the BO to show or edit values from the new column. Any ideas?

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