I have a strange problem that is making me crazy, and I'm hoping that someone might be able to help, or at least give me some tips on how to trouble shoot this problem.
I followed tbirnseth's “PHP controllers” tutorial and created a very simple add-on that allows me to store a warehouse location code for each product. The addon uses a database table with two columns, a product id and a location string. It couldn't be simpler, and it seems to work fine. However, i have been observing that products where i know (for certain) there was a location saved, have no location set anymore. It seems like there are only a couple of things that could be happening, but i"m not sure how to troubleshoot them. here's what i'm thinking:
- the locations are linked by product id, so if the product id changed, the location would become unlinked. – Is there any reason that cscart would change the product id?
- when the product info is pulled to populate the manage product page, the location table my not be getting queried correctly, and then when the product is re-saved, it's getting “overwritten” with no info. --I don't see how this could be the case, because i have observed it working normally every time i edit a product.
I'm stumped. Any ideas?