Set ACF on order during checkout
Question
I’m trying to populate a field on an order with options set by the user during checkout, on our checkout form.
function populate_custom_field_value( $order_id ) {
if ( ! empty( $_POST['custom_field_value'] ) ) {
update_field( 'field_xxxxxxxxxxxxx', sanitize_text_field( $_POST['custom_field_value']), $order_id );
}
}
My html select component is being inserted correctly, with the values defined in ACF, but it’s not setting the field on the order.
Can anyone see what I’m missing here?
Solved, thanks 🙂
0
1 month
0 Answers
10 views
0
Leave an answer
You must login or register to add a new answer .