<?php
/**
 * The product page template.
 *
 */

get_header(); ?>
	
	<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
	
	<div id="container" class="full-float">
	
		<div class="content">
			
			<div class="content-area full-float pt-100 my-product-page">

				<div class="breadcrumbs">
		          <?php if(function_exists('bcn_display'))
		          {
		            echo "<div class='bc-col'>";
		            bcn_display();
		            echo "</div>";
		          }?>
		         </div>				
				
					<div class="cs-page">

						<div class="cs-page-left col-sm-3">
							<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Product Category Widget 1') ) :  endif; ?>
						</div>
	                
		                <div class="cs-page-right col-sm-9">

		                	<div class="col-sm-5">
		                		<div class="entry-featured full-float">
		                			<div class="product-img-wrapper">
									<?php 
										//$products_gallery = types_render_field("product-gallery", array("output"=>"html"));
										//echo $products_gallery;
									 ?>
									<?php 
										if ( has_post_thumbnail() ) {
											the_post_thumbnail('full');
										} 
										else {
											echo "<img src='" ;
											bloginfo('template_directory');
											echo "/images/no-img.jpg' width='238' height='265' />";
										}										
									?>	
								</div>
								</div>
		                	</div>
							
							<div class="entry-content">
								<div class="page-title">
									<h1 class="entry-title"><?php the_title(); ?></h1>
								</div>
								<div><?php the_content(); ?></div>
								<div class="my-price">
									<?php 
										$related_products = types_render_field("product-price", array("output"=>"html"));
										echo $related_products;
									 ?>
								</div>
								<?php echo do_shortcode('[wpmem_logged_out]<p class="sign-in-now"><a href="http://rediance.com.my/login/">Sign in to view Price</a></p>[/wpmem_logged_out]'); ?>
								<div class="dotted-line"></div>
								<div class="my-btn"><a href="<?php echo get_site_url(); ?>/contact-us">ENQUIRE NOW</a></div>
							</div>

							<div style="clear:both; height: 30px;"></div>
							
							<div>
								<div id="tabs" class="custom-product-tabs">
								  <ul>
								    <li><a href="#tabs-1">Description</a></li>
								    <li><a href="#tabs-2">Ingredients</a></li>
								  </ul>
								  <div id="tabs-1">
								    <?php 
										$related_products = types_render_field("product-description", array("output"=>"html"));
										echo $related_products;
									 ?>
								   </div>
								  <div id="tabs-2">
								    <?php 
										$related_products = types_render_field("ingredients", array("output"=>"html"));
										echo $related_products;
									 ?>
								  </div>
								</div>
							</div>
						</div>

					</div>

				<div style="clear:both; height: 30px;"></div>

				<div class="my-related-products">
					<!--<h2>Related Products</h2>
					<?php 
							//$related_products = types_render_field("related-products", array("output"=>"html"));
							//echo $related_products;
						 ?>
					<div class="view-more"><a href="<?php echo get_category_link(7); ?>">View More</a></div>-->
				</div>
                
			</div>
			
		</div><!-- .content -->

	</div><!-- #container -->
	
	<?php endwhile; // end of the loop. ?>
	<div>
		<?php //query_posts( 'cat=7&post_type=product' );?>
		<?php //query_posts( 'cat=7' ); ?>
	<?php 

		//if (isset($firstCategory)){
			//query_posts('cat=$firstCategory');
			//while (have_posts()) : the_post();
			//the_title();
			//endwhile;
		//}

	?>
</div>

<?php get_footer(); ?>
