Jump to content

Why don't products show when directly entering them in database?


Recommended Posts

Hi. I want to import products directly in the database so that I don't have to go through the PrestaShop interface, it is very tedious. When I insert them and the combinations using phpadmin in the database, they don't show up in the PrestaShop back office at all. I entered data in the pr_product and the pr_product_attribute tables. I made sure the ID number was correct. Is there another table I need to update?

 

I tried importing a csv file but found this also tedious, as the order of the fields seemed to be very different in the importer and it was also missing some fields that I need. 

 

Can anyone help? Thanks.

Link to comment
Share on other sites

Hi bellini13,

 

Thanks for answering. I tried adding product_lang, product_shop, and it still didn't work. I haven't tried all of the "product" tables yet. However, I tested by first adding a product in the back office, then going into phpadmin to edit the price increase value and even that didn't work--the back office doesn't seem to recognize my edits at all. I don't understand why it doesn't.

 

Have you tried editing directly in the database successfully? Or has anyone? Is there something else I need to do, like clear the smarty cache or something?

Link to comment
Share on other sites

No, I'm not using multistore. This is my 1st cart with PrestaShop. Yes, I have combinations as stated in the first post. Every product has combinations. I updated product, product_lang, product_shop, and product_attribute. I'm sorry I didn't go through and update every table with the word "product" yet because I thought it might be futile. That's why I was trying to find out first if anyone has been successful editing the db directly, to know if it is possible before I spend more time on it.

 

In the meantime I e-mailed PrestaShop support and they said they don't recommend updating with phpadmin, they said to use the back office or buy an add-on. 

Link to comment
Share on other sites

editing the database directly is possible, so long as you do it correctly.  everything about products are stored in the database (minus images), so it does not matter how you update the database (module, import, back office, phpmyadmin), the end result is getting the database updated "properly". 

 

this is a bit of trial and error, and since no one has stepped forward with the exact answer, it is up to you to decide how you want to proceed.  you can keep exploring until you find the correct table to update, you can wait until someone gives you the answer, or you can try to locate a module that will do what you want.

 

personally, i would keep going until I found the correct table to update.  I would start simple, with a product with no combinations/attributes and get that to work.  once that works, then i would take the next step.

 

note: even if you are not using multi-store, you still have to update product, product_shop and product_attribute_shop

Link to comment
Share on other sites

That is a good idea, to start with a product with no combinations. Actually, I didn't say that when I added the product_lang & product_shop, it got messed up and put some of the combinations values for the specific product in the main attributes list, so I was scared to proceed further. It must be very tricky to get this right. Each item for this shop has several sizes and usually comes in 2 colors, so it is very tedious to enter them in the back office. 

 

Thank you for pointing me in the right direction. I will work on it when I have more time for troubleshooting and maybe revisit importing with a csv, that could be easier. 

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