Sin descripción

form-edit-address.php 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. * @package WooCommerce\Templates
  15. * @version 3.6.0
  16. */
  17. defined( 'ABSPATH' ) || exit;
  18. $page_title = ( 'billing' === $load_address ) ? esc_html__( 'Billing address', 'woocommerce' ) : esc_html__( 'Shipping address', 'woocommerce' );
  19. do_action( 'woocommerce_before_edit_account_address_form' ); ?>
  20. <?php if ( ! $load_address ) : ?>
  21. <?php wc_get_template( 'myaccount/my-address.php' ); ?>
  22. <?php else : ?>
  23. <form method="post">
  24. <h3><?php echo apply_filters( 'woocommerce_my_account_edit_address_title', $page_title, $load_address ); ?></h3><?php // @codingStandardsIgnoreLine ?>
  25. <div class="woocommerce-address-fields">
  26. <?php do_action( "woocommerce_before_edit_address_form_{$load_address}" ); ?>
  27. <div class="woocommerce-address-fields__field-wrapper">
  28. <?php
  29. foreach ( $address as $key => $field ) {
  30. woocommerce_form_field( $key, $field, wc_get_post_data_by_key( $key, $field['value'] ) );
  31. }
  32. ?>
  33. </div>
  34. <?php do_action( "woocommerce_after_edit_address_form_{$load_address}" ); ?>
  35. <p>
  36. <button type="submit" class="button" name="save_address" value="<?php esc_attr_e( 'Save address', 'woocommerce' ); ?>"><?php esc_html_e( 'Save address', 'woocommerce' ); ?></button>
  37. <?php wp_nonce_field( 'woocommerce-edit_address', 'woocommerce-edit-address-nonce' ); ?>
  38. <input type="hidden" name="action" value="edit_address" />
  39. </p>
  40. </div>
  41. </form>
  42. <?php endif; ?>
  43. <?php do_action( 'woocommerce_after_edit_account_address_form' ); ?>