دکمه افزودن به سبد خرید در صفحه نتایج جستجو کار نمیکند.

m4jid

تازه وارد
با عرض سلام
دکمه افزودن به سبد خرید در صفحه نتایج جستجو کار نمیکند.
اینم کد صفحه نتایج جستجو
PHP:
<?php get_header();?>
<?php get_template_part('inc/page-header', 'page-header')?>
    <section id="primary" class="content-area">
        <main id="main" class="site-main">
            <div class="container">
                <?php if (have_posts()): ?>
                    <header class="page-header">
                        <p class="search__page__title">
                            <?php printf(esc_html__('نتایج جستجو شما: %s', 'hedinaz'), '<span>' . get_search_query() . '</span>'); ?>
                        </p>
                    </header>
                <div class="row">
                    <?php while (have_posts()): the_post();
                        get_template_part('inc/content', 'search');
                        endwhile;
                        the_posts_navigation();
                        else:
                        get_template_part('template-parts/content', 'none');
                        endif;
                        ?>
                </div>
            </div>
        </main><!-- #main -->
    </section><!-- #primary -->
<?php get_footer();?>

و اینم کدهای بخش content

کد:
<div class="col-lg-3">
    <div class="product__box">
        <a href="<?php the_permalink(); ?>">
            <div class="product__img">
                <?php if (has_post_thumbnail()) {
                    the_post_thumbnail('medium_product_img');
                } else { ?>
                    <img src="<?php bloginfo('template_url') ?>/images/noimage.jpg" alt="" />
                <?php } ?>
            </div>
        </a>
        <div class="product__category">
            <a href="#">موبایل</a>
            <a href="#">کالا دیجیتال</a>
        </div>
        <div class="product__title">
            <h2>
                <a href="<?php the_permalink(); ?>"><?php echo mb_strimwidth(get_the_title(), 0, 35, '...'); ?></a>
            </h2>
        </div>
        <div class="product__price">
            <?php woocommerce_template_loop_price() ?>
        </div>
        <div class="add__to__cart">
            <button type="submit" data-quantity="1" data-product_id="<?php echo $product->id; ?>" class="button alt ajax_add_to_cart add_to_cart_button product_type_simple">
                <i class="fal fa-shopping-cart"></i>
                <p>افزودن به سبد خرید</p>
            </button>
        </div>
    </div>
</div>
 
بالا