woocommerce_cart_contents_changed хук-фильтрWC 1.0

If it's not empty, it's been already populated by the loop above.

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

add_filter( 'woocommerce_cart_contents_changed', 'wp_kama_woocommerce_cart_contents_changed_filter' );

/**
 * Function for `woocommerce_cart_contents_changed` filter-hook.
 * 
 * @param  $cart_contents 
 *
 * @return 
 */
function wp_kama_woocommerce_cart_contents_changed_filter( $cart_contents ){

	// filter...
	return $cart_contents;
}
$cart_contents
-

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

WC_Cart_Session::get_cart_from_session()
woocommerce_cart_contents_changed
CartController::add_to_cart()
woocommerce_cart_contents_changed
WC_Cart::add_to_cart()
woocommerce_cart_contents_changed
woocommerce/includes/class-wc-cart-session.php 205
$this->cart->set_cart_contents( apply_filters( 'woocommerce_cart_contents_changed', $cart_contents ) );
woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php 131
$cart->cart_contents = apply_filters( 'woocommerce_cart_contents_changed', $cart->cart_contents );
woocommerce/includes/class-wc-cart.php 1277
$this->cart_contents = apply_filters( 'woocommerce_cart_contents_changed', $this->cart_contents );

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

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