woocommerce_paypal_line_item хук-фильтр . WC 1.0
Использование
add_filter( 'woocommerce_paypal_line_item', 'filter_function_name_9531', 10, 5 ); function filter_function_name_9531( $array, $item_name, $quantity, $amount, $item_number ){ // filter... return $array; }
- $array
- -
- $item_name
- -
- $quantity
- -
- $amount
- -
- $item_number
- -
Где вызывается хук
woocommerce_paypal_line_item
woocommerce/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php 492-504
$item = apply_filters( 'woocommerce_paypal_line_item', array( 'item_name' => html_entity_decode( wc_trim_string( $item_name ? wp_strip_all_tags( $item_name ) : __( 'Item', 'woocommerce' ), 127 ), ENT_NOQUOTES, 'UTF-8' ), 'quantity' => (int) $quantity, 'amount' => wc_float_to_string( (float) $amount ), 'item_number' => $item_number, ), $item_name, $quantity, $amount, $item_number );