-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Labels
BugThe issue is a confirmed bug.The issue is a confirmed bug.Product/Inventory ManagementIssues related to product or product page.Issues related to product or product page.
Description
Prerequisites (mark completed items with an [x]):
- I have have carried out troubleshooting steps and I believe I have found a bug.
- I have searched for similar bugs in both open and closed issues and cannot find a duplicate.
Describe the bug
When the low stock amount is pulled from the global settings via $low_stock_amount = get_option( 'woocommerce_notify_low_stock_amount', 2 );
the value returned is a string and not an integer like the doc-block suggests.
Expected behavior
Always return an integer.
Actual behavior
A clear and concise description of what actually happens. Please be as descriptive as possible;
Steps to reproduce the bug (We need to be able to reproduce the bug in order to fix it.)
Steps to reproduce the bug:
-
Go to product data metabox
-
select "manage stock" checkbox
-
Add snippet:
function kia_test_low_stock_amount() {
global $product;
var_dump( wc_get_low_stock_amount( $product ) );
}
add_action( 'woocommerce_before_add_to_cart', 'kia_test_low_stock_amount' );
Metadata
Metadata
Assignees
Labels
BugThe issue is a confirmed bug.The issue is a confirmed bug.Product/Inventory ManagementIssues related to product or product page.Issues related to product or product page.