I am creating a Wordpress and WooCommerce plugin which does the following:
Finally the solution is to update the values once the order has been made in the "thankyou.php" WooCommerce page.
Are updated as follows:
$item = $order->get_items('line_item');
$data = (array) WC()->session->get('_lm_product_data');
wc_update_order_item_meta(key($item), __( 'Name', 'hpwallart' ), $data['_name'] );
wc_update_order_item_meta(key($item), __( 'Width', 'hpwallart' ), $data['_width'] );
wc_update_order_item_meta(key($item), __( 'Height', 'hpwallart' ), $data['_height'] );
Previously, in a step of the process, I have kept in the session variable "_lm_product_data" information that interests me for the last step.