Каталог файловtilda-wishlist-1.0.js
801 recid = recidAttr ? recidAttr.replace('rec', '') : '';802 }803 if (inv == '') {804 inv = productElement.getAttribute('data-product-inv') || '';805 }806 807 unit = productElement.getAttribute('data-product-unit') || '';808 portion = productElement.getAttribute('data-product-portion') || '';809 single = productElement.getAttribute('data-product-single') || '';810 811 // варианты товара (с разными свойствами)812
История файла и сравнение версий
var editionOptionsElements = productElement.querySelectorAll('.js-product-edition-option');
813 Array.prototype.forEach.call(editionOptionsElements, function (optionsElement) { 814 var optionName = optionsElement.querySelector('.js-product-edition-option-name').textContent; 815 var selectedOption = optionsElement.querySelector('option:checked'); 816 if (selectedOption) { 817 var optionVariant = selectedOption.value; 818 var optionPrice = selectedOption.getAttribute('data-product-edition-variant-price'); 819 optionPrice = twishlist__cleanPrice(optionPrice); 821 if (optionName && optionVariant) { 823 if (optionName != '') { 824 optionName = twishlist__escapeHtml(optionName); 826 if (optionVariant != '') { 827 optionVariant = twishlist__escapeHtml(optionVariant); 828 optionVariant = optionVariant.replace(/(?:\r\n|\r|\n)/g, ''); 830 if (optionName.length > 1 && optionName.charAt(optionName.length - 1) == ':') { 831 optionName = optionName.substring(0, optionName.length - 1); 833 optionObj['option'] = optionName; 834 optionObj['variant'] = optionVariant; 835 optionObj['price'] = optionPrice; 836 options.push(optionObj); 840 // дополнительные опции 841 var optionsElements = productElement.querySelectorAll('.js-product-option'); 842 Array.prototype.forEach.call(optionsElements, function (optionsElement) { 843 var optionName = optionsElement.querySelector('.js-product-option-name').textContent; 844 var selectedOption = optionsElement.querySelector('option:checked'); 845 if (selectedOption) { 846 var optionVariant = selectedOption.value; 847 var optionPrice = selectedOption.getAttribute('data-product-variant-price'); 848 optionPrice = twishlist__cleanPrice(optionPrice); 850 if (optionName && optionVariant) { 852 if (optionName != '') { 853 optionName = twishlist__escapeHtml(optionName); 855 if (optionVariant != '') { 856 optionVariant = twishlist__escapeHtml(optionVariant); 857 optionVariant = optionVariant.replace(/(?:\r\n|\r|\n)/g, ''); 859 if (optionName.length > 1 && optionName.charAt(optionName.length - 1) == ':') { 860 optionName = optionName.substring(0, optionName.length - 1); 862 optionObj['option'] = optionName; 863 optionObj['variant'] = optionVariant; 864 optionObj['price'] = optionPrice; 865 options.push(optionObj); 870 sku = productElement.querySelector('.js-product-sku') 871 ? productElement.querySelector('.js-product-sku').textContent.trim() 874 if (packLabel == '') { 875 packLabel = productElement.getAttribute('data-product-pack-label') || ''; 878 packM = productElement.getAttribute('data-product-pack-m') || ''; 881 packX = productElement.getAttribute('data-product-pack-x') || ''; 884 packY = productElement.getAttribute('data-product-pack-y') || ''; 887 packZ = productElement.getAttribute('data-product-pack-z') || ''; 890 var productUrl = productElement.getAttribute('data-product-url'); 891 var settedLinkInToProduct = productElement.querySelector( 892 '.js-product-link:not([href="#prodpopup"]):not([href="#addtofavorites"]):not([href="#order"])' 894 var settedLinkInToProductHref; 895 if (settedLinkInToProduct) { 896 settedLinkInToProductHref = settedLinkInToProduct.getAttribute('href'); 899 if (!productUrl && settedLinkInToProductHref) { 900 productUrl = settedLinkInToProductHref;