<?php
/**
 * The Template for displaying all single products
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/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://woocommerce.com/document/template-structure/
 * @package     WooCommerce\Templates
 * @version     1.6.4
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
?>

<?php
$prefix = 'prefix_mihancode';
gt_set_post_view(); 
if(is_singular('product')){
 ?>
<?php get_header(); ?>
<?php $product_page_value = get_post_meta(get_the_ID() , $prefix. 'meta_product_page_select' , true); ?>
<?php if ($product_page_value == '' || $product_page_value == 'single_product_v1' ) {  ?>

<?php require_once 'template/single-product/single-product-v1/signle-product-style1.php'; ?>

<?php } elseif ($product_page_value == 'single_product_v2' ) { ?>
<?php require_once 'template/single-product/single-product-v2/signle-product-style2.php'; ?>

<?php } elseif ($product_page_value == 'single_product_v3' ) { ?>
<?php require_once 'template/single-product/single-product-v3/signle-product-style3.php'; ?>

<?php } elseif ($product_page_value == 'single_product_v4' ) { ?>
<?php require_once 'template/single-product/single-product-v4/signle-product-style4.php'; ?>

<?php } elseif ($product_page_value == 'single_product_download_v1' ) { ?>
<?php require_once 'template/single-product/single-product-download-v1/signle-product-download-style1.php'; ?>

<?php } elseif ($product_page_value == 'single_product_physical_v1' ) { ?>
<?php require_once 'template/single-product/single-product-physical-v1/signle-product-physical-style1.php'; ?>

<?php } else { ?>
<?php wc_print_notices(); ?>
<?php
        if (class_exists("\\Elementor\\Plugin")) {
            	the_post();
				
            $pluginElementor = \Elementor\Plugin::instance();
            $contentElementor = $pluginElementor->frontend->get_builder_content($product_page_value);
            echo '<div class="templatemaker-elementor"><div class="container">' . $contentElementor . '</div></div>';;

        }
?>

<?php } ?>


<?php get_footer(); ?>
<?php
}

?>
