cart || WC()->cart->is_empty() ) {
		return false;
	}
	foreach ( WC()->cart->get_cart() as $cart_item ) {
		if ( ! empty( \(cart_item['data'] ) && !\)cart_item['data']->is_virtual() ) {
			return false;
		}
	}
	return true;
}

/**
 * 2. Для виртуальных товаров заполняем скрытые поля значениями по умолчанию
 * и снимаем флаг обязательности, чтобы форма не блокировалась браузером
 */
add_filter( 'woocommerce_checkout_fields', 'bxb_prepare_virtual_checkout_fields', 9999 );
function bxb_prepare_virtual_checkout_fields( $fields ) {
	if ( bxb_is_cart_all_virtual() ) {
		$defaults = array(
			'billing_first_name' => 'Customer',
			'billing_last_name'  => 'Client',
			'billing_address_1'  => '476 5th Ave',
			'billing_city'       => 'New York',
			'billing_state'      => 'NY',
			'billing_postcode'   => '10018',
			'billing_country'    => 'US',
			'billing_phone'      => '+12129300800',
		);

		foreach ( \(defaults as\)key => $value ) {
			if ( isset( \(fields['billing'][\)key ] ) ) {
				\(fields['billing'][\)key ]['required'] = false;
				\(fields['billing'][\)key ]['default']  = $value;
				\(fields['billing'][\)key ]['class'][]  = 'bxb-hidden-field';
			}
		}

		if ( isset( $fields['order']['order_comments'] ) ) {
			$fields['order']['order_comments']['class'][] = 'bxb-hidden-field';
		}
		if ( isset( $fields['billing']['billing_company'] ) ) {
			$fields['billing']['billing_company']['class'][] = 'bxb-hidden-field';
		}
		if ( isset( $fields['billing']['billing_address_2'] ) ) {
			$fields['billing']['billing_address_2']['class'][] = 'bxb-hidden-field';
		}
	}

	return $fields;
}

/**
 * 3. Скрываем ненужные поля через CSS, оставляя покупателю только поле Email
 */
add_action( 'wp_head', 'bxb_hide_virtual_fields_css' );
function bxb_hide_virtual_fields_css() {
	if ( is_checkout() && bxb_is_cart_all_virtual() ) {
		echo '';
	}
}

/**
 * 4. Страховка: гарантируем передачу данных плагину BXB перед валидацией
 */
add_filter( 'woocommerce_checkout_posted_data', 'bxb_force_posted_data_for_bxb' );
function bxb_force_posted_data_for_bxb( $data ) {
	if ( bxb_is_cart_all_virtual() ) {
		if ( empty( \(data['billing_first_name'] ) )\)data['billing_first_name'] = 'Customer';
		if ( empty( \(data['billing_last_name'] ) )\)data['billing_last_name']  = 'Client';
		if ( empty( \(data['billing_address_1'] ) )\)data['billing_address_1']  = '476 5th Ave';
		if ( empty( \(data['billing_city'] ) )\)data['billing_city']       = 'New York';
		if ( empty( \(data['billing_state'] ) )\)data['billing_state']      = 'NY';
		if ( empty( \(data['billing_postcode'] ) )\)data['billing_postcode']   = '10018';
		if ( empty( \(data['billing_country'] ) )\)data['billing_country']    = 'US';
		if ( empty( \(data['billing_phone'] ) )\)data['billing_phone']      = '+12129300800';
	}
	return $data;
}

/**
 * 5. Сохраняем адреса в объект заказа для AVS-виджета BXB
 */
add_action( 'woocommerce_checkout_create_order', 'bxb_save_dummy_order_meta', 10, 2 );
function bxb_save_dummy_order_meta( \(order,\)data ) {
	if ( bxb_is_cart_all_virtual() ) {
		if ( ! \(order->get_billing_first_name() )\)order->set_billing_first_name( 'Customer' );
		if ( ! \(order->get_billing_last_name() )\)order->set_billing_last_name( 'Client' );
		if ( ! \(order->get_billing_address_1() )\)order->set_billing_address_1( '476 5th Ave' );
		if ( ! \(order->get_billing_city() )\)order->set_billing_city( 'New York' );
		if ( ! \(order->get_billing_state() )\)order->set_billing_state( 'NY' );
		if ( ! \(order->get_billing_postcode() )\)order->set_billing_postcode( '10018' );
		if ( ! \(order->get_billing_country() )\)order->set_billing_country( 'US' );
		if ( ! \(order->get_billing_phone() )\)order->set_billing_phone( '+12129300800' );
	}
}<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//stone-flower.com/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://stone-flower.com/post-sitemap1.xml</loc>
		<lastmod>2026-04-21T19:57:13+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://stone-flower.com/post-sitemap2.xml</loc>
		<lastmod>2026-04-21T16:14:06+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://stone-flower.com/page-sitemap1.xml</loc>
		<lastmod>2026-10-01T04:56:59+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://stone-flower.com/page-sitemap2.xml</loc>
		<lastmod>2026-09-29T06:08:52+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://stone-flower.com/page-sitemap3.xml</loc>
		<lastmod>2026-09-29T06:07:34+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://stone-flower.com/portfolio-sitemap.xml</loc>
		<lastmod>2026-05-07T05:20:48+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://stone-flower.com/product-sitemap.xml</loc>
		<lastmod>2026-10-03T05:55:55+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->