Created
June 13, 2022 07:18
-
-
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/)
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 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