<?php
/**
 * The template for displaying product content in the single-product.php template
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/content-single-product.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see     https://docs.woocommerce.com/document/template-structure/
 * @package WooCommerce/Templates
 * @version 3.6.0
 */

defined( 'ABSPATH' ) || exit;

global $product;

/**
 * Hook: woocommerce_before_single_product.
 *
 * @hooked wc_print_notices - 10
 */
do_action( 'woocommerce_before_single_product' );

if ( post_password_required() ) {
	echo get_the_password_form(); // WPCS: XSS ok.
	return;
}
?>
<div class="page-content col-xs-12 col-sm-7 col-md-8">
	<div class="row row-tb-20">
			<div class="col-xs-12">
				<div class="deal-deatails panel">
					<div class="deal-slider">
						<?php
						/**
						 * Hook: woocommerce_before_single_product_summary.
						 *
						 * @hooked woocommerce_show_product_sale_flash - 10
						 * @hooked woocommerce_show_product_images - 20
						 */
						do_action( 'woocommerce_before_single_product_summary' );
						?>
					</div>
					<div class="deal-body p-20">
						<?php
						/**
						 * Hook: woocommerce_single_product_summary.
						 *
						 * @hooked woocommerce_template_single_title - 5
						 * @hooked woocommerce_template_single_rating - 10
						 * @hooked woocommerce_template_single_price - 10
						 * @hooked woocommerce_template_single_excerpt - 20
						 * @hooked woocommerce_template_single_add_to_cart - 30
						 * @hooked woocommerce_template_single_meta - 40
						 * @hooked woocommerce_template_single_sharing - 50
						 * @hooked WC_Structured_Data::generate_product_data() - 60
						 */
						do_action( 'woocommerce_single_product_summary' );
						?>
					</div>
				</div>
			</div>
			<div class="col-xs-12">
				<?php
				/**
				 * Hook: woocommerce_after_single_product_summary.
				 *
				 * @hooked woocommerce_output_product_data_tabs - 10
				 * @hooked woocommerce_upsell_display - 15
				 * @hooked woocommerce_output_related_products - 20
				 */
				do_action( 'woocommerce_after_single_product_summary' );
				?>
			</div>
	</div>
</div>
<div class="page-sidebar col-md-4 col-sm-5 col-xs-12">
	<aside class="sidebar blog-sidebar">
		<div class="row row-tb-10">
			<div class="col-xs-12">
				<div class="widget single-deal-widget panel ptb-30 prl-20">
					<div class="widget-body text-center">
						<h2 class="mb-20 h3">
						<?php the_title(); ?>
						</h2>
						<?php if(function_exists('klbshortcode')) { ?>
						<ul class="deal-meta list-inline mb-10 color-mid">
							<li><i class="ico fa fa-globe mr-10"></i><a href="<?php echo esc_url(froday_store_link()); ?>" class="color-mid"><?php echo froday_store_title(); ?></a>
							</li>
							<?php echo froday_location_name(); ?>
						</ul>
						<?php } ?>
						<p class="color-muted">
							<?php echo froday_sanitize_data(froday_limit_words(get_the_excerpt(), '11')); ?>
						</p>
						<div class="price mb-20">
							<?php $productm = new WC_Product(get_the_ID()); ?>
							<h2 class="price"><?php echo froday_sanitize_data($productm->get_price_html()); ?></h2>
						</div>
						<div class="buy-now mb-40">
						<?php do_action( 'extra_woocommerce_single' ); ?>
						</div>
						<?php if(get_post_meta( $id, '_sale_price_dates_to', true )){ ?>
							<?php 
							wp_enqueue_script('froday-countdown-shop');
							wp_localize_script('froday-countdown-shop', 'translate' , 
							array( 
								'enable' => ot_get_option('froday_translate_enable_countdown'),
								'week' => ot_get_option('froday_translate_week_countdown'),
								'weeks' => ot_get_option('froday_translate_weeks_plural_countdown'),
								'day' => ot_get_option('froday_translate_day_countdown'),
								'days' => ot_get_option('froday_translate_days_plural_countdown'),
								'expired' => ot_get_option('froday_translate_expired_countdown'),

							));
							?>
							<div class="time-left mb-30">
							<p class="t-uppercase color-muted">
								<?php esc_html_e('Hurry up Only a few deals left','froday'); ?>
							</p>
							<div class="color-mid font-14 font-lg-16">
								<?php $sale_price_dates_to    = ( $date = get_post_meta( $id, '_sale_price_dates_to', true ) ) ? date_i18n( 'Y/m/d', $date ) : ''; ?>
								
								<i class="ico fa fa-clock-o mr-10"></i>
								<span data-countdown="<?php echo esc_attr($sale_price_dates_to); ?>"></span>
							</div>
						</div>
						<?php } ?>
						<?php if(ot_get_option('froday_shop_single_share') == 'on'){ ?>
							<?php  
								$att=get_post_thumbnail_id();
								$image_src = wp_get_attachment_image_src( $att, 'full' );
								$image_src = $image_src[0]; 
							?>
							<ul class="list-inline social-icons social-icons--colored t-center">
								<li class="social-icons__item">
									<a class="socialite" href="https://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>" rel="nofollow" target="_blank" data-href="<?php get_the_permalink(); ?>" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false"><i class="fa fa-facebook"></i></a>
								</li>
								<li class="social-icons__item">
									<a class="socialite" href="http://www.twitter.com/intent/tweet?url=<?php the_permalink(); ?>&text=<?php the_title(); ?>" rel="nofollow"  data-text="<?php get_the_title(); ?>" data-url="<?php get_the_permalink(); ?>"><i class="fa fa-twitter"></i></a>
								</li>
								<li class="social-icons__item">
									<a class="socialite" href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>;media=<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { ?><?php echo esc_url($image_src); ?><?php } ?>;description=<?php the_title(); ?>"><i class="fa fa-pinterest"></i></a>
								</li>
								<li class="social-icons__item">
									<a class="socialite" href="https://plus.google.com/share?url=<?php the_permalink(); ?>"><i class="fa fa-google-plus"></i></a>
								</li>
							</ul>
						<?php } ?>
					</div>
				</div>
			</div>
			<?php if ( is_active_sidebar( 'shop-sidebar' ) ) { ?>
			  
				 <?php dynamic_sidebar( 'shop-sidebar' ); ?>
			<?php } ?> 
		</div>
	
	
	</aside>
</div>

<?php do_action( 'woocommerce_after_single_product' ); ?>
