single-product.php 17.3 KB
<?php get_header();?>
<?php $get_lang = isset($wp_query->query_vars['prisna_translate_seo_request'])?urldecode($wp_query->query_vars['prisna_translate_seo_request']):''; ?>
 <!-- index_advantage_icon -->
  <section class="index_advantage_container page_advantage_container">
    <ul class="advantage_items flex_row">
      <li class="advantage_item wow fadeInLeftA" data-wow-delay=".1s" data-wow-duration=".8s"> <a class="item_img"> <img src="<?php echo home_url("/"); ?>style/global/img/demo/ad_icon01.png" alt="" /> <img src="<?php echo home_url("/"); ?>style/global/img/demo/red_icon01.png" alt="" /></a> </li>
      <li class="advantage_item wow fadeInLeftA" data-wow-delay=".1s" data-wow-duration=".8s"> <a class="item_img"> <img src="<?php echo home_url("/"); ?>style/global/img/demo/ad_icon02.png" alt="" /> <img src="<?php echo home_url("/"); ?>style/global/img/demo/red_icon02.png" alt="" /></a> </li>
      <li class="advantage_item wow fadeInLeftA" data-wow-delay=".1s" data-wow-duration=".8s"> <a class="item_img"> <img src="<?php echo home_url("/"); ?>style/global/img/demo/ad_icon03.png" alt="" /> <img src="<?php echo home_url("/"); ?>style/global/img/demo/red_icon03.png" alt="" /></a> </li>
      <li class="advantage_item wow fadeInLeftA" data-wow-delay=".1s" data-wow-duration=".8s"> <a class="item_img"> <img src="<?php echo home_url("/"); ?>style/global/img/demo/ad_icon04.png" alt="" /> <img src="<?php echo home_url("/"); ?>style/global/img/demo/red_icon04.png" alt="" /></a> </li>
      <li class="advantage_item wow fadeInLeftA" data-wow-delay=".1s" data-wow-duration=".8s"> <a class="item_img"> <img src="<?php echo home_url("/"); ?>style/global/img/demo/ad_icon05.png" alt="" /> <img src="<?php echo home_url("/"); ?>style/global/img/demo/red_icon05.png" alt="" /></a> </li>
      <li class="advantage_item wow fadeInLeftA" data-wow-delay=".1s" data-wow-duration=".8s"> <a class="item_img"> <img src="<?php echo home_url("/"); ?>style/global/img/demo/ad_icon06.png" alt="" /> <img src="<?php echo home_url("/"); ?>style/global/img/demo/red_icon06.png" alt="" /></a> </li>
      <li class="advantage_item wow fadeInLeftA" data-wow-delay=".1s" data-wow-duration=".8s"> <a class="item_img"> <img src="<?php echo home_url("/"); ?>style/global/img/demo/ad_icon07.png" alt="" /> <img src="<?php echo home_url("/"); ?>style/global/img/demo/red_icon07.png" alt="" /></a> </li>
      <li class="advantage_item wow fadeInLeftA" data-wow-delay=".1s" data-wow-duration=".8s"> <a class="item_img"> <img src="<?php echo home_url("/"); ?>style/global/img/demo/ad_icon08.png" alt="" /> <img src="<?php echo home_url("/"); ?>style/global/img/demo/red_icon08.png" alt="" /></a> </li>
      <li class="advantage_item wow fadeInLeftA" data-wow-delay=".1s" data-wow-duration=".8s"> <a class="item_img"> <img src="<?php echo home_url("/"); ?>style/global/img/demo/ad_icon09.png" alt="" /> <img src="<?php echo home_url("/"); ?>style/global/img/demo/red_icon09.png" alt="" /></a> </li>
      <li class="advantage_item wow fadeInLeftA" data-wow-delay=".1s" data-wow-duration=".8s"> <a class="item_img"> <img src="<?php echo home_url("/"); ?>style/global/img/demo/ad_icon10.png" alt="" /> <img src="<?php echo home_url("/"); ?>style/global/img/demo/red_icon10.png" alt="" /></a> </li>
    </ul>
  </section>
  <!-- index_advantage_icon end --> 
   <!-- page-layout start -->
 <section class="web_main page_main">
  <div class="layout"> 
       <!-- product info -->
      <section class="product-intro">
        <div class="product-view" > 
          <!-- Piliang S-->
          <?php $images = get_field('product_gallery');
if( $images ):  foreach( $images as $key=>$image ):   
			if(!is_array($images[$key])){
				$eric_id = $image;
				$eric_urcs = wp_get_attachment_image_src($eric_id, $size='full');
				$eric_urc = $eric_urcs[0];
				$image = array(
					'id' => $eric_id, 
					'url' => $eric_urc, 
					'sizes' => array('thumbnail' => $eric_urc, )
					);
				$images[$key] = $image;
			}
