cart; $count = $cart->get_cart_contents_count(); $total = $cart->get_total('raw'); // Числовая сумма $total_html = wc_cart_totals_order_total_html(); // Форматированная сумма wp_send_json_success([ 'contents' => $contents, 'footer' => $footer, 'count' => $count, 'total' => $total_html, 'total_raw' => $total ]); } add_action('template_redirect', 'custom_redirect_cart_page'); function custom_redirect_cart_page() { if (is_cart()) { wp_redirect(home_url('/')); exit; } } add_action('wp_enqueue_scripts', 'remove_woocommerce_styles_on_checkout', 9999); function remove_woocommerce_styles_on_checkout() { // Проверяем, что мы на странице чекаута if (function_exists('is_checkout') && is_checkout() && !is_order_received_page()) { wp_deregister_style('woocommerce-layout'); wp_deregister_style('woocommerce-smallscreen'); wp_deregister_style('woocommerce-general'); // Дополнительно: отключить другие стили WooCommerce wp_dequeue_style('select2'); wp_deregister_style('select2'); } } add_action('wp_head', 'custom_checkout_padding'); function custom_checkout_padding() { // Проверяем, что это страница Checkout if (is_checkout() && !is_admin()) { ?>