我试图在Wordpress中使用自定义签出字段中的信息填充签出表单,以便将信息与订单一起保存并发送到电子邮件中。
add_action(\'woocommerce_checkout_process\', \'gfm_checkout_field_process\');
function gfm_checkout_field_process( $fields ) {
// Validate pickup date if user chose to pickup the order
if (WC()->session->get(\'chosen_shipping_methods\')[0] == \'local_pickup\') {
$pickup_date = strtotime($_POST["gfm_pickup_date"]);
$fields[\'order\'][\'order_comments\'] = $pickup_date;
}
}
任何帮助都将不胜感激!