Jump to content

[solved] webservice api - product "when out of stock"


Recommended Posts

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 by irrelevant (see edit history)
Link to comment
Share on other sites

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 by irrelevant (see edit history)
  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...