1
我可以從結算和運輸中取消設置字段,但爲什麼我無法取消設置其他字段的字段。我在這些領域添加了一個條件。也許我正在使用錯誤的元鍵。在結帳時取消設置自定義字段 - woocommerce
function wc_remove_checkout_field($fields) {
unset($fields['billing']['test_field']); //this one working
unset($fields['additional']['delivery_time']); //this one not even if I replace additional with order.
return $fields;
}
add_filter('woocommerce_checkout_fields' , 'wc_remove_checkout_field');
創建領域usings這個插件WooCommerce Checkout Field Editor
這對我都有用。我無法取消使用此插件創建的那些字段。我是基於購物車中的產品類別創造條件的。 – Stunomatic
如果它與插件相關,請嘗試聯繫插件作者 – Avishay28