Категории

Скутеры

Скутеры

'); } else { var href = a.attr('href'); if (href != null && href != 'undefined') { if (/product_id=[0-9]*/.test(href)) { var matches = href.match (/product_id=([0-9]*)/); if (matches != null && matches != 'undefined') { products_id += '&id[' + index + ']=' + matches[1]; $(element).wrap('
'); } } else if (/\/[a-zA-Zа-яА-ЯёЁ0-9\-\_\%]*[\.]{0,1}[a-zA-Z]{0,}\?|$/.test(href)) { var matches = href.match (/\/([a-zA-Zа-яА-ЯёЁ0-9\-\_\%]*)[\.]{0,1}[a-zA-Z]{0,}(?:\?|$)/); if (matches != null && matches != 'undefined') { products_url_alias += '&ua[' + index + ']=' + encodeURIComponent (matches[1]); $(element).wrap('
'); } } } } }); $.ajax({ url: 'index.php?route=module/astickers/getAStickers', type: 'POST', data: products_id + products_url_alias, dataType: 'json', cache: false, success: function(json) { var hidden_content = [], id = ''; $('.htabs a').each(function(index, element) { id = $(element).attr('href'); if ($(id).css('display') == 'none') { $(id).css({'display':'block'}); hidden_content.push (id); } }); $.each(json, function(index, data) { var image = $('.image a div.astickers_' + index + ' img'); var image_width = parseInt (image.css('width')); var image_height = parseInt (image.css('height')); var width = image_width + parseInt (image.css('padding-left')) + parseInt (image.css('padding-right')); var height = image_height + parseInt (image.css('padding-top')) + parseInt (image.css('padding-bottom')); var margin_top = parseInt (image.css('margin-top')) + parseInt (image.css('border-top-width')); if (image.css('text-align') == 'center') { var left = '50%'; var margin_left = -(image_width / 2); } else { var left = 0; var margin_left = parseInt (image.css('margin-left')) + parseInt (image.css('border-left-width')); } if (data && image_width > '10' && image_height > '10') { image.before(data); var astickers = $('.image a div.astickers_' + index + ' div.asticker'); astickers.css({'width':width, 'height':height, 'margin-top':margin_top, 'margin-left':margin_left, 'left':left}); astickers.show('pulsate', {}, 1000); } else { image.unwrap(); } }); if (hidden_content.length) { $(hidden_content.join (', ')).css({'display':'none'}); } } }); }; $(document).ready(function(e) { if (typeof doFilter != 'function') { setTimeout ('getAStickers()', 500); } }); //-->
'; } html += '
' + $(element).find('.name').html() + '
'; var price = $(element).find('.price').html(); if (price != null) { html += '
' + price + '
'; } html += '
' + $(element).find('.description').html() + '
'; var rating = $(element).find('.rating').html(); if (rating != null) { html += '
' + rating + '
'; } html += ''; html += '
'; html += '
' + $(element).find('.cart').html() + '
'; html += '
' + $(element).find('.wishlist').html() + '
'; html += '
' + $(element).find('.compare').html() + '
'; html += '
'; $(element).html(html); }); $.totalStorage('display', 'list'); } else { $('.main-products.product-list').attr('class', 'main-products product-grid'); $('.display a.grid-view').addClass('active'); $('.display a.list-view').removeClass('active'); $('.main-products.product-grid > div').each(function(index, element) { if ($(this).hasClass('sf-loader')) return; $(this).attr('class',"product-grid-item xs-100 sm-50 md-50 lg-33 xl-33 display-icon inline-button" + ($(this).hasClass('outofstock') ? ' outofstock' : '')); var html = ''; var image = $(element).find('.image').html(); if (image != null) { html += '
' + image + '
'; } html += '
'; html += '
' + $(element).find('.name').html() + '
'; html += '
' + $(element).find('.description').html() + '
'; var price = $(element).find('.price').html(); if (price != null) { html += '
' + price + '
'; } var rating = $(element).find('.rating').html(); if (rating != null) { html += '
' + rating + '
'; } html += '
'; html += '
' + $(element).find('.cart').html() + '
'; html += '
' + $(element).find('.cart + .wishlist').html() + '
'; html += '
' + $(element).find('.cart + .wishlist + .compare').html() + '
'; html += '
'; $(element).html('
'+html+'
'); }); $.totalStorage('display', 'grid'); } $(window).trigger('list_grid_change'); Journal.itemsEqualHeight(); Journal.equalHeight($(".main-products .product-wrapper"), '.description'); $(".main-products img.lazy").lazy({ bind: 'event', visibleOnly: false, effect: "fadeIn", effectTime: 250 }); Journal.quickViewStatus = false; } view = $.totalStorage('display'); if (view) { display(view); } else { display('grid'); } //-->