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' )…
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':
…
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…
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…
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…
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(…
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…
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…
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…
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…
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 );…
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…
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…
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…
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:
//…