Каталог файловtilda-catalog-1.1.js
8301 return wrapper.querySelector('.js-product-edition-option[data-edition-option-id="' + curOption.id + '"]');8302}8303 8304function t_store_combineOptionIdByName(text) {8305 return text.replace(/[\\'"<>{}]/g, '');8306}8307 8308function t_store_getProductFirstImg(product) {8309 if (product.gallery && product.gallery[0] === '[') {8310 var galleryArr = JSON.parse(product.gallery);8311 if (galleryArr[0] && galleryArr[0].img) {8312
История файла и сравнение версий
return galleryArr[0].img;
8318function t_store__getFormattedPrice(options, price) { 8319 if (typeof price === 'undefined' || price === null || price === '') { 8322 var clearedPrice = t_store__cleanPrice(price); 8323 clearedPrice = clearedPrice.toString(); 8325 var showDecPart = false; 8326 var hasDefinedSeparator = false; 8328 if (options.currencyDecimal) { 8329 showDecPart = options.currencyDecimal === '00'; 8330 } else if (typeof window.tcart !== 'undefined' && typeof window.tcart.currency_dec !== 'undefined') { 8331 showDecPart = window.tcart.currency_dec === '00'; 8334 if (options.currencySeparator) { 8335 hasDefinedSeparator = options.currencySeparator === '.'; 8336 } else if (typeof window.tcart !== 'undefined' && typeof window.tcart.currency_sep !== 'undefined') { 8337 hasDefinedSeparator = window.tcart.currency_sep === '.'; 8340 // always show decimial part, if it was defined in settings 8342 if (clearedPrice.indexOf('.') === -1 && clearedPrice.indexOf(',') === -1) { 8343 clearedPrice = clearedPrice + '.00'; 8345 var foo = clearedPrice.substring(clearedPrice.indexOf('.') + 1); 8346 if (foo.length === 1) { 8347 clearedPrice = clearedPrice + '0'; 8352 // show correct decimial separator 8353 if (hasDefinedSeparator) { 8354 clearedPrice = clearedPrice.replace(',', '.'); 8356 clearedPrice = clearedPrice.replace('.', ','); 8359 // divide thousands with spaces 8360 clearedPrice = clearedPrice.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' '); 8362 return clearedPrice; 8365function t_store__getFormattedMinPrice(options, product) { 8366 var minPrice = product.minPrice; 8368 if (minPrice !== null && minPrice !== undefined) { 8369 minPrice = t_store__getFormattedPrice(options, minPrice); 8375function t_store__getFormattedPriceRange(options, product) { 8376 // Important: return null if user selected to draw product variants UI in product card 8378 !Object.prototype.hasOwnProperty.call(options, 'prodCard') || 8379 options.prodCard.showOpts || 8380 !options.price.priceRange || 8381 options.price.priceRange === '' || 8382 !Object.prototype.hasOwnProperty.call(product, 'minPrice') || 8383 !Object.prototype.hasOwnProperty.call(product, 'maxPrice') 8388 var minPrice = product.minPrice; 8389 var maxPrice = product.maxPrice; 8391 if (minPrice !== null && maxPrice !== null && minPrice !== maxPrice) { 8392 minPrice = t_store__getFormattedPrice(options, minPrice); 8393 maxPrice = t_store__getFormattedPrice(options, maxPrice); 8394 var priceRangeDesign = options.price.priceRange; 8396 if (priceRangeDesign === 'range') { 8397 return minPrice + '—' + maxPrice; // — 8398 } else if (priceRangeDesign === 'from') { 8399 return window.tStoreDict['from'] + ' ' + minPrice;