• Resolved madhanapalan

    (@madhanapalan)


    cashback error in total payable amount after ordered placed in which the cashback amount is added into the total payable amount, for example if total product cost is 10790/- means we applied 3000/- as discount and 1000/- as cashback,so fianlly the cost should be 7790/- , but instead after ordered placed it changed into 8790/- both in invoice and in site order page. so this is a main issue we are facing in our site and we need a update regarding this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    @madhanapalan Please let us know if you are applying coupon as cashback.

    Yes, same issue happening for me as well… this is happenning only when applying coupon as cashback. Please let us know what is the solution

    Thread Starter madhanapalan

    (@madhanapalan)

    yes we applying automatic coupon as cashback with the support of WooCommerce Extended Coupon Features FREE plugin and we don’t know which causing the error,so this is the main issue many one are facing and could you provide us a solution in next update.

    same here this issue was over a year now for me. everytime client use cashback coupon like subtotal of 100 and you will add a cashback coupon the total will be 110 which is supposedly not the case.

    Plugin Author Subrata Mal

    (@subratamal)

    @madhanapalan @woocompcdev @shankamley If you apply coupon as cashback customer have to pay the total amount but after success full transaction customer will receive the coupon amount to the wallet. For example if order value is $1000 and you are applying $100 coupon as cashback then customer have to pay $1000 but after the order placement customer will receive $100 into the wallet directly as cashback.

    @subratamal I think what the op wanted to communicate was this scenario, which I faced as well.

    for a 100% Cashback Coupon

    Sub Total : 299
    Cashback: -299
    Total: 299

    But when you go to the payment page, the total becomes 598.

    I was able to fix this by editing the ./includes/class-woo-wallet-frontend.php file in the following section of the code. By commenting out this line “$order->set_total( $order->get_total( ‘edit’ ) + $_coupon_cashback_amount );”

    For anyone else looking for this issue, “Tera Wallet / Woo Wallet Coupon Cashback adding cashback value to order total”

    to the plugin author, see if this fix can be updated to the plugin code in the next update.

    ? ?/**

    ? ? ? ? ?* Handel cashback calculation on order processed hook

    ? ? ? ? ?*

    ? ? ? ? ?* @param int ? ? @param WC_Order|int $order order.

    ? ? ? ? ?*/

    ? ? ? ? public function checkout_order_processed( $order ) {

    ? ? ? ? ? ? if ( ! $order instanceof WC_Order ) {

    ? ? ? ? ? ? ? ? $order = wc_get_order( $order );

    ? ? ? ? ? ? }

    ? ? ? ? ? ? $cashback_amount = woo_wallet()->cashback->calculate_cashback();

    ? ? ? ? ? ? if ( $cashback_amount && ! is_wallet_rechargeable_order( wc_get_order( $order->get_id() ) ) && is_user_logged_in() ) {

    ? ? ? ? ? ? ? ? WOO_Wallet_Helper::update_order_meta_data( $order->get_id(), '_wallet_cashback', $cashback_amount );

    ? ? ? ? ? ? }

    ? ? ? ? ? ? $_coupon_cashback_amount = 0;

    ? ? ? ? ? ? foreach ( WC()->cart->get_coupons() as $code => $coupon ) {

    ? ? ? ? ? ? ? ? $coupon_id ? ? ? ? ? = $coupon->get_id();

    ? ? ? ? ? ? ? ? $_is_coupon_cashback = get_post_meta( $coupon_id, '_is_coupon_cashback', true );

    ? ? ? ? ? ? ? ? if ( 'yes' === $_is_coupon_cashback && is_user_logged_in() ) {

    ? ? ? ? ? ? ? ? ? ? $_coupon_cashback_amount += WC()->cart->get_coupon_discount_amount( $code, WC()->cart->display_cart_ex_tax );

    ? ? ? ? ? ? ? ? }

    ? ? ? ? ? ? }

    ? ? ? ? ? ? if ( $_coupon_cashback_amount ) {

    ? ? ? ? ? ? ? ? $discount_total ?= $order->get_discount_total( 'edit' );

    ? ? ? ? ? ? ? ? $discount_total -= $_coupon_cashback_amount;

    ? ? ? ? ? ? ? ? $order->set_discount_total( $discount_total );

    ? ? ? ? ? ? ? ? // $order->set_total( $order->get_total( 'edit' ) + $_coupon_cashback_amount );

    ? ? ? ? ? ? ? ? WOO_Wallet_Helper::update_order_meta_data( $order, '_coupon_cashback_amount', $_coupon_cashback_amount );

    ? ? ? ? ? ? }

    ? ? ? ? }



Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.