dashboard.php
5 years ago
downloads.php
5 years ago
form-add-payment-method.php
5 years ago
form-edit-account.php
5 years ago
form-edit-address.php
5 years ago
form-login.php
3 years ago
form-lost-password.php
5 years ago
form-reset-password.php
5 years ago
lost-password-confirmation.php
5 years ago
my-account.php
5 years ago
my-address.php
5 years ago
my-downloads.php
5 years ago
my-orders.php
5 years ago
navigation.php
5 years ago
orders.php
5 years ago
payment-methods.php
5 years ago
view-order.php
5 years ago
my-address.php
78 lines
| 1 | <?php |
| 2 | /** |
| 3 | * My Addresses |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/my-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 2.6.0 |
| 16 | */ |
| 17 | |
| 18 | defined( 'ABSPATH' ) || exit; |
| 19 | |
| 20 | $customer_id = get_current_user_id(); |
| 21 | |
| 22 | if ( ! wc_ship_to_billing_address_only() && wc_shipping_enabled() ) { |
| 23 | $get_addresses = apply_filters( |
| 24 | 'woocommerce_my_account_get_addresses', |
| 25 | array( |
| 26 | 'billing' => __( 'Billing address', 'woocommerce' ), |
| 27 | 'shipping' => __( 'Shipping address', 'woocommerce' ), |
| 28 | ), |
| 29 | $customer_id |
| 30 | ); |
| 31 | } else { |
| 32 | $get_addresses = apply_filters( |
| 33 | 'woocommerce_my_account_get_addresses', |
| 34 | array( |
| 35 | 'billing' => __( 'Billing address', 'woocommerce' ), |
| 36 | ), |
| 37 | $customer_id |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | $oldcol = 1; |
| 42 | $col = 1; |
| 43 | ?> |
| 44 | |
| 45 | <p> |
| 46 | <?php echo apply_filters( 'woocommerce_my_account_my_address_description', esc_html__( 'The following addresses will be used on the checkout page by default.', 'woocommerce' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 47 | </p> |
| 48 | |
| 49 | <?php if ( ! wc_ship_to_billing_address_only() && wc_shipping_enabled() ) : ?> |
| 50 | <div class="u-columns woocommerce-Addresses col2-set addresses"> |
| 51 | <?php endif; ?> |
| 52 | |
| 53 | <?php foreach ( $get_addresses as $name => $address_title ) : ?> |
| 54 | <?php |
| 55 | $address = wc_get_account_formatted_address( $name ); |
| 56 | $col = $col * -1; |
| 57 | $oldcol = $oldcol * -1; |
| 58 | ?> |
| 59 | |
| 60 | <div class="u-column<?php echo $col < 0 ? 1 : 2; ?> col-<?php echo $oldcol < 0 ? 1 : 2; ?> woocommerce-Address"> |
| 61 | <header class="woocommerce-Address-title title"> |
| 62 | <h3><?php echo esc_html( $address_title ); ?></h3> |
| 63 | <a href="<?php echo esc_url( wc_get_endpoint_url( 'edit-address', $name ) ); ?>" class="edit"><?php echo $address ? esc_html__( 'Edit', 'woocommerce' ) : esc_html__( 'Add', 'woocommerce' ); ?></a> |
| 64 | </header> |
| 65 | <address> |
| 66 | <?php |
| 67 | echo $address ? wp_kses_post( $address ) : esc_html_e( 'You have not set up this type of address yet.', 'woocommerce' ); |
| 68 | ?> |
| 69 | </address> |
| 70 | </div> |
| 71 | |
| 72 | <?php endforeach; ?> |
| 73 | |
| 74 | <?php if ( ! wc_ship_to_billing_address_only() && wc_shipping_enabled() ) : ?> |
| 75 | </div> |
| 76 | <?php |
| 77 | endif; |
| 78 |