Re-init bricks add to cart

<?php

add_action( 'facetwp_scripts', function() {
?>
    <script>
    document.addEventListener('facetwp-loaded', function() {
        if ( FWP.loaded ) {
            bricksWooAjaxAddToCartFn.run();
        }
    });
    </script>
<?php
}, 100 );