woocommerce_hold_stock_for_checkout хук-фильтрWC 4.3.0

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

Использование

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.

Список изменений

С версии 4.3.0 Введена.

Где вызывается хук

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 324
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 512
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', true ) ) {
woocommerce/includes/data-stores/class-wc-coupon-data-store-cpt.php 609
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', true ) ) {
woocommerce/includes/wc-stock-functions.php 347
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', wc_string_to_bool( get_option( 'woocommerce_manage_stock', 'yes' ) ) ) ) {
woocommerce/includes/wc-stock-functions.php 373
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', wc_string_to_bool( get_option( 'woocommerce_manage_stock', 'yes' ) ) ) ) {

Где используется хук в WooCommerce

Использование не найдено.