Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Last active November 17, 2021 04:23
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/a56f1fdc40795ebe37d320bd1720c849 to your computer and use it in GitHub Desktop.
Save webtoffee-git/a56f1fdc40795ebe37d320bd1720c849 to your computer and use it in GitHub Desktop.
Alter address format to suit European standards in WooCommerce PDF Invoice,Packing Slip,Delivery Note plugin
<?php //do not copy this line
add_filter('wf_pklist_alter_shipping_address','wf_pklist_alter_address_fn',10,3);
add_filter('wf_pklist_alter_billing_address','wf_pklist_alter_address_fn',10,3);
add_filter('wf_pklist_alter_shipping_from_address','wf_pklist_alter_address_fn',10,3);
function wf_pklist_alter_address_fn($address, $template_type, $order)
{
$arr=array($address['postcode'], $address['city']);
$address['city']=implode( ", ",$arr);
unset($address['postcode']);
return $address;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment