

function sendToKstore(tariff, product, quantity) {
    const searchParam = new URLSearchParams(window.location.search.toLowerCase());
    const promocode = searchParam.get('p');
        
	const kStoreProxy = new window.KStoreProxy("a3f449f3-71a1-4111-beef-086e3b2e5320")
        .addProduct(product)
        .addTariff(tariff);
        
        
    if(quantity && quantity === parseInt(quantity)){
        kStoreProxy.addParameter('quantity', quantity);
    }
    
    if(promocode){
        kStoreProxy.addPartnerCode(promocode); 
    }
	
    kStoreProxy.submit();
	return false;
}

/*
function onKstoreClick(){
    sendToKstore('kf_oneday', 'Focus');
}


function setListenersForCalculatorButtons(){
    const buttons = document.querySelectorAll('[data-button-kstore]');
        if(buttons.length > 0) {
            buttons.forEach(function(item) {
                item.addEventListener('click', onKstoreClick);
            });
        }
}

document.addEventListener('DOMContentLoaded', setListenersForCalculatorButtons);
*/

