woocommerce_update_order_review_fragments
Filter the HTML fragments returned with a checkout update, keyed by the selector each one replaces.
Использование
add_filter( 'woocommerce_update_order_review_fragments', 'wp_kama_woocommerce_update_order_review_fragments_filter' );
/**
* Function for `woocommerce_update_order_review_fragments` filter-hook.
*
* @param array $fragments Checkout fragments keyed by selector.
*
* @return array
*/
function wp_kama_woocommerce_update_order_review_fragments_filter( $fragments ){
// filter...
return $fragments;
}
- $fragments(массив)
- Checkout fragments keyed by selector.
Список изменений
| С версии 2.3.0 | Введена. |
Где вызывается хук
woocommerce_update_order_review_fragments
woocommerce_update_order_review_fragments
woocommerce/includes/class-wc-ajax.php 514-520
$fragments = apply_filters( 'woocommerce_update_order_review_fragments', array( '.woocommerce-checkout-review-order-table' => $woocommerce_order_review, '.woocommerce-checkout-payment' => $woocommerce_checkout_payment, ) );
woocommerce/includes/class-wc-ajax.php 380-390
'fragments' => apply_filters( 'woocommerce_update_order_review_fragments', array( 'form.woocommerce-checkout' => wc_print_notice( esc_html__( 'Sorry, your session has expired.', 'woocommerce' ) . ' <a href="' . esc_url( wc_get_page_permalink( 'shop' ) ) . '" class="wc-backward">' . esc_html__( 'Return to shop', 'woocommerce' ) . '</a>', 'error', array(), true ), ) ),