I'm adding a custom fees to WC with WC()->cart->add_fee() method.
My problem is that I'd like to add metadata to that fee item too. Preferably same time I'm adding the actual fee.
Apparently the WC_Order_Item_Fee Object is generated in the order…
I am trying to programatically add a fee to the woocommerce cart from a script which is executed on a form submission. As far as I am aware, I don't think I am able to use a hook as I need to apply the custom fee when the form on the page has been…
In woocommerce I am adding progressive fee based on product categories with the code below (from this answer thread) and it works well:
add_action( 'woocommerce_cart_calculate_fees', 'wc_custom_surcharge', 20, 1 );
function wc_custom_surcharge(…
I'd like to be able to add a fixed $20 fee if a given coupon code (100% off) is applied to the cart. The fee should also not have taxes applied. I'm offering a try at home service for $20, so a certain coupon would discount the cart and all…
I try to place post-only limit orders so that there would be no fee, and the following is the related statements:
from coinbase.wallet.client import Client
spot_price = client.get_spot_price(currency_pair = 'BTC-USD')
priceStr =…
I am trying to create a function which will remove any old fee's added in the order and add new ones based on the order items. I have created the function given be
public function order_recalculate_taxes( $order_id ) {
global $woocommerce;
…
Recently I tryied to use 2 sniped codes in one for this Woocommerce project where I need to set a fee for a specific product category (term ID: 19) and and a specific country state (Florida 'FL')
Additionally I should need to multiply this fee rate…
I have some custom calculation in my woocommerce project and need to get the most expensive product in my cart to apply the correct (insurance) fee.
It's working so far with this code:
/**
* use woocommerce fee api
* calculate insurances and…
In woocommerce, I am trying to add a fee using this answer code:
Update fee dynamically based on radio buttons in Woocommerce checkout (credits: LoicTheAztec)
I need to update the code to add third conditional option to the fee like "ribbon" in this…
In WooCommerce, I am trying to add a an additional shipping fee based on cart weight.
For the first 1500g the fee is 50$.
Above 1500g we add 10$ to this initial $50 by steps of 1000g
So for example:
if cart weight is 700g we add a fee of…
How to define the service fee between different apps under 1 google account when using Google Translate API?
I have more than one game in my Google Developer Console account, and it seems that they share the same account of Google Translate API. So…
A client has a very odd request: they would like for a set of coupon codes to add a fee to an the order. Is this possible?
The problem they are trying to solve is this:
Currently the store offers free shipping to the lower 48 United States, for…
I want to create my own Solana token that takes %2 fee to all transactions and total supply should be 100k token. That's why i used spl-token cli for this spl-token create-token --transfer-fee 50 1000, however after executing this command i get an…
Say I have ETH & other person has ZETH and we trade them.
My ETH is sent to his wallet & his ZETH is sent to my wallet. Who pays the 8$ ETH transfer fee & 2$ ZETH transfer fee? I mean in order to send eth to another wallet you pay a fee to miners.…
This is what I'm trying to achieve:
If a request is made to withdraw money over and above the allowed overdraft limit ($100), then no money is withdrawn, and a fixed flat fee ($10) is deducted from the balance.
In the code below I have tried my best…