if (!$image['sizes']['thumbnail']) $image['sizes']['thumbnail'] = $srcs[0];  endforeach; endif; ?>
          <!-- Piliang E-->
          <?php if( $images ): for($x=0;$x<1; $x++){ ?>
          <div class="product-image"> <a class="cloud-zoom" id="zoom1" data-zoom="adjustX:0, adjustY:0" href="<?php echo $images[0]['url']; ?>"> <img src="<?php echo $images[0]['url']; ?>" itemprop="image" title="" alt="<?php wp_title(); ?> Featured Image" style="width:100%" /></a> </div>
          <?php } endif; ?>
          <div class="image-additional-wrap">
            <div class="image-additional">
              <ul class="swiper-wrapper">
                <?php $i=1; if( $images ): foreach( $images as $image ):  ?>
                <li class="swiper-slide image-item <?php if($i==1) : ?>current<?php endif; ?>"> <a class="cloud-zoom-gallery item"  href="<?php echo $image['url']; ?>" data-zoom="useZoom:zoom1, smallImage:<?php echo $image['url']; ?>" title=""><img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php wp_title(); ?>" /></a> </li>
                <?php  $i++;  endforeach;endif; ?>
              </ul>
              <div class="swiper-pagination swiper-pagination-white"></div>
            </div>
            <div class="swiper-button-next swiper-button-white"></div>
            <div class="swiper-button-prev swiper-button-white"></div>
          </div>
        </div>
        <section class="product-summary">
		 <h2 class="page_title"><?php wp_title(); ?></h2> 
         <p class="page_subtit">Adjustable iPad Stand, Tablet Stand Holders。</p>		 
          <div class="product-meta">
            <p><?php the_field('short_description'); ?></p>
            <br />
            <?php if( get_field('是否调用通用属性') ){ ?>
            <?php query_posts(array( 'post_type' => 'pro_shuxing','showposts' => 1,'orderby' => 'post_date','order'=> 'DESC') );  while (have_posts()) : the_post();?>
            <?php if( have_rows('产品通用属性') ): ?>
            <?php while( have_rows('产品通用属性') ): the_row(); ?>
            <li><em><?php echo get_sub_field('标题'); ?>: </em> <?php echo get_sub_field('内容'); ?></li>
            <?php endwhile; ?>
            <?php endif; ?>
            <?php endwhile; wp_reset_query(); ?>
            <?php } ?>
            <?php if( have_rows('当前产品属性') ): ?>
            <?php while( have_rows('当前产品属性') ): the_row(); ?>
            <li><em><?php echo get_sub_field('标题'); ?>: </em> <?php echo get_sub_field('内容'); ?></li>
            <?php endwhile; ?>
            <?php endif; ?>
          </div>
          <div class="product-btn-wrap"> <a href="javascript:" onclick="showMsgPop();" class="email">Send email to us</a> <a href="<?php echo home_url("/"); ?>wp-content/plugins/down-as-pdf/generate.php?id=<?php the_ID(); ?>" target="_blank" rel="external nofollow"   class="pdf">Download as PDF</a> </div>
        
        </section>
      </section>
      <section class="tab-content-wrap product-detail">
        <div class="tab-title-bar detail-tabs">
          <h2 class="tab-title title current"><span>Product Detail</span></h2>

          <?php query_posts(array( 'post_type' => 'pro_detail','showposts' => 1,'orderby' => 'post_date','order'=> 'DESC') );  while (have_posts()) : the_post();?>
          <?php if( have_rows('pro_detail') ): ?>
          <?php while( have_rows('pro_detail') ): the_row(); ?>
          <h2 class="tab-title title"><span><?php echo get_sub_field('title'); ?></span></h2>
          <?php endwhile; ?>
          <?php endif; ?>
          <?php endwhile; wp_reset_query(); ?>
          <h2 class="tab-title title"><span>Product Tags</span></h2>
          <?php if( in_category('623') ) : ?>
          <h2 class="tab-title title"><span>Related Video</span></h2>
          <h2 class="tab-title title"><span>Feedback (2)</span></h2>
          <?php endif; ?>
        </div>
        <section class="tab-panel-wrap">
          <section class="tab-panel disabled entry">
            <section class="tab-panel-content">
              <?php if( in_category('623') ) : ?>
              <?php echo do_shortcode( '[rand_pre]' ); ?> <?php echo do_shortcode( '[rand_keywords]' ); ?>, <?php echo do_shortcode( '[rand_keywords]' ); ?>, <?php echo do_shortcode( '[rand_keywords]' ); ?>, <?php echo do_shortcode( '[rand_suffix]' ); ?>
              <hr>
              <?php wp_title(); ?>
              Detail: <br/>
              <br/>
              <?php endif; ?>
              <?php while ( have_posts() ) : the_post(); ?>
              <?php the_content(); ?>
              <?php endwhile; ?>
              <div class="clear"></div>
              <?php if( in_category('623') ) : ?>
              <hr>
              Product detail pictures:<br/>
              <br/>
              <?php 
