Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Inventory not returned to original state with an unpaid order #71

Open
braydonf opened this issue Jan 8, 2022 · 2 comments
Open

Inventory not returned to original state with an unpaid order #71

braydonf opened this issue Jan 8, 2022 · 2 comments

Comments

@braydonf
Copy link
Contributor

braydonf commented Jan 8, 2022

Describe the bug

During checking out of an order the stock levels were reduced however never increased when the order was left unpaid.

The order notes lists:

  • Stock levels reduced [redacted] 9→8

And about 45 minutes later:

  • Unpaid order cancelled – time limit reached. Order status changed from Pending payment to Cancelled.

And the inventory was never increased again.

Woocommerce System Status

Wordpress: 5.8.3
WC Version: 6.0.0
BTCPay for WooCommerce by BTCPay: 3.0.15

Your BTCPay Environment

BTCPay Server Version: BTCPayServer v1.3.7.0
Deployment Method: Docker swarm

@WillBrubaker
Copy link

Heya @braydonf I don't think this has anything to do with the BTCPay Server plugin. If the order transitioned from pending to canceled the expectation is that the items would be returned to stock. That is independent of the payment gateway.

WooCommerce hooks into the action here: https://github.com/woocommerce/woocommerce/blob/6.1.0/plugins/woocommerce/includes/wc-stock-functions.php#L143

It seems to me that something is causing the wc_maybe_increase_stock_levels function to return early here: https://github.com/woocommerce/woocommerce/blob/6.1.0/plugins/woocommerce/includes/wc-stock-functions.php#L123-L135

Error logs may give you clues.

@braydonf
Copy link
Contributor Author

I've disable inventory tracking for the time being and will need to debug locally before re-enabling. Then I could get some log messages. Unless I can retroactively get them, however I don't think I enabled debug logging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants