Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created January 14, 2022 13:48
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 webtoffee-git/d45f635894d34191e04f58209cc15f64 to your computer and use it in GitHub Desktop.
Save webtoffee-git/d45f635894d34191e04f58209cc15f64 to your computer and use it in GitHub Desktop.
<?php// do not copy this line
add_filter('wf_pklist_alter_find_replace', 'wt_pklist_add_payment_method', 10, 6);
function wt_pklist_add_payment_method($find_replace, $template_type, $order, $box_packing, $order_package, $html)
{
if($template_type=='invoice')
{
$paymethod_title=(WC()->version < '2.7.0') ? $order->payment_method_title : $order->get_payment_method_title();
if(!empty($paymethod_title))
{
$find_replace['[wfte_product_table_payment_method]']=__($paymethod_title);
}
else
{
$find_replace['[wfte_product_table_payment_method]']='';
}
}
return $find_replace;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment