I will that the custome can update in the order the custom fileds (who was insert in the checkout page)


I have this code in the order-details.php Page but it show only the value in the input but he don't update with the new value

    <?php
     global $post;
    
    
     if ( isset( $_POST['submit'] ) )
     {
     if( ! isset( $post ) ) {
     echo 'Error: Nichts ausgewählt';
     die();
     }
     else if( ! isset( $_POST['frontstrasse'] ) && ! empty( $_POST['frontstrasse'] ) ){
     echo 'Error: Strasse Not Set';
     die();
     }
    
    
     update_post_meta( $order->id, 'frontstrasse', sanitize_text_field( $_POST['Strasse'] ) );
     }
    
    
     $istrasse = get_post_meta($order->id, 'Strasse', true );
    
    
     echo print_r($istrasse);
     ?>
     <form method="post" action="">
     <input type='text' name='frontstrasse' value='<?php echo isset($istrasse) ? $istrasse : ''; ?>' />
     <input type='submit' value='save' />
     </form>