我正在使用Woocommerce作为商店系统。 如果给定地址没有可用的运输区域,我想显示一条默认消息。
这是我想显示的内容:
echo "<div class='shipping_notice_germany_checkout'>Leider sind unsere Produkte noch <b>nicht Flächendeckend in Deutschland verfügbar</b>. Bitte <a href='#deutschland-versand-popup' class='open-popup-link'> kontaktieren Sie uns</a>, um die perfekte Lösung für Sie zu finden.</div>";
我要显示的钩子是这个:cfw_checkout_after_shipping_methods
所以我将此功能添加到我的functions.php中:
function my_custom_wc_free_shipping_notice2() {
echo "<div class='shipping_notice_germany_checkout'>Leider sind unsere Produkte noch <b>nicht Flächendeckend in Deutschland verfügbar</b>. Bitte <a href='#deutschland-versand-popup' class='open-popup-link'> kontaktieren Sie uns</a>, um die perfekte Lösung für Sie zu finden.</div>";
}
add_action( 'cfw_checkout_after_shipping_methods', 'my_custom_wc_free_shipping_notice2' );
但是我缺少该功能的if部分,仅在没有其他可用的运送方式时显示它。
感谢您的帮助!