| Server IP : 104.171.130.249 / Your IP : 216.73.216.146 Web Server : nginx/1.25.5 System : Linux 0dac65491b7e 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/themes/matreshka/woocommerce/checkout/ |
Upload File : |
<?php
/**
* Checkout billing information form - Matreshka Custom Template
*
* @package Matreshka
* @version 9.4.0
*/
defined( 'ABSPATH' ) || exit;
$is_pickup = WC()->session && 'pickup' === WC()->session->get( 'matreshka_shipping_type', 'delivery' );
?>
<div class="woocommerce-billing-fields">
<?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?>
<?php if ( $is_pickup ) : ?>
<div class="shipping-pickup-info pickup-store-selector">
<?php wc_get_template( 'cart/pickup-store-selector.php' ); ?>
</div>
<?php else : ?>
<?php
$fields = $checkout->get_checkout_fields( 'billing' );
foreach ( $fields as $key => $field ) {
// Пропускаємо поля країни та області, якщо не потрібні
if ( in_array( $key, array( 'billing_country', 'billing_state', 'billing_postcode', 'billing_city' ) ) ) {
continue;
}
// Спеціальна обробка для адреси
if ( $key === 'billing_address_1' ) {
?>
<div class="cart-product-checkout d-flex">
<div class="input-group address w-100">
<span class="input-group-text" id="address-icon">
<img src="<?php echo esc_url( get_template_directory_uri() . '/assets/icons/point.svg' ); ?>" alt="address icon">
</span>
<input
type="text"
class="input-address montserrat-medium form-control"
name="<?php echo esc_attr( $key ); ?>"
id="<?php echo esc_attr( $key ); ?>"
placeholder="<?php echo esc_attr( $field['placeholder'] ?? 'г. Луганск, Рязанский проспект, 58/1' ); ?>"
value="<?php echo esc_attr( $checkout->get_value( $key ) ); ?>"
<?php echo ! empty( $field['required'] ) ? 'required' : ''; ?>
>
</div>
</div>
<?php
continue;
}
// Телефон - пропускаємо, виведемо в правій колонці
if ( $key === 'billing_phone' ) {
continue;
}
// Адреса 2 - пропускаємо
if ( $key === 'billing_address_2' ) {
continue;
}
// Компанія - пропускаємо
if ( $key === 'billing_company' ) {
continue;
}
// Імʼя та прізвище можна пропустити або вивести
if ( in_array( $key, array( 'billing_first_name', 'billing_last_name', 'billing_email' ) ) ) {
// Виведемо пізніше або пропустимо
continue;
}
}
?>
<!-- Додаткові поля для підʼїзду та коду домофону -->
<div class="cart-product-checkout d-flex">
<div class="input-group me-1 me-md-2">
<label for="billing_entrance" class="form-label montserrat-medium">Подъезд</label>
<input
type="text"
class="montserrat-medium form-control"
name="billing_entrance"
id="billing_entrance"
value="<?php echo esc_attr( $checkout->get_value( 'billing_entrance' ) ); ?>"
placeholder=""
>
</div>
<div class="input-group ms-1 ms-md-2">
<label for="billing_intercom" class="form-label montserrat-medium">Код домофона</label>
<input
type="text"
class="montserrat-medium form-control"
name="billing_intercom"
id="billing_intercom"
value="<?php echo esc_attr( $checkout->get_value( 'billing_intercom' ) ); ?>"
placeholder=""
>
</div>
</div>
<!-- Поля для поверху та квартири -->
<div class="cart-product-checkout d-flex">
<div class="input-group me-1 me-md-2">
<label for="billing_floor" class="form-label montserrat-medium">Этаж</label>
<input
type="text"
class="montserrat-medium form-control"
name="billing_floor"
id="billing_floor"
value="<?php echo esc_attr( $checkout->get_value( 'billing_floor' ) ); ?>"
placeholder=""
>
</div>
<div class="input-group ms-1 ms-md-2">
<label for="billing_apartment" class="form-label montserrat-medium">Квартира/офис</label>
<input
type="text"
class="montserrat-medium form-control"
name="billing_apartment"
id="billing_apartment"
value="<?php echo esc_attr( $checkout->get_value( 'billing_apartment' ) ); ?>"
placeholder=""
>
</div>
</div>
<?php endif; ?>
<!-- Hidden required WC fields -->
<?php
$user_id = get_current_user_id();
$first_name = $checkout->get_value( 'billing_first_name' ) ?: ( $user_id ? get_user_meta( $user_id, 'billing_first_name', true ) : '' );
$last_name = $checkout->get_value( 'billing_last_name' ) ?: ( $user_id ? get_user_meta( $user_id, 'billing_last_name', true ) : '-' );
$email = $checkout->get_value( 'billing_email' ) ?: ( $user_id ? get_userdata( $user_id )->user_email : '' );
$country = $checkout->get_value( 'billing_country' ) ?: 'RU';
$city = $checkout->get_value( 'billing_city' ) ?: ( $user_id ? get_user_meta( $user_id, 'billing_city', true ) : '' );
$state = $checkout->get_value( 'billing_state' ) ?: ( $user_id ? get_user_meta( $user_id, 'billing_state', true ) : '' );
$postcode = $checkout->get_value( 'billing_postcode' ) ?: ( $user_id ? get_user_meta( $user_id, 'billing_postcode', true ) : '' );
?>
<input type="hidden" name="billing_first_name" value="<?php echo esc_attr( $first_name ?: '-' ); ?>">
<input type="hidden" name="billing_last_name" value="<?php echo esc_attr( $last_name ?: '-' ); ?>">
<input type="hidden" name="billing_email" value="<?php echo esc_attr( $email ); ?>">
<input type="hidden" name="billing_country" value="<?php echo esc_attr( $country ); ?>">
<input type="hidden" name="billing_city" value="<?php echo esc_attr( $city ?: '-' ); ?>">
<input type="hidden" name="billing_state" value="<?php echo esc_attr( $state ); ?>">
<input type="hidden" name="billing_postcode" value="<?php echo esc_attr( $postcode ?: '000000' ); ?>">
<?php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); ?>
</div>