Woocommerce: Programmatically Update Item In Cart

I need to programmatically and dynamically change the price of an item in the cart. I’ve tried varying combinations of Woocommerce action hooks, the cart and session objects, but nothing quite...

Add a fee to WooCommerce per product, based on category

I've been trying for a while now to get this working but I haven't find any solution that does exactly what we need, and I'm far from an expert in PHP so I'm a bit lost. We use WooCommerce and...

woocommerce custom checkout field to add fee to order ajax

I'm trying to ad a custom fee to the order total upon checkout. I've added a checkbox within woocommerce add_action( 'woocommerce_after_checkout_billing_form', 'add_box_option_to_checkout'...

Add fee based on specific payment methods in WooCommerce

In WooCommerce I need to apply a custom handling fee for a specific payment gateway. I have this piece of code from here: How to Add Handling Fee to WooCommerce Checkout. This is my...

Custom WooCommerce fee disappears at checkout

I add a custom fee on woocommerce_cart_calculate_fees: add_action('woocommerce_cart_calculate_fees', 'delivery_surcharge'); function delivery_surcharge() { global $woocommerce; // ... ...

Wordpress Woocommerce get value from custom shipping field (AJAX)

So I have an ecommerce using woocommerce and I use custom shipping for track shipping fee. And I already add new input data (select). like you can see on below picture: // Hook...

Update fee dynamically based on radio buttons in Woocommerce checkout

So I'm developing a plugin for woocommerce, and I have added a selection for packing, either in a plastic bag or in Cartoon Box with each having a different cost. Ones the user selects one of the...

Checkout distance Calculation Using Google Map API in WooCommerce 3.3

I posted a similar problem a few months back and I have been helped out there to solve it. It was working fine until Woocommerce version 3.1.2. I have been updating to latest version of...

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 =...

Adjust Shipping Class based on Product Tax Class in WooCommerce

I am currently trying to implement some dynamic taxing for products and shipping in WooCommerce. So far, I have used this method: WooCommerce Documentation on Tax Classes and User Roles for...

Check applied coupons before adding a fee in Woocommerce

I am using some code to add a custom fee at checkout in Woocommerce, however when applying a coupon it does not deduct the fee. Is there a way to check if a coupon has been used before adding the...

Checkbox field that add to cart a product in Woocommerce checkout page

In Woocommerce checkout section, I am trying to add a checkbox that adds an additional product. I have a working piece of code that adds a fee and updates the cart on click of a checkbox, but I...

Disable Automatic cart/checkout_update add manual option to update before placing order

Current Issue: My checkout calculator refreshes shipping rates way too often, currently it update/refreshes shipping rates when I change a payment method, or I choose a different shipping method...

How to add in Woocommerce checkout page a an extra fee checkbox

In Woocommerce I would like to add a checkbox in checkout page that will add (charges) a fee if the user checks it a fee of 12.00. I have tried to use...

Force display a zero fee in Woocommerce Orders and email notifications

In Woocommerce, I am trying to get the display of a custom fee, when the fee amount is zero, to make it appear in the order detail table. Based on...

Display custom delivery choice on Woocommerce Order totals table

Based on "https://stackoverflow.com/questions/49457961/update-fee-dynamically-based-on-radio-buttons-in-woocommerce-checkout/49470265#49470265" answer code, I have been able add a custom dynamic...

Add a checkout checkbox field that enable a percentage fee in Woocommerce

In Woocommerce checkout page, I'am trying to add a check box on checkout page and call it "Installment". When checkbox is ticked to add 3 percent total amount. For example, if the total amount is...

Extra fee on WooCommerce checkout page not added to subtotal

I need to add Handling fee in checkout page for some state. For this I am using woocommerce add_fee option. But my problem is on checkout page the handling fee is showing but not add to subtotal....

Woocommerce trigger the "order review" update in checkout page

I'm using the Woocommerce Advanced Shipping plugin by Jeroen Sormani for the shipping methods and the WooCommerce Pay for Payment plugin by Karolína Vyskočilová to add a €5 fixed fee to the...

WooCommerce remove specific fee

I'm currently adding a feee on checkout; add_action( 'woocommerce_cart_calculate_fees', 'custom_cart_total' ); function custom_cart_total($order_total) { WC()->cart->add_fee( __('Military...

Add a dynamic fee based on a select field in WooCommerce Checkout

I am using https://stackoverflow.com/questions/49457961/update-fee-dynamically-based-on-radio-buttons-in-woocommerce-checkout/49470265#49470265 answer code solution that worked very well for me to...

Apply Coupon code discount to the final order total

We sell trails and the trails are "products" in WooCommerce. >> Check this link Try clicking on the "Let's Play" link and it will take you to the checkout. >> (Screenshot) The price of each trail...

creating radio button options for each item in a woocommerce cart only working 75% of the time

When adding radio button selections to each item in the WooCommerce cart on the checkout page the Ajax seems not to pass the correct radio button selection selection all the time. It works 75% of...

WooCommerce update_checkout won't update shipping methods

On my WooCommerce site I use this function to add a 4€ fee if you select cash on delivery as payment method: add_action('woocommerce_cart_calculate_fees', 'increase_cod_cost'); function...

Update dynamically a calculated fee in WooCommerce cart page

My question is basically nearly similar to this question, but my case is on cart page (not checkout...

Don't change order total when refunding items in Woocommerce

I have a store selling fresh produce and quite often have products purchased and paid for that aren't available on the day from the market. I then refund the customer (using the woocommerce manual...

How should I change the woocommerce_form_field HTML Structure?

I'm using WooCommerce: Add Checkout Fees Based on Custom Radio Button from businessbloomer My question is about woocommerce_form_field() which is used in part 1 // etc... echo '<div...

Checkbox enabling a percentage discount in WooCommerce Checkout for specific category

The amended code below is based on Add a checkout checkbox field that enable a percentage fee in Woocommerce. I have adapted but wishing to only target a specific category so when a student ticks...

Dokan Stripe Connect Not Charging Shipping With remove_filter( 'woocommerce_cart_shipping_packages', 'dokan_custom_split_shipping_packages' );

We are using Dokan to power a WooCommerce multi-vendor marketplace. This is configured so that the admin receives a commission as a "collected fee" in Stripe as part of the Stripe Connect payment...

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...