woocommerce_thankyou_(orderpayment_method)
Использование
add_action( 'woocommerce_thankyou_(orderpayment_method)', 'wp_kama_woocommerce_thankyou_orderpayment_method_action' );
/**
* Function for `woocommerce_thankyou_(orderpayment_method)` action-hook.
*
* @param $order_id
*
* @return void
*/
function wp_kama_woocommerce_thankyou_orderpayment_method_action( $order_id ){
// action...
}
- $order_id
- -
Где вызывается хук
В файле: /templates/checkout/thankyou.php
woocommerce/templates/checkout/thankyou.php 81
<?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
Где используется хук в WooCommerce
woocommerce/includes/gateways/bacs/class-wc-gateway-bacs.php 93
add_action( 'woocommerce_thankyou_bacs', array( $this, 'thankyou_page' ) );
woocommerce/includes/gateways/cheque/class-wc-gateway-cheque.php 62
add_action( 'woocommerce_thankyou_cheque', array( $this, 'thankyou_page' ) );
woocommerce/includes/gateways/paypal/class-wc-gateway-paypal.php 201
add_filter( 'woocommerce_thankyou_order_received_text', array( $this, 'order_received_text' ), 10, 2 );
woocommerce/includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php 43
add_action( 'woocommerce_thankyou_paypal', array( $this, 'check_response_for_order' ) );