I want to add a 30% discount on the cheapest item in the cart, except if it already has a discount.
Based on Cart discount for product that cost less in Woocommerce answer code, this is my code attempt:
add_action('woocommerce_cart_calculate_fees',…
I have a code snippet running on a Woocommerce site that calculates and adds a handling fee to the cart total.
There are two parts to the calculation:
If the shipping rate is greater than 0, then add 18% of the shipping rate;
If a product in the…
Based on Add a checkout checkbox field that enable a percentage fee in Woocommerce answer code, I've got a custom checkbox on which I need to offer discount to customers.
I'm trying to apply the custom discount of say $0.03 x product quantity…
I have a wholesale site with different user roles & want to allow employees to start ordering online from here also.
I want to only add a $5 fee if the user roles 'team' and 'team2' select ship to a different address (they get free shipping if sent…
I want to add a fee for a category (A), but to be calculated only when in the order are products from other categories (B, C, D, etc).
But if only category A products are ordered, that tax does not apply.
In my code the fee is added in both…
I use this code to add additional fee to a specific product id's. The problem is that I can add only one fee to a different products id's.
add_action('woocommerce_cart_calculate_fees', 'add_fees_on_ids');
function add_fees_on_ids() {
if…
Is it possible to decompose in details how much an additional line of code will impact the gas price for execution, i.e. transferring a token from one wallet to another, before deploying a smart contract?
Test networks are not very accurate there…
I created a custom fee on Woocommerce based on a user plan. I did something like this on my functions.php:
function my_discount_based_on_user_membership( $cart ) {
$discount = 10;
$cart->add_fee( "My Discount", -$discount );
}
add_action(…
I currently have active code in WooCommerce and it works fine. The code allows me to apply an extra cost when the customer chooses the "COD' pyament method, + € 1.7
What I would like to understand is this:
Is it possible to disable the extra cost…
I want to pass on stripe fees to customers paying with card, thereby encouraging them to use ACH payment methods.
I've considered making the fee a separate charge, but there is a fee on the fee, and so the customer would end up paying more than the…
I'm using WooCommerce for my e-commerce store and I'd like to know if there is some option, how to get a total price (fee) of shipping and total price (fee) of payment methods and their sum on Checkout page. (shipping fee + payment fee = result). I…
In WooCommerce Dokan multivendor shop I have Cash On Delivery (COD) payment for customers.
I created a code that counts the vendors in the cart and multiply them with the fee that i want per vendor. on my example is 2 € per vendor. so lets say that…
I have currently 2 shipping zones (France, Europe) and each of them have several delivery option, including flat-rate. These flat-rate options have a different equation to calculate the fee based on item qty with A B and C three different shipping…
How can I get transaction size before sending BTC to an external address?
I am using Bitcoin core to make the transactions, and I was trying to calculate transaction size.
So that I can use it to estimate transaction fee.
But couldn't find a…
Found exactly the snippet I was looking for to add a fixed fee amount to each individual cart item regardless of price. This site sells tires. So each tire will be charged 3$.
Here is the code I'm using and…