Update meta data
-
Hi i use a code to update metadata. With default woocommerce fields the code works fine. With the fields i make with your plugin it returns an internal server error and metadata doenst update.
I use this code.
add_action( ‘woocommerce_new_order’, ‘set_city_same_to_state’, 1, 1 );
function set_city_same_to_state( $order_id ) {$order = new WC_Order( $order_id );
$order->update_meta_data( ‘custom_field’, $order->get_billing_custom());$order->save();
}Do you know why? Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Update meta data’ is closed to new replies.