Skip to main content

This code works for me. Sorry that the code is not good readable.

<?php
     global $post;
 
     $post = $order_id;
 
       if ( isset( $_POST['submit'] ) )
         {
                 echo 'Update nicht';
         } else  if ( ! empty( $_POST['frontstrasse'] ) ) {
        update_post_meta( $order_id, 'Strasse', sanitize_text_field( $_POST['frontstrasse'] ) );
        update_post_meta( $order_id, 'Haus-Nr', sanitize_text_field( $_POST['fronthausnr'] ) );

 
}
$istrasse = get_post_meta($order->id, 'Strasse', true );
$ihausnr = get_post_meta($order->id, 'Haus-Nr', true );
 
  ?>

 <form method="post" action="">
<label>Strasse</label><input type='text' name='frontstrasse' value='<?php echo $istrasse ?>' />
<label>Haus-Nr</label><input type='text' name='fronthausnr' value='<?php echo  $ihausnr ?>' />
<input type='submit' value='save' name='frontsubmit' />
 </form>

This code works for me. Sorry that the code is not good readable.

<?php
     global $post;
 
     $post = $order_id;
 
       if ( isset( $_POST['submit'] ) )
         {
                 echo 'Update nicht';
         } else  if ( ! empty( $_POST['frontstrasse'] ) ) {
        update_post_meta( $order_id, 'Strasse', sanitize_text_field( $_POST['frontstrasse'] ) );
        update_post_meta( $order_id, 'Haus-Nr', sanitize_text_field( $_POST['fronthausnr'] ) );

 
}
$istrasse = get_post_meta($order->id, 'Strasse', true );
$ihausnr = get_post_meta($order->id, 'Haus-Nr', true );
 
  ?>

 <form method="post" action="">
<label>Strasse</label><input type='text' name='frontstrasse' value='<?php echo $istrasse ?>' />
<label>Haus-Nr</label><input type='text' name='fronthausnr' value='<?php echo  $ihausnr ?>' />
<input type='submit' value='save' name='frontsubmit' />
 </form>

This code works for me. Sorry that the code is not good readable.

<?php
global $post;
$post = $order_id;
if ( isset( $_POST['submit'] ) ){
  echo 'Update nicht';
} else  if ( ! empty( $_POST['frontstrasse'] ) ) {
  update_post_meta( $order_id, 'Strasse', sanitize_text_field( $_POST['frontstrasse'] ) );
  update_post_meta( $order_id, 'Haus-Nr', sanitize_text_field( $_POST['fronthausnr'] ) );
}
$istrasse = get_post_meta($order->id, 'Strasse', true );
$ihausnr = get_post_meta($order->id, 'Haus-Nr', true );
?>

<form method="post" action="">
<label>Strasse</label><input type='text' name='frontstrasse' value='<?php echo $istrasse ?>' />
<label>Haus-Nr</label><input type='text' name='fronthausnr' value='<?php echo  $ihausnr ?>' />
<input type='submit' value='save' name='frontsubmit' />
</form>
Source Link

This code works for me. Sorry that the code is not good readable.

<?php
     global $post;

     $post = $order_id;

       if ( isset( $_POST['submit'] ) )
         {
                 echo 'Update nicht';
         } else  if ( ! empty( $_POST['frontstrasse'] ) ) {
        update_post_meta( $order_id, 'Strasse', sanitize_text_field( $_POST['frontstrasse'] ) );
        update_post_meta( $order_id, 'Haus-Nr', sanitize_text_field( $_POST['fronthausnr'] ) );


}
$istrasse = get_post_meta($order->id, 'Strasse', true );
$ihausnr = get_post_meta($order->id, 'Haus-Nr', true );

  ?>

 <form method="post" action="">
<label>Strasse</label><input type='text' name='frontstrasse' value='<?php echo $istrasse ?>' />
<label>Haus-Nr</label><input type='text' name='fronthausnr' value='<?php echo  $ihausnr ?>' />
<input type='submit' value='save' name='frontsubmit' />
 </form>