if( $images ): ?>
              <?php foreach( $images as $image ): ?>
              <center>
                <a class="lightbox" href="<?php echo $image['url']; ?>"><img src="<?php echo $image['url']; ?>" alt="<?php wp_title(); ?> detail pictures"></a>
              </center>
              <br />
              <?php endforeach; ?>
              <?php endif; ?>
              <hr>
              Related Product Guide:<br/>
              <?php query_posts(array( 'post_type' => 'guide','showposts' => 2,'orderby' => 'rand') ); while (have_posts()) : the_post();?>
              <a href="<?php the_permalink() ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 500,"..."); ?></a><br/>
              <?php endwhile; wp_reset_query();?>
              <hr>
              <?php echo do_shortcode( '[rand_pre]' ); ?>
              <?php wp_title(); ?>
              , The product will supply to all over the world, such as: <?php echo do_shortcode( '[rand_country]' ); ?>, <?php echo do_shortcode( '[rand_country]' ); ?>, <?php echo do_shortcode( '[rand_country]' ); ?>, <?php echo do_shortcode( '[rand_l_suffix]' ); ?>
              <?php endif; ?>
              <?php if( get_field('yes_products_img') ){ ?>
              <hr>
              <?php 
if( $images ): ?>
              <?php foreach( $images as $image ): ?>
              <center>
                <a class="lightbox" href="<?php echo $image['url']; ?>"><img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>"></a>
              </center>
              <br />
              <?php endforeach; ?>
              <?php endif; ?>
              <?php } ?>
              <?php if( in_category('623') ) { ?>
              <?php } else { ?>
              <hr>
              <li><b>Previous:</b>
                <?php previous_post_link("%link") ?>
              </li>
              <li><b>Next:</b>
                <?php next_post_link("%link") ?>
              </li>
              <hr>
              <?php } ?>
            </section>
          </section>

          <?php query_posts(array( 'post_type' => 'pro_detail','showposts' => 1,'orderby' => 'post_date','order'=> 'DESC') );  while (have_posts()) : the_post();?>
          <?php if( have_rows('pro_detail') ): ?>
          <?php while( have_rows('pro_detail') ): the_row(); ?>
          <section class="tab-panel disabled entry">
            <section class="tab-panel-content"> <?php echo get_sub_field('text'); ?> </section>
          </section>
          <?php endwhile; ?>
          <?php endif; ?>
          <?php endwhile; wp_reset_query(); ?>
          <section class="tab-panel disabled entry">
            <section class="tab-panel-content">
              <?php the_tags(); ?>
            </section>
          </section>
          <?php if( in_category('623') ) : ?>
          <section class="tab-panel disabled entry">
            <section class="tab-panel-content">
              <?php query_posts(array( 'post_type' => 'vs','showposts' => 2,'orderby' => 'rand') ); while (have_posts()) : the_post();?>
              <?php echo apply_filters('the_content', $post->post_content); ?>
              <?php endwhile; wp_reset_query();?>
            </section>
          </section>
          <section class="tab-panel disabled entry">
            <section class="tab-panel-content"> <?php echo do_shortcode( '[rand_feedback]' ); ?> <br />
              <img src="<?php echo home_url("/"); ?>admin/img/star-icon.png" alt="5 Stars"> <span style="color:#cccccc">By <?php echo do_shortcode( '[rand_feedback_name]' ); ?> from <?php echo do_shortcode( '[rand_country]' ); ?> - <?php echo do_shortcode( '[rand_feedback_time]' ); ?></span>
              <hr>
              <?php echo do_shortcode( '[rand_feedback]' ); ?> <br />
              <img src="<?php echo home_url("/"); ?>admin/img/star-icon.png" alt="5 Stars"> <span style="color:#cccccc">By <?php echo do_shortcode( '[rand_feedback_name]' ); ?> from <?php echo do_shortcode( '[rand_country]' ); ?> - <?php echo do_shortcode( '[rand_feedback_time]' ); ?></span>
              <hr>
            </section>
          </section>
          <?php endif; ?>
        </section>
      </section>
        <!-- inquiry form -->
       <div class="inquiry-form-wrap">
         <script type="text/javascript" src="//www.globalso.site/form.js"></script>
          <div class="ad_prompt">Write your message here and send it to us</div>
        </div>
    </div>
    </section>
 
	
<div class="clear"></div>

 <!-- RELATED PRODUCTS -->
  <div class="goods-may-like">
    <div class="layout">
      <div class="index_title_bar">
        <div class="pagination_bar wow fadeInRightA">
          <div class="product-pagination swiper-pagination-white"></div>
          <span class="product_more"><a href="">see all</a></span> </div>
        <div class="navigate_bar wow fadeInRightA">
          <div class="navigate_button_next"></div>
          <div class="navigate_button_prev"></div>
        </div>
      </div>
      <div class="layer-bd">
        <div class="swiper-slider">
        <ul class="swiper-wrapper">
          <?php $post_objects = get_field('related_products'); if( $post_objects ): ?>
          <?php foreach( $post_objects as $post): ?>
          <?php setup_postdata($post);
$images = get_field('product_gallery');
if( $images ):  foreach( $images as $key=>$image ): 
			if(!is_array($images[$key])){
				$eric_id = $image;
				$eric_urcs = wp_get_attachment_image_src($eric_id, $size='full');
				$eric_urc = $eric_urcs[0];
				$image = array(
					'id' => $eric_id, 
					'url' => $eric_urc, 
					'sizes' => array('thumbnail' => $eric_urc, )
					);
				$images[$key] = $image;
			}
			if (!$image['sizes']['thumbnail']) $image['sizes']['thumbnail'] = $srcs[0];
endforeach;  endif;?> 
				<li class="swiper-slide wow fadeInUpA product_item" data-wow-delay=".1s">
					<figure>
						<span class="item_img">
							<img src="<?php if( $images ): for($x=0;$x<1; $x++){ ?><?php echo $images[0]['sizes']['thumbnail']; ?><?php } endif; ?>" alt="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 200,"..."); ?>">
							<a href="<?php the_permalink() ?>" title="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 300,""); ?>" class="img_shadow"></a>
						</span>
						<figcaption>
							<span class="model_subtit">e99447-cp</span>
							<h3 class="item_title"><a href="<?php the_permalink() ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 50,"..."); ?></a></h3>
							<a href="<?php the_permalink() ?>" class="feature_more"><span>see more</span></a>
						</figcaption>
					</figure>
				</li>
          <?php endforeach; ?>
          <?php wp_reset_postdata(); ?>
          <?php else: ?>
          <?php
global $post;
$cats = wp_get_post_categories($post->ID);
if ($cats) {
    $args = array(
          'category__in' => array( $cats[0] ),
          'post__not_in' => array( $post->ID ),
          'orderby' => 'rand', 
          'showposts' => 6,
          'caller_get_posts' => 1
      );
  query_posts($args);
  if (have_posts()) {
    while (have_posts()) {
      the_post(); update_post_caches($posts); 			
$images = get_field('product_gallery');
if( $images ):  foreach( $images as $key=>$image ): 
			if(!is_array($images[$key])){
				$eric_id = $image;
				$eric_urcs = wp_get_attachment_image_src($eric_id, $size='full');
				$eric_urc = $eric_urcs[0];
				$image = array(
					'id' => $eric_id, 
					'url' => $eric_urc, 
					'sizes' => array('thumbnail' => $eric_urc, )
					);
				$images[$key] = $image;
			}
			if (!$image['sizes']['thumbnail']) $image['sizes']['thumbnail'] = $srcs[0];
endforeach;  endif;?>
				<li class="swiper-slide wow fadeInUpA product_item" data-wow-delay=".1s">
					<figure>
						<span class="item_img">
							<img src="<?php if( $images ): for($x=0;$x<1; $x++){ ?><?php echo $images[0]['sizes']['thumbnail']; ?><?php } endif; ?>" alt="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 200,"..."); ?>">
							<a href="<?php the_permalink() ?>" title="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 300,""); ?>" class="img_shadow"></a>
						</span>
						<figcaption>
							<span class="model_subtit">e99447-cp</span>
							<h3 class="item_title"><a href="<?php the_permalink() ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 50,"..."); ?></a></h3>
							<a href="<?php the_permalink() ?>" class="feature_more"><span>see more</span></a>
						</figcaption>
					</figure>
				</li>
          <?php } } wp_reset_query(); } ?>
          <?php endif;?>
        </ul>
        </div>
     </div>
    </div>
  </div>
  

<?php get_footer();?>