<?php $kproduct = get_query_var('kproduct'); ?>
<?php $woo_currency = get_woocommerce_currency_symbol(); ?>
<div class="product product-ten gradient">
<div class="product-image">
<?php if ( is_plugin_active( 'woo-smart-compare/wpc-smart-compare.php' ) ): ?>
<?php echo do_shortcode( '[woosc id="".<?php echo get_the_ID(); ?>.""]' );  ?>
<?php endif; ?>
<?php if($kproduct['kaveh_custom']['product_stock_status'] === 'outofstock'): ?>
<div class="status">
ناموجود
</div>
<?php endif; ?>
<a href="<?php echo $kproduct['link'] ?>">
<img src="<?php echo $kproduct['kaveh_custom']['thumbnail_url'] ?>" alt="<?php echo $kproduct['title']['rendered']; ?>">
</a>
</div>
<div class="detail">
<?php if($kproduct['kaveh_custom']['product_stock_status'] !== 'outofstock'): ?>
<?php if($kproduct['kaveh_custom']['product_type'] !== 'variable'): ?>
<?php if ( $kproduct['kaveh_custom']['is_on_sale'] === true ): ?>
<div class="offer">
<?php if(!empty($kproduct['kaveh_custom']['normal_price'])): ?>
<?php echo number_format($kproduct['kaveh_custom']['normal_price'], 0, '.', ','); ?>
<?php endif; ?>
</div>
<div class="price">
<?php if(!empty($kproduct['kaveh_custom']['sale_price'])): ?>
    <?php echo number_format($kproduct['kaveh_custom']['sale_price'], 0, '.', ','); ?>
<?php endif; ?>
<span> <?php echo $woo_currency; ?> </span>
</div>
<?php else: ?>
<div class="price nor10p">
<?php if(!empty($kproduct['kaveh_custom']['normal_price'])): ?>
<?php echo number_format($kproduct['kaveh_custom']['normal_price'], 0, '.', ','); ?>
<?php endif; ?>
<span> <?php echo $woo_currency; ?></span>
</div>
<?php endif; ?>
<?php else: ?>
<div class="price nor10p">
<?php if($kproduct['kaveh_custom']['min_regular_price'] !== $kproduct['kaveh_custom']['max_regular_price']): ?>
    <?php if(!empty($kproduct['kaveh_custom']['min_regular_price'])): ?>
    <?php echo number_format($kproduct['kaveh_custom']['min_regular_price'], 0, '.', ',') . ' - ' . number_format($kproduct['kaveh_custom']['max_regular_price'], 0, '.', ',') . ' '; ?>
<?php endif; ?>
<?php else: ?>
    <?php if(!empty($kproduct['kaveh_custom']['min_regular_price'])): ?>
    <?php echo number_format($kproduct['kaveh_custom']['min_regular_price'], 0, '.', ',')  . ' '; ?>
<?php endif; ?>
<?php endif; ?>
<span> <?php echo $woo_currency; ?></span>
</div>
<?php endif; ?>
<?php else: ?>
<div class="mt-p10"></div>
<?php endif; ?>
<?php if(empty($kproduct['kaveh_custom']['min_regular_price']) ): ?>
<div class="mt-p101"></div>
<?php endif; ?>
<h2>
<a href="<?php echo $kproduct['link'] ?>"> <?php echo $kproduct['title']['rendered']; ?></a>
</h2>
<?php if(empty($kproduct['kaveh_custom']['min_regular_price']) ): ?>
    <?php if($kproduct['kaveh_custom']['product_stock_status'] !== 'outofstock'): ?>
        <button type="button" class="add-to-cart single_add_to_cart_button position-relative cart11" value="<?php echo $kproduct['id']; ?>">
        <span> + </span>
        <span> افزودن به سبد خرید </span>
        </button>
    <?php endif; ?>
<?php endif; ?>
</div>
</div>
