buttonComparison.on('click', () => {
if (buttonComparison.hasClass('js-active')) {
for (let index = 0; index < productCookie.length; index++) {
const element = productCookie[index];
if (+element === +productID) {
productCookie.splice(index, 1);
}
}
$(this).removeClass('js-active');
} else {
productCookie.push(productID);
$(this).addClass('js-active');
}
helpers.setCookie('shop_compare', productCookie.join(','), 30);
});