Render oxxo voucher link into on-hold email notification

This commit is contained in:
dinamiko 2022-07-18 14:31:46 +02:00
parent e4b15c78d1
commit 2943c0d8aa
2 changed files with 18 additions and 1 deletions

View file

@ -93,6 +93,23 @@ class OXXO {
10,
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
);
}
/**

View file

@ -309,7 +309,7 @@ class PayUponInvoice {
}
},
10,
3
2
);
add_filter(