<?php
/**
 *	The template for displaying quickview product content
 */

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

global $post, $product, $nm_theme_options;

//$show_add_to_cart = ( $nm_theme_options['product_quickview_atc'] ) ? true : false;
//$show_details_button = ( $nm_theme_options['product_quickview_details_button'] ) ? true : false;

$class = 'product' . ' product-' . $product->product_type;

?>

<div id="product-<?php the_ID(); ?>" <?php post_class( $class ); ?>>
	<div class="nm-qv-product-image">
		<?php wc_get_template( 'quickview/product-image.php' ); ?>
	</div>
    
    <div class="nm-qv-summary">
        <div id="nm-qv-product-summary" class="product-summary">
            <div class="nm-qv-summary-top">
                <?php
					woocommerce_template_single_title();
					woocommerce_template_single_price();
                ?>
            </div>
            <div class="nm-qv-summary-content <?php echo esc_attr( $nm_theme_options['product_quickview_summary_layout'] ); ?>">
                <?php
					woocommerce_template_single_excerpt();
					woocommerce_template_single_rating();
				?>
                
                <?php
					$details_button_class = '';
					
					// Add-to-cart button
					if ( $nm_theme_options['product_quickview_atc'] ) {
						$details_button_class = ' border';
						
						woocommerce_template_single_add_to_cart();
					}
					
					// Details button
					if ( $nm_theme_options['product_quickview_details_button'] ) {
                		echo '<a href="' . esc_url( get_permalink( $product->id ) ) . '" class="nm-qv-details-button button' . esc_attr( $details_button_class ) . '">' . esc_html__( 'Details', 'nm-framework' ) . '</a>';
                	}
                ?>
                
				<?php woocommerce_template_single_sharing(); ?>
            </div>
        </div>
    </div>
</div>
