使WooCommerce结帐运送字段可见,并删除“运送到其他地址?"复选框 [英] Make WooCommerce checkout shipping fields visible and remove "Ship to different address?" checkbox
问题描述
我想知道是否有一种方法可以删除运送到其他地址?"复选框.在woocommerce结帐页面中,但保持运输字段可见.我已经尝试过:
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".
推荐答案
如果您希望收件地址字段始终可见,则可以使用 CSS .
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;
}
如果您愿意,可以使用任何翻译插件将文本运送到其他地址?.例如 Polylang 或 Loco Translate .
If you want you can translate the text Ship to a different address? using any translation plugin. For example Polylang or Loco Translate.
这篇关于使WooCommerce结帐运送字段可见,并删除“运送到其他地址?"复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!