0
votes

I am providing renting service online in my woocommerce website i want to charge only for refundable amount , but wants to also show the product amount, but while customer goes to view cart. there are products total shown in subtotal I want the final total amount in which the product total amount is excluded only refundable amount is included

General Cart:- $total=$subtotal+$refundable I need :- $total=$refundable

How can i do that

1
please check www.instarents.com website and go to cart. there will product and refundable amount but the final total amount includes only refundable amountSaagar Dhawan
But please again, could you try to clarify a little bit more your question, editing it (may be additionally giving a concrete example) and including in it your website link. ThanksLoicTheAztec

1 Answers

0
votes

Try adding your refund as a custom fee. Please refer this example

    function woo_add_cart_fee() {
      global $woocommerce;  
      $woocommerce->cart->add_fee( __('Refundable deposit', 'woocommerce'), -3750.00 ); 
// since its going to be refund we should add fee in negative value.  
// You can add the refund as fee in this hook
    }
    add_action( 'woocommerce_cart_calculate_fees', 'woo_add_cart_fee' );