<?php
/**
 * @see     https://docs.woocommerce.com/document/template-structure/
 * @author  WooThemes
 * @package WooCommerce/Templates
 * @version 8.6.0
 */
get_header(); ?>

<style>
    
    #woof_results_by_ajax .woocommerce-result-count {
	display: none;
}

#woof_results_by_ajax .woocommerce-ordering {
	display: none;
}




</style>

<div class="list-p-1">


<div class="size">
<div class="main-bak">
<div class="bak-mm">
<div class="bak-mm-1">
<a class="mobile-filter filter-open-mobile" style="display: none;"><i class="fi fi-rr-filter"></i></a>




<div class="mehrnoosh-header-shop-list-one-filter-remove">
<div id="filter-buttons-container">
</div>

<div id="filter-buttons-containertwo">
</div>
<button class="all-products-buttonone mehrnoosh-remove-filter-button"  onclick="removeOnSaleFilter()" style="display: none;"><i class="fi fi-rr-cross-small"></i> محصولات تخفیف دار</button>
<button class="all-products-button mehrnoosh-remove-filter-button " style="display: none;" onclick="removeInStockFilter()"><i class="fi fi-rr-cross-small"></i> محصولات موجود</button>

</div>
<h1 class="pro-head title-3"><?php woocommerce_page_title(); ?></h1>


<div class="farnam-count-delete">
			<?php
			
    woocommerce_result_count();

    woocommerce_catalog_ordering();
?></div>
</div></div>


<div class="bak-mm" style="padding: 0px;">
<div class="bak-mm-1 divwerfwerwe53443" style="padding: 0px;background: unset;box-shadow: unset;margin-top: 25px;">
<?php
if ( woocommerce_product_loop() ) {

remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );


	do_action( 'woocommerce_before_shop_loop' );

	woocommerce_product_loop_start();

	if ( wc_get_loop_prop( 'total' ) ) {
		while ( have_posts() ) {
			the_post();

			/**
			 * Hook: woocommerce_shop_loop.
			 *
			 * @hooked WC_Structured_Data::generate_product_data() - 10
			 */
			do_action( 'woocommerce_shop_loop' );

			wc_get_template_part( 'content', 'product' );
		}
	}

	woocommerce_product_loop_end();

	/**
	 * Hook: woocommerce_after_shop_loop.
	 *
	 * @hooked woocommerce_pagination - 10
	 */
	do_action( 'woocommerce_after_shop_loop' );
} else {
	/**
	 * Hook: woocommerce_no_products_found.
	 *
	 * @hooked wc_no_products_found - 10
	 */
echo'<div class="nomahsool">محصولی یافت نشد</div>';
    
}

/**
 * Hook: woocommerce_after_main_content.
 *
 * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
 */
do_action( 'woocommerce_after_main_content' );

/**
 * Hook: woocommerce_sidebar.
 *
 * @hooked woocommerce_get_sidebar - 10
 */
 ?>
 </div></div>


 <div class="main-side mehrnoosh-shop-nav-one" id="filterasli">
 <div class="close-btn-mehr-filter" style="display: none;">
<i class="fi fi-rr-cross-small"></i>
بستن فیلتر 
</div>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('filter') ) : ?>
      <?php endif; ?>
</div>
<?php					the_archive_description( '<div class="dakhel-meta-dec-s"><div class="taxonomy-description sdfsdrvvvv-444">', '</div></div>' );
				?>
</div></div></div>

<script>document.addEventListener("DOMContentLoaded", function () {
    // بررسی اولیه وجود عنصر 'woof_results_by_ajax'
    function checkAndHideElement() {
        const woofResults = document.querySelector(".woof_results_by_ajax");
        const farnamCountElement = document.querySelector(".farnam-count-delet");
        
        if (woofResults && farnamCountElement) {
            farnamCountElement.style.display = "none";
        }
    }

    // بررسی اولیه در هنگام بارگذاری صفحه
    checkAndHideElement();

    // در صورت تغییرات دینامیک (مثل AJAX)، تغییرات DOM را بررسی می‌کنیم
    const observer = new MutationObserver(checkAndHideElement);

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
});</script>
<?php get_footer();
