| 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 |
|
| 21 |
// It can be shipping, billing and billing_only. |
| 22 |
$shipping_destination = get_option( 'woocommerce_ship_to_destination', true ); |
| 23 |
|
| 24 |
$is_billing = 'billing' === $shipping_destination; |
| 25 |
$is_billing_only = 'billing_only' === $shipping_destination; |
| 26 |
$hide_form_class = ''; |
| 27 |
|
| 28 |
if ( $is_billing_only ) { |
| 29 |
$hide_form_class = 'sellkit-hide-form-billing'; |
| 30 |
} |
| 31 |
?> |
| 32 |
<div class="woocommerce-billing-fields sellkit-one-page-checkout-billing sellkit-checkout-local-fields"> |
| 33 |
<h4 class="sellkit-one-page-checkout-billing-header heading"> |
| 34 |
<?php esc_html_e( 'Billing details', 'woocommerce' ); ?> |
| 35 |
</h4> |
| 36 |
<p class="billing-desc sub-heading"> |
| 37 |
<?php echo apply_filters( 'sellkit_core/widgets/checkout/custom_message/select_address_text', __( 'Select the address that matches your card or payment method.', 'sellkit' ) ); ?> |
| 38 |
</p> |
| 39 |
<?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?> |
| 40 |
|
| 41 |
<?php if ( WC()->cart->needs_shipping() ) : // Display this section just if we need to ship products. ?> |
| 42 |
|
| 43 |
<div class="billing-method" > |
| 44 |
<div> |
| 45 |
<label class="wrp method-a"> |
| 46 |
<input type="radio" value="same" name="billing-method" class="sellkit-billing-method-a" <?php checked( $is_billing || $is_billing_only ); ?> > |
| 47 |
<span class="checkmark"></span> |
| 48 |
<span class="labels"><?php echo esc_html__( 'Same as shipping address', 'sellkit' ); ?></span> |
| 49 |
</label> |
| 50 |
</div> |
| 51 |
<hr> |
| 52 |
<div> |
| 53 |
<label class="wrp method-b"> |
| 54 |
<input type="radio" value="diff" name="billing-method" class="sellkit-billing-method-b" <?php checked( ! $is_billing && ! $is_billing_only ); ?> > |
| 55 |
<span class="checkmark"></span> |
| 56 |
<span class="labels"><?php echo esc_html__( 'Use a different billing address', 'sellkit' ); ?></span> |
| 57 |
</label> |
| 58 |
</div> |
| 59 |
</div> |
| 60 |
|
| 61 |
<?php endif; ?> |
| 62 |
|
| 63 |
<?php |
| 64 |
$hide_billing_fields_class = ''; |
| 65 |
|
| 66 |
if ( $is_billing ) { |
| 67 |
$hide_billing_fields_class = 'hide-billing-fields-default'; |
| 68 |
} |
| 69 |
?> |
| 70 |
<div class="woocommerce-billing-fields__field-wrapper" id="sellkit-checkout-billing-field-wrapper"> |
| 71 |
<?php |
| 72 |
$fields = $checkout->get_checkout_fields( 'billing' ); |
| 73 |
|
| 74 |
do_action( 'sellkit_checkout_billing_fields', $fields, $checkout ); |
| 75 |
?> |
| 76 |
</div> |
| 77 |
|
| 78 |
<?php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); ?> |
| 79 |
<div class="sellkit-one-page-checkout-payment-desc sub-heading"> |
| 80 |
<?php wc_get_template( 'checkout/terms.php' ); ?> |
| 81 |
</div> |
| 82 |
</div> |
| 83 |
|