I have configurable_product
's id
and color
=red
and size
=x
How can I get that product current stock in programmatically.
Their inventory is:
------------------------------------------------------------
| Name | id | Stock |
-------------------------------------------------------
| configurable_product | 6 | 0(not visible) |
-------------------------------------------------------
| configurable_product_red_X | 7 | 1 |
-------------------------------------------------------
| configurable_product_red_l | 8 | 5 |
-------------------------------------------------------
| configurable_product_blue_s | 9 | 0 |
-------------------------------------------------------
| configurable_product_blue_x | 10 | 2 |
-------------------------------------------------------