| 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 |
* @package WooCommerce\Templates |
| 15 |
* @version 3.6.0 |
| 16 |
* @global WC_Checkout $checkout |
| 17 |
*/ |
| 18 |
|
| 19 |
defined( 'ABSPATH' ) || exit; |
| 20 |
$hide_section_settings = \WPFunnels\Wpfnl_functions::get_checkout_section_heading_settings( 'billing' , get_the_ID() ); |
| 21 |
|
| 22 |
?> |
| 23 |
<div class="wpfnl-billing-fields woocommerce-billing-fields"> |
| 24 |
<?php if ( wc_ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?> |
| 25 |
<?php if( !$hide_section_settings || ( isset($hide_section_settings['custom_heading']) && $hide_section_settings['custom_heading'] != '' ) ) { ?> |
| 26 |
<h3> |
| 27 |
<?php |
| 28 |
if( isset($hide_section_settings['custom_heading']) && $hide_section_settings['custom_heading'] != '' ){ |
| 29 |
esc_html_e( $hide_section_settings['custom_heading'], 'woocommerce' ); |
| 30 |
}else{ |
| 31 |
esc_html_e( 'Billing & Shipping', 'woocommerce' ); |
| 32 |
} |
| 33 |
?> |
| 34 |
</h3> |
| 35 |
<?php } ?> |
| 36 |
<?php else : ?> |
| 37 |
|
| 38 |
<?php if( !$hide_section_settings || ( isset($hide_section_settings['custom_heading']) && $hide_section_settings['custom_heading'] != '' ) ) { ?> |
| 39 |
<h3> |
| 40 |
<?php |
| 41 |
if( isset($hide_section_settings['custom_heading']) && $hide_section_settings['custom_heading'] != '' ){ |
| 42 |
esc_html_e( $hide_section_settings['custom_heading'], 'woocommerce' ); |
| 43 |
}else{ |
| 44 |
esc_html_e( 'Billing details', 'woocommerce' ); |
| 45 |
} |
| 46 |
?> |
| 47 |
</h3> |
| 48 |
<?php } ?> |
| 49 |
|
| 50 |
<?php endif; ?> |
| 51 |
|
| 52 |
<?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?> |
| 53 |
|
| 54 |
<div class="woocommerce-billing-fields__field-wrapper"> |
| 55 |
<?php |
| 56 |
$fields = $checkout->get_checkout_fields( 'billing' ); |
| 57 |
|
| 58 |
foreach ( $fields as $key => $field ) { |
| 59 |
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); |
| 60 |
} |
| 61 |
?> |
| 62 |
</div> |
| 63 |
|
| 64 |
<?php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); ?> |
| 65 |
</div> |
| 66 |
|
| 67 |
<?php if ( ! is_user_logged_in() && $checkout->is_registration_enabled() ) : ?> |
| 68 |
<div class="woocommerce-account-fields"> |
| 69 |
<?php if ( ! $checkout->is_registration_required() ) : ?> |
| 70 |
|
| 71 |
<p class="form-row form-row-wide create-account"> |
| 72 |
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox"> |
| 73 |
<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 esc_html_e( 'Create an account?', 'woocommerce' ); ?></span> |
| 74 |
</label> |
| 75 |
</p> |
| 76 |
|
| 77 |
<?php endif; ?> |
| 78 |
|
| 79 |
<?php do_action( 'woocommerce_before_checkout_registration_form', $checkout ); ?> |
| 80 |
|
| 81 |
<?php if ( $checkout->get_checkout_fields( 'account' ) ) : ?> |
| 82 |
|
| 83 |
<div class="create-account"> |
| 84 |
<?php foreach ( $checkout->get_checkout_fields( 'account' ) as $key => $field ) : ?> |
| 85 |
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?> |
| 86 |
<?php endforeach; ?> |
| 87 |
<div class="clear"></div> |
| 88 |
</div> |
| 89 |
|
| 90 |
<?php endif; ?> |
| 91 |
|
| 92 |
<?php do_action( 'woocommerce_after_checkout_registration_form', $checkout ); ?> |
| 93 |
</div> |
| 94 |
<?php endif; ?> |
| 95 |
|