<?php
/**
 * The template for displaying product content within loops
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/content-product.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see     https://docs.woocommerce.com/document/template-structure/
 * @package WooCommerce\Templates
 * @version 3.6.0
 */

defined("ABSPATH") || exit();

global $product;

?>

<?php // Ensure visibility.

if (empty($product) || !$product->is_visible()) {
  return;
} ?>

<div <?php wc_product_class("content-product-wrap product-card", $product); ?>>
  <?php woocommerce_template_loop_product_link_open(); ?>
  <div class="content-product-thumbnail">
    <?php if (ESHOP_ENABLED && is_user_logged_in() && Inoby_Config::wishlist()) { Inoby_Product::wishlist(); } ?>
    <?php woocommerce_template_loop_product_thumbnail(); ?>
    <div class="tags">
      <?php
        Inoby_Product::product_special_badge();
        Inoby_Product::new_product_badge();
        if (ESHOP_ENABLED && Inoby_Config::b2b() && is_user_logged_in() && wc_current_user_has_role('b2b')) {} else {
          Inoby_Product::sale_badge_percentage();
        }
        ?>
    </div>
    <div class="product-thumbnail-footer">
      <?php Inoby_Product::product_color_variations(); ?>
      <div class="product-button"></div>
    </div>
  </div>
  <div class="content-product">
    <div class="content-product-title">
      <?php woocommerce_template_loop_product_title(); ?>
    </div>
    <div class="content-product-footer">
      <div class="content-product-price">
        <?php woocommerce_template_single_price(); ?>
      </div>
      <?= wc_get_stock_html($product); ?>
    </div>
  </div>
  <?php woocommerce_template_loop_product_link_close(); ?>
</div>