Mailchimp Banner | Q2 2024

added by Latoya

Product Icon

Smart Coupons

All-in-one plugin for gift cards, discounts, coupons, store credits, BOGO deals, advanced restrictions, product giveaways, offers, and promotions. Smart Coupons is the original, most complete, best selling and most advanced WooCommerce coupons plugin.

Smart Coupons – Apply to Fees at Checkout

A service fee is added to the checkout of certain products. Currently, when a user checks out, even if the gift card exceeds the order total, he or she still has to pay for the fee with one of the payment gateways. Fees can added like so:
$woocommerce->cart->add_fee( ‘Service Fee’, $service_fee, true, ‘standard’ );

Fix: Before (Line 2176 of ./woocommerce_smart_coupons.php):
$order_total = Smart_Coupons_WC_Compatibility::global_wc()->cart->cart_contents_total + Smart_Coupons_WC_Compatibility::global_wc()->cart->tax_total + Smart_Coupons_WC_Compatibility::global_wc()->cart->shipping_tax_total + Smart_Coupons_WC_Compatibility::global_wc()->cart->shipping_total;

After:
$fees_total = 0;
foreach ( Smart_Coupons_WC_Compatibility::global_wc()->cart->fees as $fee ) {
$fees_total += $fee->amount;
}

$order_total = Smart_Coupons_WC_Compatibility::global_wc()->cart->cart_contents_total + Smart_Coupons_WC_Compatibility::global_wc()->cart->tax_total + Smart_Coupons_WC_Compatibility::global_wc()->cart->shipping_tax_total + Smart_Coupons_WC_Compatibility::global_wc()->cart->shipping_total + $fees_total;

Author

Current Status

Open

Last updated: March 24, 2014

0 comments

Log in to comment on this feature request.