Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better explanation for tables product/product_shop and product_attribute/product_attribute_shop #24

Open
mcdado opened this issue Sep 30, 2016 · 8 comments

Comments

@mcdado
Copy link

mcdado commented Sep 30, 2016

Initially posted to: http://forge.prestashop.com/browse/PSCSX-8318

In Gitter chat it was noted that it is an important feature for multi-store shops (sharing product with different features and price). Since this is the case, I guess it would be important to document for third-party module developers how to behave and how to deal with the tables. Also, the tables are present and written to even if multi-store was never enabled.

@kpodemski
Copy link
Contributor

kpodemski commented Sep 30, 2016

I agree that it should be documented but if you know how it works under the hood it's ok to see ObjectModel.php and all methods within Associate keyword

@mcdado
Copy link
Author

mcdado commented Sep 30, 2016

Well… the problem is that many third-party module developers don't know all the inner workings of the Core. For example, after years of looking at the Core code, I never noticed those methods or figured out what they do. That's why there is documentation. 😃

@kpodemski
Copy link
Contributor

Maybe. In my opinion ObjectModel, FrontController, Controller, ModuleFrontController, and AdminController are first classes which you should check and analyze. Everything is working on top of these.

@mcdado
Copy link
Author

mcdado commented Sep 30, 2016

Sure… but the point of technical documentation is to guide the user/developer in the right way. And when I'm facing an issue (for example: why when I update the product table, the change doesn't appear in the store?? oh, it's because there is a product_shop! I didn't know that, plus I'm not using multi-store!) I don't want to go read through 3 or 4 classes and spend a day because of that issue, maybe pulled into other things. It's a rabbit hole. Instead I'd like to have some explanation of non-obvious behaviour. Yes, you could argue that reading the Core is beneficial anyway, but then there is no point of having documentation, IMHO. 😉

And that's why I came here, to point out where I feel that documentation can improve.

@kpodemski
Copy link
Contributor

I suggest to look into 1.6 documentation, there are informations about db schema, how multi-store tables works etc.
http://doc.prestashop.com/display/PS16/Developer+Guide

As from now documentation would be hosted on GitHub it will be much better, that's for sure.

@mcdado
Copy link
Author

mcdado commented Sep 30, 2016

Yep. I opened this Issue to highlight an area that I find lacking. I was about to open another one about PrestaShopCollection but Safari TP totally collapsed on me, and I lost the unsaved draft… sometimes I forget what it is to run beta software! 😄

@mcdado
Copy link
Author

mcdado commented Sep 30, 2016

You meant this page?

There is a very brief mention of the issue:

A few details to note about tables:
 - Tables which contain translations must end with the _lang suffix. For instance, ps_product_lang contains all the translations for the ps_product table.
 - Tables which contain the records linking to a specific shop must end with the _shop suffix. For instance, ps_category_shop contains the position of each category depending on the store.

I can assure you that I searched the documentation when I had issues with this particular case (product, product_attribute) but I didn't find this page, I guess because it only lists category_shop. I guess it was bad luck!

@lanokims
Copy link

lanokims commented Apr 7, 2018

Hello,
Maybe I'm late here.
I am a prestashop developer and I need an indication please.

I develop a module to synchronize part of the products (selected products) from one shop to another. I would like some indication on the concerned tables.

it would be nice if I could find help here.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants