>
'; echo '' . esc_attr($logo['alt']) . ''; echo ''; } ?>
menu_item_parent ? $item->menu_item_parent : 0; $menu_tree[$parent_id][] = $item; } function render_menu($parent_id, $menu_tree) { if (!isset($menu_tree[$parent_id])) { return; } echo ''; foreach ($menu_tree[$parent_id] as $item) { $has_children = isset($menu_tree[$item->ID]); $is_active = is_page($item->object_id) ? ' class="active"' : ''; echo '
  • '; echo '' . esc_html($item->title); if ($has_children) { echo ' '; } echo ''; if ($has_children) { render_menu($item->ID, $menu_tree); } echo '
  • '; } echo ''; } echo ''; } ?>
    ' . $phone . ''; } ?> ' . $email . ''; } ?>
    '; } ?> '; } ?>

    Товары в корзине (cart->get_cart_contents_count(); ?>)

    cart->get_cart_contents_count();?>
    cart->get_cart() as $cart_item ) : $product = $cart_item['data']; if ( ! $product || ! $product->exists() ) continue; // Получаем название товара без вариаций $product_name = $product->get_name(); if ( $product->is_type('variation') ) { $parent_product = wc_get_product( $cart_item['product_id'] ); if ( $parent_product ) { $product_name = $parent_product->get_name(); } } ?>
    <?php echo esc_attr( $product_name ); ?>
    (' . $cart_item['quantity'] . $unit . ')'; ?>
    get_regular_price(); $sale_price = $product->get_sale_price(); if ( $sale_price === '' ) { $sale_price = $regular_price; } $line_regular = $regular_price * $cart_item['quantity']; $line_sale = $sale_price * $cart_item['quantity']; if ( $line_regular > $line_sale ) { echo '

    ' . wc_price( $line_sale ) . ' ' . wc_price( $line_regular ) . '

    '; } else { echo '

    ' . wc_price( $line_sale ) . '

    '; } ?>

    Стоимость заказа:

    cart->get_cart() as $cart_item ) { $product = $cart_item['data']; if ( ! $product ) continue; $quantity = $cart_item['quantity']; $regular_price = $product->get_regular_price(); $sale_price = $product->get_sale_price(); if ( $sale_price === '' ) { $sale_price = $regular_price; } $regular_total += $regular_price * $quantity; $sale_total += $sale_price * $quantity; } // Применяем скидку от суммы заказа (порог проверяется по сумме СО скидками на товары) $cart_discount = function_exists('orgsteklo_calculate_cart_discount') ? orgsteklo_calculate_cart_discount( $sale_total ) : array( 'percent' => 0, 'amount' => 0 ); $final_total = $sale_total - $cart_discount['amount']; if ( $regular_total > $final_total ) { echo '

    ' . number_format($final_total, 0, ',', ' ') . ' ₽ ' . number_format($regular_total, 0, ',', ' ') . ' ₽

    '; } else { echo '

    ' . number_format($final_total, 0, ',', ' ') . ' ₽

    '; } ?>

    Перейти в корзину

    term_id : 0; $args = array( 'taxonomy' => 'product_cat', 'hide_empty' => false, 'parent' => $parent_id, 'exclude' => array($exclude_id), 'orderby' => 'menu_order', 'order' => 'ASC', ); $categories = get_terms($args); foreach ($categories as $category) { $child_args = array( 'taxonomy' => 'product_cat', 'hide_empty' => false, 'parent' => $category->term_id, ); $children = get_terms($child_args); $has_children = !empty($children); echo '
  • '; echo ''; echo ''; if ($has_children) { echo ''; } echo ''; if ($has_children) { echo ''; } echo '
  • '; } } ?>