Commit 320c1e5
committed
Implement
WooCommerce Core implemented a method to get the current stock quantity
for a product. This patch brings that functionality into the feature plugin as well.
Without this patch, customers are unable to checkout with any product
that is managing inventory levels.
See core method https://github.com/woocommerce/woocommerce/blob/09d98a6fe059c4a0c5e88a549213a08b56314e85/includes/data-stores/class-wc-product-data-store-cpt.php#L2112
Testing:
*Before applying this patch*
- Create a product that has an inventory stock level
- Add items to the cart
- Proceed through checkout
- Verify checkout fails with a not enough stock notice
*After applying this patch*
- Add the product with an inventory stock level to cart
- Proceed through checkout
- Verify checkout is successful
- Verify stock count was decremented appropriatelyget_query_for_stock from WC core1 parent bcb6b90 commit 320c1e5
File tree
1 file changed
+19
-0
lines changed- includes/data-stores
1 file changed
+19
-0
lines changedLines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2273 | 2273 | | |
2274 | 2274 | | |
2275 | 2275 | | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
2276 | 2295 | | |
0 commit comments