Created
December 4, 2020 05:58
-
-
Save iamsathyaseelan/c1c73d699d07ec67ddd53cfb47e3d983 to your computer and use it in GitHub Desktop.
email customizer payment url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_email_customizer_plus_short_code_values', function ($short_codes, $order, $args, $sample) { | |
/** | |
* @var $order \WC_Order | |
*/ | |
$payment_url = ""; | |
if (method_exists($order, 'get_checkout_payment_url')) { | |
$payment_url = $order->get_checkout_payment_url(); | |
} | |
$short_codes['order']['payment_url'] = $payment_url; | |
return $short_codes; | |
}, 10, 4); | |
add_filter('woocommerce_email_customizer_plus_additional_short_codes_list', function ($additional_short_codes) { | |
$additional_short_codes['order.payment_url'] = "Order payment url"; | |
return $additional_short_codes; | |
}, 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment