Skip to content

Instantly share code, notes, and snippets.

@iamsathyaseelan
Created December 4, 2020 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamsathyaseelan/c1c73d699d07ec67ddd53cfb47e3d983 to your computer and use it in GitHub Desktop.
Save iamsathyaseelan/c1c73d699d07ec67ddd53cfb47e3d983 to your computer and use it in GitHub Desktop.
email customizer payment url
<?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