Woocommerce 3.0.0 Support

This commit is contained in:
Jason King 2017-04-14 20:25:49 +09:30 committed by GitHub
parent 27fd9d67f9
commit 8b31b6f7fb
1 changed files with 18 additions and 16 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/** /**
* Edit address form * Edit address form
* * Updated for Understrap to maintain Woocommerce 3.0.3 compatability.
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-edit-address.php. * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-edit-address.php.
* *
* HOWEVER, on occasion WooCommerce will need to update template files and you * HOWEVER, on occasion WooCommerce will need to update template files and you
@ -13,14 +13,14 @@
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes * @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 2.6.0 * @version 3.0.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
exit; exit;
} }
$page_title = ( $load_address === 'billing' ) ? __( 'Billing Address', 'understrap' ) : __( 'Shipping Address', 'understrap' ); $page_title = ( 'billing' === $load_address ) ? __( 'Billing address', 'understrap' ) : __( 'Shipping address', 'understrap' );
do_action( 'woocommerce_before_edit_account_address_form' ); ?> do_action( 'woocommerce_before_edit_account_address_form' ); ?>
@ -30,23 +30,25 @@ do_action( 'woocommerce_before_edit_account_address_form' ); ?>
<form method="post"> <form method="post">
<h3><?php echo apply_filters( 'woocommerce_my_account_edit_address_title', $page_title ); ?></h3> <h3><?php echo apply_filters( 'woocommerce_my_account_edit_address_title', $page_title, $load_address ); ?></h3>
<div class="woocommerce-address-fields">
<?php do_action( "woocommerce_before_edit_address_form_{$load_address}" ); ?> <?php do_action( "woocommerce_before_edit_address_form_{$load_address}" ); ?>
<div class="woocommerce-address-fields__field-wrapper">
<?php foreach ( $address as $key => $field ) : ?> <?php foreach ( $address as $key => $field ) : ?>
<?php woocommerce_form_field( $key, $field, ! empty( $_POST[ $key ] ) ? wc_clean( $_POST[ $key ] ) : $field['value'] ); ?> <?php woocommerce_form_field( $key, $field, ! empty( $_POST[ $key ] ) ? wc_clean( $_POST[ $key ] ) : $field['value'] ); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div>
<?php do_action( "woocommerce_after_edit_address_form_{$load_address}" ); ?> <?php do_action( "woocommerce_after_edit_address_form_{$load_address}" ); ?>
<p> <p>
<input type="submit" class="btn btn-outline-primary" name="save_address" value="<?php esc_attr_e( 'Save Address', 'understrap' ); ?>" /> <input type="submit" class="btn btn-outline-primary" name="save_address" value="<?php esc_attr_e( 'Save address', 'understrap' ); ?>" />
<?php wp_nonce_field( 'woocommerce-edit_address' ); ?> <?php wp_nonce_field( 'woocommerce-edit_address' ); ?>
<input type="hidden" name="action" value="edit_address" /> <input type="hidden" name="action" value="edit_address" />
</p> </p>
</div>
</form> </form>