woocommerce_hold_stock_for_checkout filter-hookWC 4.3.0

Filter: woocommerce_hold_stock_for_checkout Allows enable/disable hold stock functionality on checkout.

Usage

add_filter( 'woocommerce_hold_stock_for_checkout', 'wp_kama_woocommerce_hold_stock_for_checkout_filter' );

/**
 * Function for `woocommerce_hold_stock_for_checkout` filter-hook.
 * 
 * @param bool $enabled Default to true if managing stock globally.
 *
 * @return bool
 */
function wp_kama_woocommerce_hold_stock_for_checkout_filter( $enabled ){

	// filter...
	return $enabled;
}
$enabled(true|false)
Default to true if managing stock globally.

Changelog

Since 4.3.0 Introduced.

Where the hook is called

wc_get_held_stock_quantity()
woocommerce_hold_stock_for_checkout
WC_Coupon_Data_Store_CPT::check_and_hold_coupon()
woocommerce_hold_stock_for_checkout
WC_Coupon_Data_Store_CPT::check_and_hold_coupon_for_user()
woocommerce_hold_stock_for_checkout
wc_reserve_stock_for_order()
woocommerce_hold_stock_for_checkout
wc_release_stock_for_order()
woocommerce_hold_stock_for_checkout
woocommerce/includes/wc-stock-functions.php 335
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', wc_string_to_bool( get_option( 'woocommerce_manage_stock', 'yes' ) ) ) ) {
woocommerce/includes/data-stores/class-wc-coupon-data-store-cpt.php 517
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', true ) ) {
woocommerce/includes/data-stores/class-wc-coupon-data-store-cpt.php 616
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', true ) ) {
woocommerce/includes/wc-stock-functions.php 358
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', wc_string_to_bool( get_option( 'woocommerce_manage_stock', 'yes' ) ) ) ) {
woocommerce/includes/wc-stock-functions.php 384
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', wc_string_to_bool( get_option( 'woocommerce_manage_stock', 'yes' ) ) ) ) {

Where the hook is used in WooCommerce

Usage not found.