<?php
defined('ABSPATH') || exit;
global $product;
$product_id = $product->get_id()
?>
<div class="dej_var_product product-card card-1">

    <div class="main-bg"></div>
    <div class="image">
        <a href="<?php the_permalink() ?>"><?php dejavo_product_box_image() ?></a>
        <?php dej_product_labels($product_id, dej_options('show_dej_icon_label', true)); dejavo_simple_star_rating(); ?>
        <?php if (dejavo_contdown_timer()) { ?><div class="countdown_time" data-times="<?= dejavo_contdown_timer(); ?>"></div><?php } ?>
        <div class="shadow-product"></div>
    </div>

    <div class="info">
        <?php dejavo_variation() ?>
        <div class="price-box"><?php if ($product->is_on_sale()) {woocommerce_show_product_sale_flash();} else {echo '<div></div>';} woocommerce_template_loop_price(); ?></div>
        <?php  dejavo_product_sale_info();  ?>
        <h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
        <div class="list-icon">
            <ul class="icons">
                <?php echo sprintf('<li class="hint--top-left add-to-cart" aria-label="%s"><a href="%s" data-quantity="1" class="%s" %s><i class="dej-shopping-bag"></i></a></li>',
                    esc_html($product->add_to_cart_text()),
                    esc_url($product->add_to_cart_url()),
                    esc_attr(implode(' ', array_filter(array(
                        '', 'product_type_' . $product->get_type(),
                        $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
                        $product->supports('ajax_add_to_cart') ? 'ajax_add_to_cart' : '',
                    )))),
                    wc_implode_html_attributes(array(
                        'data-product_id' => $product_id,
                        'data-product_sku' => $product->get_sku(),
                        'aria-label' => $product->add_to_cart_description(),
                        'rel' => 'nofollow',
                    ))
                ); ?>
                <?php if (class_exists('DejavoWL')) { ?><li class="hint--top" aria-label="<?php _e('علاقه مندی', 'dejavo') ?>"><?= DejavoWL::wl_btn($product_id) ?></li>
                <?php } if (class_exists('DejavoCP')) { ?><li class="hint--top" aria-label="<?php _e('مقایسه', 'dejavo') ?>"><?= DejavoCP::cp_btn($product_id) ?></li>
                <?php } if (class_exists('DejavoQV')) { ?><li class="hint--top-right" aria-label="<?php _e('نمایش سریع', 'dejavo') ?>"><?= DejavoQV::qv_btn($product_id) ?></li><?php } ?>
            </ul>
        </div>
    </div>
</div>