/templates/myaccount/form-edit-address.php

  1. <?php 
  2. /** 
  3. * Edit address form 
  4. * 
  5. * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-edit-address.php. 
  6. * 
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you 
  8. * (the theme developer) will need to copy the new files to your theme to 
  9. * maintain compatibility. We try to do this as little as possible, but it does 
  10. * happen. When this occurs the version of the template file will be bumped and 
  11. * the readme will list any important changes. 
  12. * 
  13. * @see https://docs.woocommerce.com/document/template-structure/ 
  14. * @author WooThemes 
  15. * @package WooCommerce/Templates 
  16. * @version 3.0.0 
  17. */ 
  18.  
  19. if ( ! defined( 'ABSPATH' ) ) { 
  20. exit; 
  21.  
  22. $page_title = ( 'billing' === $load_address ) ? __( 'Billing address', 'woocommerce' ) : __( 'Shipping address', 'woocommerce' ); 
  23.  
  24. do_action( 'woocommerce_before_edit_account_address_form' ); ?> 
  25.  
  26. <?php if ( ! $load_address ) : ?> 
  27. <?php wc_get_template( 'myaccount/my-address.php' ); ?> 
  28. <?php else : ?> 
  29.  
  30. <form method="post"> 
  31.  
  32. <h3><?php echo apply_filters( 'woocommerce_my_account_edit_address_title', $page_title, $load_address ); ?></h3> 
  33.  
  34. <div class="woocommerce-address-fields"> 
  35. <?php do_action( "woocommerce_before_edit_address_form_{$load_address}" ); ?> 
  36.  
  37. <div class="woocommerce-address-fields__field-wrapper"> 
  38. <?php foreach ( $address as $key => $field ) : ?> 
  39. <?php woocommerce_form_field( $key, $field, ! empty( $_POST[ $key ] ) ? wc_clean( $_POST[ $key ] ) : $field['value'] ); ?> 
  40. <?php endforeach; ?> 
  41. </div> 
  42.  
  43. <?php do_action( "woocommerce_after_edit_address_form_{$load_address}" ); ?> 
  44.  
  45. <p> 
  46. <input type="submit" class="button" name="save_address" value="<?php esc_attr_e( 'Save address', 'woocommerce' ); ?>" /> 
  47. <?php wp_nonce_field( 'woocommerce-edit_address' ); ?> 
  48. <input type="hidden" name="action" value="edit_address" /> 
  49. </p> 
  50. </div> 
  51.  
  52. </form> 
  53.  
  54. <?php endif; ?> 
  55.  
  56. <?php do_action( 'woocommerce_after_edit_account_address_form' ); ?> 
.