• Resolved sabo1

    (@sabo1)


    Hi,

    i added in table rates a price of 0,00 € if the weight is 0 kg. At the frontend the price of “0Euro” does not appear. (only the word “Shipping” and left space). Other rates with more than 0 kg show up correcly.

    How can I fix that showing “0€”

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support lusp

    (@lusp)

    Hi @sabo1,

    I believe it is related to the WooCommerce default mechanisms, however, if you want to display the shipping cost even if it’s 0,00 € adding this snippet to the functions.php of the currently used theme should do the job:

    add_filter( 'woocommerce_cart_shipping_method_full_label', 'ls_woocommerce_cart_shipping_method_full_label', 10, 2 );
    function ls_woocommerce_cart_shipping_method_full_label( $label, $method ) {
    	$label     = $method->get_label();
    	if ( WC()->cart->display_prices_including_tax() ) {
    		$label .= ': ' . wc_price( $method->cost + $method->get_shipping_tax() );
    		if ( $method->get_shipping_tax() > 0 && ! wc_prices_include_tax() ) {
    			$label .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
    		}
    	} else {
    		$label .= ': ' . wc_price( $method->cost );
    		if ( $method->get_shipping_tax() > 0 && wc_prices_include_tax() ) {
    			$label .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
    		}
    	}
    	return $label;
    }

    Kind regards,
    ?ukasz

    Thread Starter sabo1

    (@sabo1)

    Worked! Thank you!

    Plugin Support lusp

    (@lusp)

    It’s great to hear that! I’m glad I was able to help ??

    Kind regards,
    ?ukasz

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘price 0,00 not showing’ is closed to new replies.