| 1 |
<?php |
| 2 |
/** |
| 3 |
* Checkout billing information form |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-billing.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.9 |
| 17 |
*/ |
| 18 |
|
| 19 |
if ( ! defined( 'ABSPATH' ) ) { |
| 20 |
exit; // Exit if accessed directly. |
| 21 |
} |
| 22 |
|
| 23 |
?> |
| 24 |
<div class="woocommerce-billing-fields"> |
| 25 |
<?php if ( wc_ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?> |
| 26 |
|
| 27 |
<h3><?php _e( 'Billing & Shipping', 'woocommerce' ); ?></h3> |
| 28 |
|
| 29 |
<?php else : ?> |
| 30 |
|
| 31 |
<h3><?php _e( 'Billing details', 'woocommerce' ); ?></h3> |
| 32 |
|
| 33 |
<?php endif; ?> |
| 34 |
|
| 35 |
<?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?> |
| 36 |
|
| 37 |
<div class="woocommerce-billing-fields__field-wrapper"> |
| 38 |
<?php |
| 39 |
$fields = $checkout->get_checkout_fields( 'billing' ); |
| 40 |
|
| 41 |
foreach ( $fields as $key => $field ) { |
| 42 |
if ( isset( $field['country_field'], $fields[ $field['country_field'] ] ) ) { |
| 43 |
$field['country'] = $checkout->get_value( $field['country_field'] ); |
| 44 |
} |
| 45 |
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); |
| 46 |
} |
| 47 |
?> |
| 48 |
</div> |
| 49 |
|
| 50 |
<?php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); ?> |
| 51 |
</div> |
| 52 |
|
| 53 |
<?php if ( ! is_user_logged_in() && $checkout->is_registration_enabled() ) : ?> |
| 54 |
<div class="woocommerce-account-fields"> |
| 55 |
<?php if ( ! $checkout->is_registration_required() ) : ?> |
| 56 |
|
| 57 |
<p class="form-row form-row-wide create-account"> |
| 58 |
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox"> |
| 59 |
<input class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true ); ?> type="checkbox" name="createaccount" value="1" /> <span><?php _e( 'Create an account?', 'woocommerce' ); ?></span> |
| 60 |
</label> |
| 61 |
</p> |
| 62 |
|
| 63 |
<?php endif; ?> |
| 64 |
|
| 65 |
<?php do_action( 'woocommerce_before_checkout_registration_form', $checkout ); ?> |
| 66 |
|
| 67 |
<?php if ( $checkout->get_checkout_fields( 'account' ) ) : ?> |
| 68 |
|
| 69 |
<div class="create-account"> |
| 70 |
<?php foreach ( $checkout->get_checkout_fields( 'account' ) as $key => $field ) : ?> |
| 71 |
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?> |
| 72 |
<?php endforeach; ?> |
| 73 |
<div class="clear"></div> |
| 74 |
</div> |
| 75 |
|
| 76 |
<?php endif; ?> |
| 77 |
|
| 78 |
<?php do_action( 'woocommerce_after_checkout_registration_form', $checkout ); ?> |
| 79 |
</div> |
| 80 |
<?php endif; ?> |
| 81 |
|