<?php
$product = wc_get_product(get_the_ID());
$sale_price = $product->get_sale_price();
$normal_price = $product->get_regular_price();
$options = kaveh_get_options();
$woo_currency = get_woocommerce_currency_symbol();
$stocka = $product->get_stock_status();
?>

<div class="product-new-two d-flex flex-column">
    <div class="image-title h-100">
        <div class="image">
            <a href="<?php the_permalink(); ?>" class="d-block">
                <img src="<?php if (get_the_post_thumbnail_url()): ?>
            <?php the_post_thumbnail_url('full'); ?>
            <?php else: ?>
            <?php echo wc_placeholder_img_src(); ?>
            <?php endif; ?>" alt="<?php
$title = get_the_title();
$show_full_titles = kaveh_get_option('kaveh_product_title_display', false);
if ($show_full_titles) {
    echo esc_html($title);
} else {
    if ( wp_is_mobile() ) {
        echo wp_trim_words( $title, 5, '...' );
    } else {
        echo wp_trim_words( $title, 8, '...' );
    }
}
?>" width="243" height="240" class="d-block mx-auto w-100">
            </a>
        </div>
        <h2 class="title mb-0 overflow-hidden">
            <a href="<?php the_permalink(); ?>" class="d-block text-center"> <?php
$title = get_the_title();
if ( wp_is_mobile() ) {
    echo wp_trim_words( $title, 5, '...' );
} else {
    echo wp_trim_words( $title, 8, '...' );
}
?> </a>
        </h2>
    </div>
    <div class="btn-cart-price d-flex align-items-center">
        <a name="add-to-cart" value="<?php echo get_the_ID() ?>" href="<?php echo esc_url($product->add_to_cart_url()); ?>"
            class="single_add_to_cart_button add-to-cart d-flex align-items-center justify-content-center lh-1">
            <i class="icon-shopping-bag-3"></i>
        </a>
        <div class="price">
    <?php
        // Use WooCommerce's built-in price HTML output
        $price_html = $product->get_price_html();
        // If we have price HTML (not empty)
        if ($price_html) {
            echo $price_html;
        }
        ?>
    </div>
    </div>

</div>