Last active
November 17, 2021 04:27
-
-
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
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 //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