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 关注
- 122 浏览
添加回答
举报