Back

woocommerce Add discount

Copy Below Code View As A Text File Show Text Only Show API Edit Code
                            

function filter_woocommerce_get_discounted_price( $price, $values, $instance ) { $discount = 10; // WC()->cart->set_discount_total($discount); // WC()->cart->get_totals(); $discount *= -1; WC()->cart->add_fee('Whole Seller Discount', $discount, true, '' ); // add negative fees return $price; };