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

Allow plugins to filter this price like in the legacy cart class.

This is legacy and should probably be deprecated in the future. $item->object is the cart item object. $this->cart is the cart object.

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

add_filter( 'woocommerce_get_discounted_price', 'wp_kama_woocommerce_get_discounted_price_filter', 10, 3 );

/**
 * Function for `woocommerce_get_discounted_price` filter-hook.
 * 
 * @param  $wc_remove_number_precision 
 * @param  $object                     
 * @param  $cart                       
 *
 * @return 
 */
function wp_kama_woocommerce_get_discounted_price_filter( $wc_remove_number_precision, $object, $cart ){

	// filter...
	return $wc_remove_number_precision;
}
$wc_remove_number_precision
-
$object
-
$cart
-

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

WC_Cart_Totals::calculate_item_totals()
woocommerce_get_discounted_price
woocommerce/includes/class-wc-cart-totals.php 675
apply_filters( 'woocommerce_get_discounted_price', wc_remove_number_precision( $item->total ), $item->object, $this->cart )

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

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