Answer a question

I am wondering if there is a way to remove the checkbox "Ship to a different address?" in woocommerce checkout page, but keep the shipping fields visible. I have tried:

add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false');

It works, however it won't show any field in the "shipping field tab".

Answers

If you want the shipping address fields to always be visible you can use CSS.

Try adding these lines to your active theme's stylesheet:

/* hides the checkbox */
#ship-to-different-address-checkbox {
    display:none;
}

/* disable touch event or mouse click */
#ship-to-different-address label {
    pointer-events: none;
}

If you want you can translate the text Ship to a different address? using any translation plugin. For example Polylang or Loco Translate.

Logo

WooCommerce社区为您提供最前沿的新闻资讯和知识内容

更多推荐