Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created June 13, 2022 07:18
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/73afa1be318a4de1462c0c062dae411e to your computer and use it in GitHub Desktop.
Save webtoffee-git/73afa1be318a4de1462c0c062dae411e to your computer and use it in GitHub Desktop.
Unset country, city, postcode in the shipping label (https://wordpress.org/plugins/print-invoices-packing-slip-labels-for-woocommerce/)
<?php // do not copy this line of code
add_filter('wf_pklist_alter_shipping_address', 'wt_pklist_hide_shipping_details', 10, 3);
add_filter('wf_pklist_alter_billing_address', 'wt_pklist_hide_shipping_details', 10, 3);
function wt_pklist_hide_shipping_details($address, $template_type, $order)
{
if($template_type=='shippinglabel')
{
unset($address['country']);
unset($address['city']);
unset($address['postcode']);
}
return $address;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment