• Resolved zewa

    (@zewa)


    ? Hi, first of all I want to say thank you for a great plugin, it is just what my client needs. There is just one thing that I would like to ask, is it possible to show the amount of percentage in the woocommerce cart? The price get discounted as it should when I apply coupon of 23% for example, but it shows only discount in euros, like “–20,70€”
    It would be more clear to the customer to see also the amount of percentage that was applied, the amount which was defined and I can see it from the backend in description of the coupon, but not from the front end, from the customer’s side. As a customer I’m unable to see the percentage and it may be confusing.
    Hope I made myself clear??

    • This topic was modified 1 year, 6 months ago by zewa.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Fauzan Azizie

    (@fauzanade)

    Hi @zewa,

    However, I can certainly forward your request as a suggestion for our development team to evaluate. Please be aware that we cannot guarantee the inclusion of this feature in upcoming updates, nor can we provide any official estimates regarding its potential implementation.

    We appreciate your patience and understanding.

    Cheers,

    Plugin Support Jeff Alvarez

    (@superlemon1998)

    Hi @zewa ,

    Good news, we made a custom snippet that achieves just that. Please add the following to your child theme’s functions.php or through the WP Code plugin

    add_filter( 'woocommerce_cart_totals_coupon_html', 'woocommerce_cart_totals_coupon_html_filter', 10, 3 );
    
    /**
     * Function for woocommerce_cart_totals_coupon_html filter-hook.
     * 
     * @param  $coupon_html          
     * @param  $coupon               
     * @param  $discount_amount_html 
     *
     * @return 
     */
    function woocommerce_cart_totals_coupon_html_filter( $coupon_html, $coupon, $discount_amount_html ){
    if($coupon->discount_type === "percent"){
    	return $coupon->amount ."% "."or " . $coupon_html;
    }
    return $coupon_html;
    }

    Result: Screenshot by Lightshot (prnt.sc)

    Please note that we aren’t able to provide further support for custom codes when/if used.

    Thread Starter zewa

    (@zewa)

    Thank you! It works perfectly!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show amount of percentage’ is closed to new replies.