Product Icon

Smart Coupons for WooCommerce

Boost sales and customer loyalty. Create advanced discounts, sell gift cards, set BOGO deals, give store credits, and all types of rule based dynamic discounts with this all-in-one Smart Coupons plugin for WooCommerce.

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.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.