WooCommerce 结帐,即使 disabled=true 也下订单
WooCommerce checkout, place order even with disabled=true
在使用 Woocommerce 结账时是否可以发送订单:
$fields['billing']['billing_company']['custom_attributes'] = array('disabled' => true);
问题是我有一些字段我不想让用户弄乱,但我仍然希望 woocommerce 实际使用它们。
但是,当您禁用了必填字段时,无法通过 "place order"。
用 1 hour
试图弄清楚,20 sec
在 SO 上发帖后 - 我解决了 :)
$fields['billing']['billing_company']['custom_attributes'] = array('readonly' => true);
disabled -> readonly
在使用 Woocommerce 结账时是否可以发送订单:
$fields['billing']['billing_company']['custom_attributes'] = array('disabled' => true);
问题是我有一些字段我不想让用户弄乱,但我仍然希望 woocommerce 实际使用它们。 但是,当您禁用了必填字段时,无法通过 "place order"。
用 1 hour
试图弄清楚,20 sec
在 SO 上发帖后 - 我解决了 :)
$fields['billing']['billing_company']['custom_attributes'] = array('readonly' => true);
disabled -> readonly