Hi Thomas,
hm, ist vielleicht eine Möglichkeit für die Zukunft. Das kannst du relativ leicht im entsprechenden Template anpassen. Zugreifen kannst du auf die Daten über die Metadaten des Users:
get_user_meta( $customer_id, 'billing_title', true );
bzw.
get_user_meta( $customer_id, 'shipping_title', true );
Grüße
Danke für die Info.
Leider finde ich das entsprechende Template dafür nicht. Kannst Du da weiterhelfen?
@tmconnect
Faul wie ich bin, habe ich das einfach so gelöst: (functions.php)
// WOO-Germanized Anrede User-Profil
add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
function my_show_extra_profile_fields( $user ) { ?>
<h3>Anrede des Kunden</h3>
<table class="form-table">
<tr>
<th><label for="anrede_r">Anrede Rechnung</label></th>
<td>
<select name="anrede_r">
<option value="1" <?php echo (get_user_meta( $user->ID, 'billing_title', true )==1) ? 'selected' : '';?>>Herr</option>
<option value="2" <?php echo (get_user_meta( $user->ID, 'billing_title', true )==2) ? 'selected' : '';?>>Frau</option>
</select>
</td>
</tr>
<tr>
<th><label for="anrede_v">Anrede Versand</label></th>
<td>
<select name="anrede_v">
<option value="1" <?php echo (get_user_meta( $user->ID, 'shipping_title', true )==1) ? 'selected' : '';?>>Herr</option>
<option value="2" <?php echo (get_user_meta( $user->ID, 'shipping_title', true )==2) ? 'selected' : '';?>>Frau</option>
</select>
</td>
</tr>
</table>
<?php }
function my_save_extra_profile_fields( $user_id ) {
if ( !current_user_can( 'edit_user', $user_id ) )
return false;
update_usermeta( $user_id, 'billing_title', $_POST['anrede_r'] );
update_usermeta( $user_id, 'shipping_title', $_POST['anrede_v'] );
}
Gibt sicher bessere Lösungen, aber funktioniert…
Hi,
das Thema interessiert mich auch, aber ich hab auch nicht kapiert wo das rein muss…
In der functions.php am Ende implementiert schieß ich die Seite leider irgendwie ab… (Nur weiß im Browser)
//EDITH: geht doch… 🙂 Danke trotzdem
Danke
Tom