Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Last active November 17, 2021 04:27
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/f4b2db491c81fd8ae107c96d4cc0c486 to your computer and use it in GitHub Desktop.
Save webtoffee-git/f4b2db491c81fd8ae107c96d4cc0c486 to your computer and use it in GitHub Desktop.
Display only zip, city in address in shipments using 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']);
unset($address['state']);
unset($address['country']);
return $address;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment