1 回答

TA貢獻1794條經驗 獲得超8個贊
使用以下代碼更改您的上述代碼 -
add_action('woocommerce_order_details_after_order_table', 'action_order_details_after_order_table', 10, 4 );
function action_order_details_after_order_table( $order, $sent_to_admin = '', $plain_text = '', $email = '' ) {
// Only on "My Account" > "Order View"
if ( is_wc_endpoint_url( 'view-order' ) ) {
if( $order->get_status() == 'completed' ){ // for completed status
printf( '<p class="custom-text">' .
__("Your order completed message goes here %s" ,"woocommerce"),
'<strong>"' .__("Refund my entire order", "woocommerce") . '"</strong>.</p>' );
}elseif($order->get_status() == 'cancelled'){ // for cancelled status
printf( '<p class="custom-text">' .
__("Your order cancelled message goes here %s" ,"woocommerce"),
'<strong>"' .__("Refund my entire order", "woocommerce") . '"</strong>.</p>' );
}else{ // for rest statuses
printf( '<p class="custom-text">' .
__("To cancel your license within the 30 day trial period click on %s" ,"woocommerce"),
'<strong>"' .__("Refund my entire order", "woocommerce") . '"</strong>.</p>' );
}
}
}
- 1 回答
- 0 關注
- 139 瀏覽
添加回答
舉報