• On one of the shipping settings you can set how you want the shipping method to be presented on the front end. I do not want the shipping method to be presented, I only want the shipping cost to be presented. Is this possible?
    ( at cart and Payment page, shipping cost are presented something like: “fixed: E 3,40”. I only want the “E 3,40”)

    Txs.
    Michel

    https://ww.wp.xz.cn/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @michel7,

    You can try to paste this code in your child theme’s functions.php:

    /**
     * Remove shipping name from the label in Cart and Checkout pages
     */
    add_filter( 'woocommerce_cart_shipping_method_full_label', 'wc_custom_shipping_labels', 10, 2 );
    function wc_custom_shipping_labels( $label, $method ) {
        if ( $method->cost > 0 ) {
            if ( WC()->cart->tax_display_cart == 'excl' ) {
                $label = wc_price( $method->cost );
                if ( $method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax ) {
                    $label .= ' <small>' . WC()->countries->ex_tax_or_vat() . '</small>';
                }
            } else {
                $label = wc_price( $method->cost + $method->get_shipping_tax() );
                if ( $method->get_shipping_tax() > 0 && ! WC()->cart->prices_include_tax ) {
                    $label = ' <small>' . WC()->countries->inc_tax_or_vat() . '</small>';
                }
            }
        }
    
        return $label;
    }

    See https://support.woothemes.com/hc/communities/public/questions/202866646-Remove-label-for-shipping-method-

    Let me know if this works.

    Thread Starter Michel7

    (@michel7)

    Hi wooassist.
    Txs & sorry for the late response: missed your post for some reason

    Yes it works txs.!

    New challenge now is that you first have the standard line: ‘shipping (-methode)’, than on the next line, which used to start with what now is deleted: the actually shipping methode and the price. So in other words the shipping price is now one line below the text ‘shipping’ which looks a bit awkward. Can’t find the solution myself is this easily resolvable or a theme author thing?

    txs. once again.
    Michel

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Split shipping method text from shipping cost’ is closed to new replies.