mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Render oxxo voucher link into on-hold email notification
This commit is contained in:
parent
e4b15c78d1
commit
2943c0d8aa
2 changed files with 18 additions and 1 deletions
|
@ -93,6 +93,23 @@ class OXXO {
|
||||||
10,
|
10,
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
|
|
||||||
|
add_action('woocommerce_email_before_order_table',
|
||||||
|
function (WC_Order $order, bool $sent_to_admin) {
|
||||||
|
if(
|
||||||
|
! $sent_to_admin
|
||||||
|
&& $order->get_payment_method() === OXXOGateway::ID
|
||||||
|
&& $order->has_status( 'on-hold' )
|
||||||
|
) {
|
||||||
|
$payer_action = $order->get_meta( 'ppcp_oxxo_payer_action' ) ?? '';
|
||||||
|
if($payer_action) {
|
||||||
|
echo '<p><a class="button" href="'. esc_url($payer_action) .'">OXXO voucher</a></p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
10,
|
||||||
|
2
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -309,7 +309,7 @@ class PayUponInvoice {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
10,
|
10,
|
||||||
3
|
2
|
||||||
);
|
);
|
||||||
|
|
||||||
add_filter(
|
add_filter(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue