• Resolved nejcox

    (@nejcox)


    Hello.

    I would like to list a fee for a specific product just to show that it’s free. Thus, I would like to name it and enter text instead of price amount, e.g. so that it would say “free” instead of “0,00€”. It can also come with label: “Free (0,00)”.

    • This topic was modified 4 years, 2 months ago by nejcox.
    • This topic was modified 4 years, 2 months ago by nejcox.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter nejcox

    (@nejcox)

    Solved with some tinkering. But needs also some CSS.

    add_filter(‘woocommerce_cart_totals_fee_html’, ‘show_positive_fee_value’, 10, 2 );
    function show_positive_fee_value($cart_totals_fee_html, $fee) {
    if($fee->name === ‘TEXT’) {
    $cart_totals_fee_html .= __(‘TEXT’) . ‘<br />’;
    }
    return $cart_totals_fee_html;
    }

    Thread Starter nejcox

    (@nejcox)

    This worked even better as it removes amount. But unfortunately the amount value is lost.

    add_filter(‘woocommerce_cart_totals_fee_html’, ‘show_positive_fee_value’, 10, 2 );
    function show_positive_fee_value($cart_totals_fee_html, $fee) {
    if($fee->name === ‘TEXT’) {
    $cart_totals_fee_html = ‘TEXT (FREE)’;
    }
    return $cart_totals_fee_html;
    }

    Thread Starter nejcox

    (@nejcox)

    It basically does what I wanted but now the confirmation page says 0,00 instead of text. ??

    Plugin Support Hitendra Chopda

    (@hitendra-chopda)

    Hello nejcox,

    Thanks for contacting us.

    Sorry to say but, we are unable to change the woocommerce flow and it always displays the amount.

    If there is no fee added, then default it will display 0.00.

    Thanks,
    Hitendra & Dotstore Team

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Text instead of an amount’ is closed to new replies.