Woocommerce Products: Slider and add to cart not working on infinite scrolling

I created a customized add to cart button and I’m using slider so the user can slide the product images directly from the archive page
everything is working just fine, but the newly displayed products in the scrolling, the slider and the add to cart button not working on them
please take a look on my codebase

content-product.php

 <?php
/**
 * The template for displaying product content within loops
 *
 * @package WooCommerce/Templates
 * @version 3.6.0
 */

defined( 'ABSPATH' ) || exit;

global $product;

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

<section <?php wc_product_class( 'product', $product ); ?> data-product_id="<?php echo esc_attr($product->get_id()); ?>">
    <div class="product-wrapper">
        <?php do_action( 'woocommerce_before_shop_loop_item' ); ?>

        <div class="thumbnail-wrapper">
            <a href="<?php the_permalink(); ?>">
                <div class="swiper-container">
                    <div class="swiper-wrapper">
                        <?php
                        
                        echo '<div class="swiper-slide">' . woocommerce_get_product_thumbnail() . '</div>';
                        
                       
                        $product = wc_get_product( get_the_ID() );
                        $gallery_image_ids = $product->get_gallery_image_ids();
                        
                        if ( ! empty( $gallery_image_ids ) ) {
                            foreach ( $gallery_image_ids as $image_id ) {
                                $image_url = wp_get_attachment_url( $image_id ); 
                                echo '<div class="swiper-slide"><img src="' . esc_url( $image_url ) . '" alt="Product Image" /></div>';
                            }
                        }
                        ?>
                    </div>
                </div>
            </a>
            
            <?php
                
                do_action( 'woocommerce_shop_loop_item_title' );
                do_action( 'woocommerce_after_shop_loop_item_title' );
            ?>
        
        </div>
        
        <?php if ( $product->is_type( 'variable' ) ) : ?>
        <div class="add-to-cart-wrapper">
            <?php woocommerce_template_loop_add_to_cart(); ?>
        </div>
        <?php else : ?>
        <div class="add-to-cart-wrapper">
            <form class="custom-add-to-cart-form" data-product_id="<?php echo esc_attr( $product->get_id() ); ?>">
                <input type="hidden" name="product_id" value="<?php echo esc_attr( $product->get_id() ); ?>">
                <!-- Add extra options here -->
                <button type="submit" class="button">Add to Cart</button>
            </form>
            
        </div>
        <?php endif; ?>
    </div>
    <div class="meta-wrapper">
        <?php
        $terms = get_the_terms( $product->get_id(), 'product_cat' );
        $first_sub_category = '';

        if ( $terms && ! is_wp_error( $terms ) ) {
            foreach ( $terms as $term ) {
                if ( $term->parent != 0 ) { 
                    $first_sub_category = $term; 
                    break; 
                }
            }
        }

        if ( ! empty( $first_sub_category ) ) {
            
            $link = get_term_link( $first_sub_category );
            echo '<span class="posted_in"><a href="' . esc_url( $link ) . '">' . esc_html( $first_sub_category->name ) . '</a></span>';
        }
        ?>
        <?php do_action( 'woocommerce_after_shop_loop_item' ); ?>
    </div>
</section>

custom-ajax-add-to-cart.js

jQuery(document).ready(function($) {
    $('.custom-add-to-cart-form').on('submit', function(e) {
        e.preventDefault();
        
        var $form = $(this);
        var product_id = $form.data('product_id');
        
        $.ajax({
            type: 'POST',
            url: custom_ajax_object.ajax_url,
            data: {
                action: 'custom_add_to_cart',
                product_id: product_id
            },
            success: function(response) {
                if (response.success) {
                    
                    $(document.body).trigger('wc_fragment_refresh');

                    
                    $('.woocommerce-notices-wrapper').html('<div class="woocommerce-message">' + response.data.message + '</div>');
                } else {
                 
                    $('.woocommerce-notices-wrapper').html('<div class="woocommerce-error">' + response.data.error + '</div>');
                }
            }
        });
    });
});

Swiper.js enqueue snippet

function enqueue_swiper_scripts() {
    // Enqueue Swiper CSS
    wp_enqueue_style('swiper-css', 'https://unpkg.com/swiper/swiper-bundle.min.css');

    // Enqueue Swiper JS
    wp_enqueue_script('swiper-js', 'https://unpkg.com/swiper/swiper-bundle.min.js', array('jquery'), null, true);

    // Add Swiper initialization script
    wp_add_inline_script('swiper-js', "
        document.addEventListener('DOMContentLoaded', function() {
            var swiper = new Swiper('.swiper-container', {
                loop: true,
            });
        });
    ");
}
add_action('wp_enqueue_scripts', 'enqueue_swiper_scripts');

add to cart button snippet

add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts' );
function custom_enqueue_scripts() {
    wp_enqueue_script( 'custom-ajax-add-to-cart', get_template_directory_uri() . '/js/custom-ajax-add-to-cart.js', array( 'jquery' ), null, true );
    wp_localize_script( 'custom-ajax-add-to-cart', 'custom_ajax_object', array(
        'ajax_url' => admin_url( 'admin-ajax.php' )
    ) );
}

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật