<?php
/**
 * The Template for displaying all single products.
 *
 * @package Eronex
 * @since 0.0.1
 * @version 1.6.4
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

get_header();

$general_container   = eronex_option( 'eronex_container_layout', 'container' );
$product_container   = eronex_option( 'eronex_product_single_container_layout', $general_container );
$container           = ! empty( $product_container ) ? $product_container : $general_container;

$general_sidebar  = eronex_option( 'eronex_sidebar_layout', 'right' );
$product_sidebar  = eronex_option( 'eronex_product_single_sidebar_layout', 'none' );
$sidebar          = ! empty( $product_sidebar ) ? $product_sidebar : $general_sidebar;
?>
<div class="eronex-<?php echo esc_attr( $container ); ?>">
	<div class="eronex-row">
		<main class="eronex-main">
			<?php
			while ( have_posts() ) {
				the_post();
				wc_get_template_part( 'content', 'single-product' );
			}
			?>
		</main>
		<?php if ( 'none' !== $sidebar ) { ?>
			<aside class="eronex-aside eronex-aside-<?php echo esc_attr( $sidebar ); ?>">
				<?php
				/**
				 * Fires to output the sidebar markup.
				 *
				 * @since 0.0.1
				 */
				do_action( 'eronex_sidebar' );
				?>
			</aside>
		<?php } ?>
	</div>
</div>
<?php
get_footer();
