New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add filter hook to allow currently hardcoded 10 minute checkout draft stock reservation to be filtered #45246
Merged
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7cb521e
Update Checkout.php
ninetyninew 3757991
Add changefile(s) from automation for the following project(s): wooco…
invalid-email-address f58704c
Add filter hook for draft order stock hold (#45245)
ninetyninew 950f8c9
Merge branch 'trunk' of https://github.com/ninetyninew/woocommerce in…
ninetyninew 3a62305
Amending filter hook in changelog for draft order stock hold changes …
ninetyninew 96e4fe8
Add changefile(s) from automation for the following project(s): wooco…
invalid-email-address a219a59
Add changefile(s) from automation for the following project(s): wooco…
invalid-email-address a4eab12
Add (int) to hook for draft order stock hold (#45245)
ninetyninew 10c87ba
Fixing codesniff lint issues found on previous commits (#45245)
ninetyninew c361bfa
Adding negative check to draft order hold stock minutes (#45245)
ninetyninew 9291ff0
Discarding older changes in favour of PR recommendations (#45245)
ninetyninew c131ab9
Add changefile(s) from automation for the following project(s): wooco…
invalid-email-address 8df29af
Amends of woocommerce_order_hold_stock_minutes in favour of PR recomm…
ninetyninew 35ba0bf
Add changefile(s) from automation for the following project(s): wooco…
invalid-email-address 204180b
Amending woocommerce_order_hold_stock_minutes filter hook doc block c…
ninetyninew ed6c285
Merge branch 'trunk' of https://github.com/ninetyninew/woocommerce in…
ninetyninew File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Add `woocommerce_draft_order_hold_stock_minutes` filter hook to allow duration of stock reservation to hold stock for draft orders on checkout entry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should check that the result is: not empty, is an integer (or can be cast to one) and is not negative, if any of these are true it should default back to 10. Do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@opr I think casting to a integer and a check for negative is fine, however the !empty would stop being able to filter to 0, which for our particular scenario (to stop stock reservation) is why we need this filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, you're right 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@opr The int casting is already there, i've just amended to include the negative check in the latest commit if you'd like to check over it.