Deactivate invoices for purchases in a given country
-
A couple of years ago you gave me a solution to deactivate invoices for purchases from a certain country, but recently it has stopped working.
Have there been any changes due to any updates to both WordPress and WooCommerce?
Your solution was the following, but now it doesn’t work.
// exclude certain countries from automatic pdf creation
add_filter( ‘wpo_wcpdf_custom_attachment_condition’, ‘wpo_wcpdf_exclude_country’, 100, 4 );
function wpo_wcpdf_exclude_country( $condition, $order, $status, $document ) {
$country = $order->get_billing_country();
if ( $document == ‘invoice’ && $country == ‘NL’ ) {
return false;
} else {
return $condition;
}
}The page I need help with: [log in to see the link]
- The topic ‘Deactivate invoices for purchases in a given country’ is closed to new replies.