<?php
/**
 * @package SJ Ajax Tabs for HikaShop
 * @version 1.0.0
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @copyright (c) 2014 YouTech Company. All Rights Reserved.
 * @author YouTech Company http://www.smartaddons.com
 *
 */

defined('_JEXEC') or die;

?>
<div class="item-wrap ajaxtabs-item product-inner">
	<?php
	$img = HKAjaxtabsBaseHelper::getPHKImage($item, $params);
	if ($img || ((int)$params->get('display_add_to_cart',1) || (int)$params->get('display_add_to_wishlist',1) )):?>
		<div class="item-image">
			<a href="<?php echo $item->link; ?>"
			   title="<?php echo $item->title; ?>" <?php echo HKAjaxtabsBaseHelper::parseTarget($params->get('item_link_target', '_blank')); ?>>
				<?php echo HKAjaxtabsBaseHelper::imageTag($img); ?>
			</a>			
			<?php if((int)$params->get('display_add_to_cart',1) || (int)$params->get('display_add_to_wishlist',1) ) { ?>			
				<div class="addtocart-btn item-btn-add">			
					<?php  echo $btn_add;  ?>			
				</div>		
			<?php } ?>
	        <button type="button" class="quickview-btn" title="Quick View" aria-label="Quick View" onclick="openQuickView(&quot;<?php echo $item->link; ?>&quot;)"><i class="fa fa-eye" aria-hidden="true"></i></button>	
		</div>
	<?php endif; // image display ?>
	<div class="right-block">	
		<?php if ((int)$params->get('item_title_display', 1)): ?>
			<div class="item-title">
				<a href="<?php echo $item->link; ?>"
				   title="<?php echo $item->title; ?>" <?php echo HKAjaxtabsBaseHelper::parseTarget($params->get('item_link_target', '_blank')); ?>>
					<?php echo HKAjaxtabsBaseHelper::truncate($item->title, $params->get('item_title_max_characs', 20)); ?>
				</a>
			</div>
		<?php endif; // title display ?>

		<?php if((int)$params->get('display_votes',1)){ ?>
			<div class="item-votes">
            <span class="hikashop_product_vote"><div class="hikashop_vote_stars">
            	<input type="hidden" name="hikashop_vote_rating" data-votetype="product" data-max="5" data-ref="4" data-rate="<?php echo $hikashop_vote_average_score; ?>" data-original-title="No vote" id="select_id_<?php echo $item->id ?>_hikashop_ajax_tabs_module_" value="0" class="">

            	<span id="hikashop_vote_status_<?php echo $item->id ?>" class="hikashop_vote_notification_mini"></span>
            	<input type="hidden" class="hikashop_vote_rating" data-rate="0">
            </div>
            </span>													    
			</div>
		<?php } ?>
		
		<?php if ((int)$params->get('item_prices_display', 1) && !empty($item->_price)) { ?>
			<div class="item-prices">
					<span class="item-price">
						<?php echo $item->_price; ?>
					</span>
				<?php if ((int)$params->get('item_per_unit_display', 1)) { ?>
					<span class="item-per-unit">
						<?php echo JText::_('PER_UNIT'); ?>
					</span>
				<?php } ?>
			</div>
		<?php } ?>

		<?php if ((int)$params->get('item_desc_display', 1)): ?>
			<div class="item-description">
				<?php echo HKAjaxtabsBaseHelper::truncate($item->description, $params->get('item_desc_max_characs',100) ); ?>
			</div>
		<?php endif; // description display ?>
		
		<?php if ((int)$params->get('item_detail_display', 1)): ?>
			<div class="item-detail">
				<a href="<?php echo $item->link; ?>"
				   title="<?php echo $item->title; ?>" <?php echo HKAjaxtabsBaseHelper::parseTarget($params->get('item_link_target', '_blank')); ?>>
					<?php echo $params->get('item_detail_text', 'readmore'); ?>
				</a>
			</div>
		<?php endif; // readmore display ?>	</div>
        	

</div>

