HEX
Server: Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 mod_fcgid/2.3.9 PHP/5.4.16
System: Linux dvm.vladweb.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: region-gk.ru (1016)
PHP: 7.3.33
Disabled: NONE
Upload Files
File: /home/region-gk.ru/data/www/region-gk.ru/wp-content/themes/region/woocommerce/single-product.php
<?php
get_header();

the_post();
global $product;

?>

    <div class="breadcrumbs">
        <div class="container">
            <ul class="breadcrumbs__list" itemscope itemtype="http://schema.org/BreadcrumbList">
				<?php if ( function_exists( 'bcn_display_list' ) ) {
					bcn_display_list();
				} ?>
            </ul>
        </div>
    </div>

    <section class="product-card">
        <div class="container">
            <div class="product-card__image">
				<?php if ( get_the_post_thumbnail_url( '', 'full' ) ) { ?>
                    <a href="<?php echo get_the_post_thumbnail_url( '', 'medium' ); ?>"
                       class="product-card__image_full">
                        <img class="product-card__img" src="<?php echo get_the_post_thumbnail_url( '', 'full' ); ?>"
                             alt="<?php echo get_the_title(); ?> - 1"/>
                    </a>
				<?php } ?>
				<?php $attachment_ids = $product->get_gallery_image_ids(); ?>
                <ul class="product-card__image-list">
					<?php $num = 1; ?>
					<?php foreach ( $attachment_ids as $attachment_id ) { ?>
						<?php $num ++; ?>
                        <li class="product-card__image-item product-card__image-item_active">
                            <a href="<?php echo wp_get_attachment_url( $attachment_id ); ?>"><img
                                        src="<?php echo wp_get_attachment_image_src( $attachment_id, 'thumbnail' )[0]; ?>"
                                        alt="<?php echo get_the_title(); ?> - <?php echo $num; ?>"/></a>
                        </li>
					<?php } ?>
                </ul>
            </div>
            <div class="product-card__info">
                <h1 class="product-card__info-title">
					<?php echo get_the_title(); ?>
                </h1>
				<?php echo wpautop( get_the_content() ); ?>
				<?php if (get_field('size')) : ?>
				<div style="margin-bottom: 30px; line-height: 35px;">
				    <div>Размер: <?php the_field('size'); ?> мм.</div>
    				<div>Марка: <?php the_field('marka'); ?></div>
    				<div>ГОСТ/ТУ: <?php the_field('gost'); ?></div>
				</div>
				<?php endif; ?>
                <button class="product-card__info-btn">Рассчитать стоимость</button>
            </div>
        </div>
    </section>

    <section class="product-tabs">
        <div class="container">
            <ul class="product-tabs__list">
                <li class="product-tabs__item product-tabs__item_active">
                    <a href="#">Описание</a>
                </li>
                <li class="product-tabs__item"><a href="#">Характеристики</a></li>
                <li class="product-tabs__item"><a href="#">Где используются</a></li>
            </ul>
            <div class="product-tabs__content">
                <div class="product-tabs__content-item product-tabs__content-item_active">
					<?php echo wpautop( get_post_meta( $post->ID, '_custom_desc', true ) ); ?>
                </div>
                <div class="product-tabs__content-item">
					<?php echo wpautop( get_post_meta( $post->ID, '_custom_desc2', true ) ); ?>
                </div>
                <div class="product-tabs__content-item">
					<?php echo wpautop( get_post_meta( $post->ID, '_custom_desc3', true ) ); ?>
                </div>
            </div>
        </div>
    </section>

<?php

$crosssell_ids = get_post_meta( get_the_ID(), '_crosssell_ids' );
$crosssell_ids = $crosssell_ids[0];

if ( count( $crosssell_ids ) > 0 ) {

	$args = array(
		'post_type'           => 'product',
		'ignore_sticky_posts' => 1,
		'no_found_rows'       => 1,
		'posts_per_page'      => apply_filters( 'woocommerce_cross_sells_total', $posts_per_page ),
		'orderby'             => $orderby,
		'post__in'            => $crosssell_ids
	);

	$products = new WP_Query( $args );

	$woocommerce_loop['columns'] = apply_filters( 'woocommerce_cross_sells_columns', $columns );

	if ( $products->have_posts() ) : ?>

        <section class="product-related">
            <div class="container">
                <div class="product-related__title">С этим товаром покупают</div>
                <div class="product-related__list">
                    <div class="swiper-wrapper">

						<?php while ( $products->have_posts() ) : $products->the_post(); ?>

                            <a class="product swiper-slide" href="<?php echo the_permalink(); ?>">
                                <div class="product__image"><img
                                            src="<?php echo get_the_post_thumbnail_url( '', 'medium' ); ?>"
                                            alt="image-product"/></div>
                                <div class="product__title"><?php echo get_the_title(); ?></div>
                                <div class="product__details">Подробнее</div>
                            </a>

						<?php endwhile; // end of the loop. ?>

                    </div>
                </div>
                <button class="product-related__btn-prev"></button>
                <button class="product-related__btn-next"></button>
            </div>
        </section>

	<?php endif;

} else {
	woocommerce_output_related_products();
}

wp_reset_query(); ?>

<?php get_footer(); ?>