Skip to content

Instantly share code, notes, and snippets.

@dennisnissle
Created June 26, 2024 07:02
Show Gist options
  • Save dennisnissle/b1dac929a1ff5cb9215c58b91ba7d556 to your computer and use it in GitHub Desktop.
Save dennisnissle/b1dac929a1ff5cb9215c58b91ba7d556 to your computer and use it in GitHub Desktop.
Use Dienstleistungen as lexoffice category for EU sales
<?php
add_filter( 'storeabill_external_sync_lexoffice_voucher_item_category_id', 'my_child_adjust_lexoffice_category_id', 10, 3 );
function my_child_adjust_lexoffice_category_id( $category, $item, $invoice ) {
$categories = array(
'eu_revenues' => '7c112b66-0565-479c-bc18-5845e080880a',
'dienstleistungen' => '8f8664a0-fd86-11e1-a21f-0800200c9a66',
);
// Only adjust EU category
if ( $categories['eu_revenues'] === $category ) {
$category = $categories['dienstleistungen'];
}
return $category;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment