4101function t_store_generateUrl(product) {4102var currentProtocol = window.location.protocol;4103var currentHost = window.location.host;4104var relativeProductPath;41054106relativeProductPath = product.url.split('://')[1];4107relativeProductPath = relativeProductPath.split('/');4108relativeProductPath.shift();4109relativeProductPath = relativeProductPath.join('/');41104111return currentProtocol + '//' + currentHost + '/' + relativeProductPath;4112
}function t_store_drawProdPopup(recid, el_popup, product, options, fromPopup) { el_popup.scrollTop = 0; var el_product = el_popup.querySelector('.js-store-product.js-product'); el_product.setAttribute('data-card-size', 'large'); t_store_drawProdPopup_drawGallery(recid, el_popup, product, options); if (!window.tStoreDefPackObj) { window.tStoreDefPackObj = {}; } var storeProduct = el_popup.querySelector('.js-store-product'); storeProduct.setAttribute('data-product-lid', product.uid); storeProduct.setAttribute('data-product-uid', product.uid); storeProduct.setAttribute('data-product-gen-uid', product.uid); var storeProdName = el_popup.querySelector('.js-store-prod-name'); if (product.title) { storeProdName.innerHTML = product.title; storeProdName.style.display = ''; } else { storeProdName.innerHTML = ''; storeProdName.style.display = 'none'; } var partuids = []; try { partuids = JSON.parse(product.partuids); } catch (error) { console.error(error); } storeProduct.setAttribute('data-product-part-uid', partuids.join(',')); // links for size chart if (options.linksSizeChart && partuids.length > 0) { var str = ''; var linksAdded = []; for (var i = 0; i < partuids.length; i++) { var uid = partuids[i]; if ( options.linksSizeChart[uid] && options.linksSizeChart[uid].infotext && options.linksSizeChart[uid].infourl ) { if (linksAdded.indexOf(options.linksSizeChart[uid].infourl) === -1) { str += '<div class="t-store__prod-popup__link t-descr t-descr_xxs">'; str += '<a href="' + options.linksSizeChart[uid].infourl.replace(/"/g, '"') + '" target="_blank">'; str += options.linksSizeChart[uid].infotext; str += '</a>'; str += '</div>'; linksAdded.push(options.linksSizeChart[uid].infourl); } } } el_popup.querySelector('.t-store__prod-popup__links-wrapper').innerHTML = str; } else { el_popup.querySelector('.t-store__prod-popup__links-wrapper').innerHTML = ''; } t_store_initTextAndCharacteristics(el_popup, product); var onPopupReady = function () { // t_store_initTextAndCharacteristics(el_popup, product); t_store_addProductOptions(recid, product, el_product, options); t_store_option_handleOnChange(el_product); t_store_option_handleOnChange_custom(recid, el_product, options); t_store_onFuncLoad('t_prod__initProduct', function () { t_prod__initProduct(el_product, options); }); t_store_notifyButton_applyEffects(el_popup); window.t_store_prodPopup_updateGalleryThumbsEvent = function () { t_store_prodPopup_updateGalleryThumbs(recid, el_popup, product, options); }; if (fromPopup) { window.removeEventListener('resize', window.t_store_prodPopup_updateGalleryThumbsEvent); } window.addEventListener('resize', window.t_store_prodPopup_updateGalleryThumbsEvent); }; onPopupReady(); // Draw tabs if (options.tabs) { t_store_onFuncLoad('t_store_tabs_init', function () {