<?php
/**
 * Content Product Template
 *
 * @since      1.0.0
 * @author     WPBean
 * @global     $popup_data
 *
 * @package Finch Cart
 */

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

$product_class = apply_filters( 'finchcart_products_class', array( 'finchcart-modal-product', 'product' ) );
if ( isset( $popup_data['products_layout'] ) && 'slider' === $popup_data['products_layout'] ) {
	$product_class[] = 'swiper-slide';
}
?>

<div class="<?php echo esc_attr( implode( ' ', $product_class ) ); ?>">
	<?php

	if ( isset( $popup_data['show_product_image'] ) && true === $popup_data['show_product_image'] ) {
		echo '<div class="finchcart-modal-item-thumb">';
		woocommerce_template_loop_product_link_open();
		if ( 'list' !== $popup_data['products_layout'] ) {
			woocommerce_show_product_loop_sale_flash();
		}
		woocommerce_template_loop_product_thumbnail();
		woocommerce_template_loop_product_link_close();
		echo '</div>';
	}

		echo '<div class="finchcart-modal-item-content">';
		echo '<div class="finchcart-modal-item-info">';
	if ( isset( $popup_data['show_product_title'] ) && true === $popup_data['show_product_title'] ) {
		woocommerce_template_loop_product_link_open();
		woocommerce_template_loop_product_title();
		woocommerce_template_loop_product_link_close();
	}

	if ( isset( $popup_data['show_product_rating'] ) && true === $popup_data['show_product_rating'] ) {
		woocommerce_template_loop_rating();
	}

	if ( isset( $popup_data['show_product_price'] ) && true === $popup_data['show_product_price'] ) {
		woocommerce_template_loop_price();
	}
		echo '</div>';

	if ( isset( $popup_data['show_product_cart_btn'] ) && true === $popup_data['show_product_cart_btn'] ) {
		echo '<div class="finchcart-modal-item-cart">';
		woocommerce_template_loop_add_to_cart();
		echo '</div>';
	}
		echo '</div>';
	?>
</div>