Wrap billing and shipping fields with a div/class Closes #4758

This commit is contained in:
Mike Jolley 2014-02-13 10:22:21 +00:00 committed by Coen Jacobs
parent c19ae08099
commit e81c3abacc
2 changed files with 81 additions and 83 deletions

View File

@ -4,35 +4,33 @@
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
* @version 2.1.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
?>
<?php if ( WC()->cart->ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?>
<div class="woocommerce-billing-fields">
<?php if ( WC()->cart->ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?>
<h3><?php _e( 'Billing &amp; Shipping', 'woocommerce' ); ?></h3>
<?php else : ?>
<?php else : ?>
<h3><?php _e( 'Billing Address', 'woocommerce' ); ?></h3>
<?php endif; ?>
<?php endif; ?>
<?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?>
<?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?>
<?php foreach ( $checkout->checkout_fields['billing'] as $key => $field ) : ?>
<?php foreach ( $checkout->checkout_fields['billing'] as $key => $field ) : ?>
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php do_action('woocommerce_after_checkout_billing_form', $checkout ); ?>
<?php do_action('woocommerce_after_checkout_billing_form', $checkout ); ?>
<?php if ( ! is_user_logged_in() && $checkout->enable_signup ) : ?>
<?php if ( ! is_user_logged_in() && $checkout->enable_signup ) : ?>
<?php if ( $checkout->enable_guest_checkout ) : ?>
@ -64,4 +62,5 @@ global $woocommerce;
<?php do_action( 'woocommerce_after_checkout_registration_form', $checkout ); ?>
<?php endif; ?>
<?php endif; ?>
</div>

View File

@ -4,15 +4,13 @@
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
* @version 2.1.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
?>
<?php if ( WC()->cart->needs_shipping() && ! WC()->cart->ship_to_billing_address_only() ) : ?>
<div class="woocommerce-shipping-fields">
<?php if ( WC()->cart->needs_shipping() && ! WC()->cart->ship_to_billing_address_only() ) : ?>
<?php
if ( empty( $_POST ) ) {
@ -46,11 +44,11 @@ global $woocommerce;
</div>
<?php endif; ?>
<?php endif; ?>
<?php do_action( 'woocommerce_before_order_notes', $checkout ); ?>
<?php do_action( 'woocommerce_before_order_notes', $checkout ); ?>
<?php if ( apply_filters( 'woocommerce_enable_order_notes_field', get_option( 'woocommerce_enable_order_comments', 'yes' ) === 'yes' ) ) : ?>
<?php if ( apply_filters( 'woocommerce_enable_order_notes_field', get_option( 'woocommerce_enable_order_comments', 'yes' ) === 'yes' ) ) : ?>
<?php if ( ! WC()->cart->needs_shipping() || WC()->cart->ship_to_billing_address_only() ) : ?>
@ -64,6 +62,7 @@ global $woocommerce;
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php do_action( 'woocommerce_after_order_notes', $checkout ); ?>
<?php do_action( 'woocommerce_after_order_notes', $checkout ); ?>
</div>