Skip to content

Instantly share code, notes, and snippets.

@wooexperte
Last active August 16, 2019 04:06
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 wooexperte/fe9596a3f310e718037baab8a257f5f1 to your computer and use it in GitHub Desktop.
Save wooexperte/fe9596a3f310e718037baab8a257f5f1 to your computer and use it in GitHub Desktop.
WooCommerce Gebühr Warenkorb
function add_checkout_fee() {
global $woocommerce;
$woocommerce->cart->add_fee( __('Gebühr', 'woocommerce'), 5 ); // Text im Warenkorb und Gebühr anpassen
}
add_action( 'woocommerce_cart_calculate_fees', 'add_checkout_fee' );
@MrThiemann
Copy link

how can I set this to apply the fee only when an item from a certain category is added?

[wie kann ich dies einstellen, dass die Gebühr nur verwendet wird, wenn ein Artikel aus einer Bestimmten Kategorie hinzugefügt wird?]

Ciao, Karsten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment