single-product.php 13.0 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']):''; ?>    	
 


		<nav class="path-bar">
              <ul class="path-nav">
             <li><?php if(function_exists('cmp_breadcrumbs')) cmp_breadcrumbs();?></li>
              </ul>
        </nav>
    
        <div id="loading"></div> 
            <section class="page-layout">
            <section class="layout">
    			 <!-- aside begin -->
<?php get_sidebar();?>
           <!--// aisde end -->
           
           <!-- main begin -->
           <section class="main" >
           	<section class="detail-wrap">
      
              <!-- product info -->
              <section class="product-intro">
              	 <h1 class="product-title"><?php wp_title(); ?></h1>

<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">
                <ul class="image-items">
                  
<?php $i=1; if( $images ): foreach( $images as $image ):  ?>
                    <li  class="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']; ?>"><img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php wp_title(); ?>" /></a></li>
<?php  $i++;  endforeach;endif; ?>
			 </ul>
            </div>
            
            
</div>
 
<section class="product-summary">


 <div class="product-meta">
                
                


<h3>Short Description:</h3>
<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="gm-sep 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>

<div class="share-this"><div class="addthis_sharing_toolbox"></div></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>	               
			 
 
		  			  			  
<section id="send-email" class="inquiry-form-wrap ct-inquiry-form"><script type="text/javascript" src="//www.globalso.site/form.js"></script></section>
<section class="goods-may-like">
 
                 <div class="goods-tbar"><h2 class="title">Related Products</h2></div>
                 <section class="goods-items-wrap">
                 	<section class="goods-items">
<?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;?>
	                      <div class="product-item">
	                        <div class="item-wrap">
          	                   <div class="pd-img">
							       <a href="<?php the_permalink() ?>" title="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 300,""); ?>"><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>
                               </div>
                               <div class="pd-info">
            	                    <h3 class="pd-name"><a href="<?php the_permalink() ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 50,"..."); ?></a></h3>
                               </div>
                            </div>
						 </div>  
			   
        <?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;?>	
		
	                      <div class="product-item">
	                        <div class="item-wrap">
          	                   <div class="pd-img">
							       <a href="<?php the_permalink() ?>" title="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 300,""); ?>"><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>
                               </div>
                               <div class="pd-info">
            	                    <h3 class="pd-name"><a href="<?php the_permalink() ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 50,"..."); ?></a></h3>
                               </div>
                            </div>
						 </div>  

<?php } } wp_reset_query(); } ?>
<?php endif;?>		

       </section>
         </section>   
              </section>   
           </section>  
           </section>
           <!--// main end -->
           <div class="clear"></div>
           </section>
           </section>
<?php get_footer();?>