Custom fee disappearing on checkout page by ajax update
-
I have added the custom hook to add a discount, when the page loads, the discount is visible, but as soon as page loads, an wc-ajax request makes the cstom discount go away. I am using the latest version of woocommerce. Here is my code,
add_action('woocommerce_cart_calculate_fees' , function() { //global $woocommerce; $discount = WC()->cart->subtotal * -0.1; WC()->cart->add_fee('Custom', $discount); });
can you please help me with this.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Custom fee disappearing on checkout page by ajax update’ is closed to new replies.