Questions tagged [fee]

E-commerce usage related to additional charges

A charge, a surcharge or an addition for professional service…

157 questions
9
votes
1 answer

Get the order fee item details in Woocommerce 3

I try to get the name of the fee attached to my order in Woocommerce, I get an array but I don't know how to get the name. I tried with function get_name () but it does not work. $the_order->get_items( array( 'line_item', 'fee', 'shipping' )…
user6677795
7
votes
1 answer

Add a fee to an order programmatically in Woocommerce 3

I'm creating Woocommerce totals 'on-the-fly' as my cart items are imported from another CMS. Currently I am having trouble setting a custom 'fee' for each order, then marking the order as 'on-hold': …
Callum
  • 554
  • 2
  • 7
  • 18
7
votes
1 answer

Add tax free fees to WooCommerce cart programmatically

I try to add fees based on some calculations I do on Woocommerce cart, but I want to exclude it from VAT. This is my code: function woo_add_cart_fee( $cart ) { global $woocommerce; $bookable_total = 0; foreach(WC()->cart->get_cart() as…
Tasos
  • 7,325
  • 18
  • 83
  • 176
4
votes
1 answer

Add extra packaging options through radio buttons in WooCommerce checkout

Based on Update fee dynamically based on radio buttons in Woocommerce checkout anser code. I'm trying to make it work with different packaging options on WooCommerce checkout. The idea is to be able to provide options for gift wrapping, packaging in…
user14906105
4
votes
1 answer

Add a custom fee for a specific payment gateway in Woocommerce

How can I add a percentage to the total amount when choosing a payment (credit card)? For example: If the customer pays for cash on delivery, then the base price, and if I chose online payment, then the percentage charged by me is added to the total…
3
votes
1 answer

Hide custom fee row from order details table in WooCommerce email notifications

I have added 3 custom fees in my order table but in the emails sent to admin/client, I want to hide one of these custom fee. See screen shot : Actually, I added the custom fees with this snippet: add_action(…
3
votes
1 answer

Add fee for certain products in WooCommerce cart

I have a working script that adds a fee for certain products in an array. But it only adds the fee for the first product in the array. I have tried different options with my knowledge but it doesn't work. Any advice on what i'm doing wrong? This is…
Erik Duits
  • 91
  • 9
3
votes
1 answer

WooCommerce checkout radio buttons that set a percentage fee based on specific items subtotal

I am trying to implement warranty option into woocommerce checkout. The below code works for static price values. // Part 1 - Display Radio Buttons add_action( 'woocommerce_review_order_before_payment', 'custom_checkout_radio_choice' ); function…
Rosalito Udtohan
  • 187
  • 1
  • 11
3
votes
2 answers

Remove minus sign from Woocommerce negative fees displayed amount

I am developing a booking system in which the client wants only to take a USD 50 deposit and to negotiate the remaining amount separately. In order to achieve this I have used the following code to update the total price to USD 50 and to show the…
Disura
  • 48
  • 5
3
votes
1 answer

Reordering multiple fees differently in Woocommerce cart and checkout pages

When adding multiple fees to the checkout in woocommerce, is it possible to prioritise the order of them? Currently it looks like woocommerce orders them by the fee value, so for example: Fee 1 = £10.00, Fee 2 = £20.00, they would get ordered like…
danyo
  • 5,686
  • 20
  • 59
  • 119
2
votes
1 answer

Add Commission Fee to WooCommerce Checkout Based on Subtotal

Trying to add a commission fee to the WooCommerce checkout based on 5% multiplied by subtotal. But, all I get is a blank page and the site stops working. This is the code: add_action( 'woocommerce_cart_calculate_fees', 'add_commission', 10, 1 );…
2
votes
3 answers

WooCommerce programmatically added fee don't persists

I am adding a custom fee to the cart by hooking into the woocommerce_cart_calculate_fees action like so: if (isset($_GET['discount'])) { add_action('woocommerce_cart_calculate_fees', 'add_loyalty_discounts'); } function…
franka
  • 33
  • 6
2
votes
1 answer

Add the values of product meta as fee in WooCommerce cart

In Italy there is a specific fee for the disposal of electronic products that must be paid during the purchase. This "ecofee" is specific for each product. I have set up a specific meta for each product called meta_product_grossecofee I'd like to…
Deegita
  • 45
  • 3
2
votes
1 answer

How to add order fee based on Select Delivery Date woo commerce checkout?

I am using xdsoft date time picker at woo-commerce checkout and need to add an extra fee if a user selects the same day or tomorrow on the date time picker. I am not sure how to go with this and would appreciate it if someone can help me with…
2
votes
1 answer

How to sum the additional fees of added product ID's in WooCommerce cart

I'm using How to add additional fees to different products in WooCommerce cart answer code (part 2). This code is to add additional fees to the products that are described with their IDs. Of that existing answer I have replaced: //…
amex
  • 35
  • 5
1
2 3
10 11