woocommerce_cart_item_set_quantity хук-событие . WC 3.6.0
Fired after qty has been changed.
Использование
add_action( 'woocommerce_cart_item_set_quantity', 'action_function_name_3916', 10, 3 ); function action_function_name_3916( $cart_item_key, $quantity, $this ){ // action... }
- $cart_item_key(строка)
- contains the id of the cart item. This may be empty if the cart item does not exist any more.
- $quantity(число)
- contains the quantity of the item.
- $this(WC_Cart)
- Cart class.
Список изменений
С версии 3.6.0 | Введена. |
Где вызывается хук
woocommerce_cart_item_set_quantity
woocommerce/includes/class-wc-cart.php 1339
do_action( 'woocommerce_cart_item_set_quantity', $cart_item_key, $quantity, $this );
Где используется хук в ядре WooCommerce
woocommerce/includes/class-wc-cart.php 58
add_action( 'woocommerce_cart_item_set_quantity', array( $this, 'persistent_cart_update' ) );