<script>
$(function () {
{% for Product in pagination %}
{% if includeStockExist(Product) == false %}
var formName = 'productForm' + {{ Product.id }};
$('#' + formName).css('visibility', 'hidden');
var cartBtn = $(`button[form="${formName}"]`);
cartBtn.replaceWith('<button type="button" class="ec-blockBtn--action" disabled="disabled">{{ 'front.product.out_of_stock'|trans }}</button>');
{% endif %}
{% endfor %}
});
</script>