irrelevant Posted January 17, 2013 Share Posted January 17, 2013 (edited) Hi. Quick question, I hope.. I'm currently writing a script that interfaces with my ps 1.5.3.1 shop and an api from my supplier's site to let me know when any products I sell drop off availability. I want to check, and eventually update, the "When out of stock" option on the individual product details page. Generally they will be set to "default", but when an item becomes unavailable, I want to change that to "deny orders" - initially I just want a list of items that I've not already set that on, so need to find the field to check ... What I need is where to find that field in the api... Ta for any help.. Edited January 20, 2013 by irrelevant (see edit history) Link to comment Share on other sites More sharing options...
irrelevant Posted January 20, 2013 Author Share Posted January 20, 2013 (edited) OK.. Looking at the source, I've identified where it's stored - e.g. product 183 is set to deny orders, the others are at default. mysql> select id_product,out_of_stock from ps_stock_available where id_product > 180 && id_product < 190 && id_product_attribute = 0; +------------+--------------+ | id_product | out_of_stock | +------------+--------------+ | 181 | 2 | | 182 | 2 | | 183 | 0 | | 184 | 2 | | 185 | 2 | | 186 | 2 | | 187 | 2 | | 188 | 2 | | 189 | 2 | +------------+--------------+ 9 rows in set (0.00 sec) (183 is set to Deny, the rest to default.) So this translates to: http://mystore.tld/api/stock_availables/?filter[id_product]=183&filter[id_product_attribute]=0&display=[out_of_stock] Thanks. Edited January 20, 2013 by irrelevant (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts