- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
//функция возвращает название списка товара для аналитики
getItemListName: function(obj) {
obj = $(obj);
var list = 'other';
if (obj.parents('.AddedToCart__box--showcase').length > 0) {
list = 'paneAddToCart';
} else if (obj.parents('.slider').length > 0
&& obj.parents('.slider').find('.sliderHeader').html() == 'Лучшая цена') {
list = 'paneBestPrice';
} else if (obj.parents('.slider').length > 0
&& obj.parents('.slider').find('.sliderHeader').html() == 'Цена недели') {
list = 'paneWeekPrice';
} else if (obj.parents('.slider').length > 0
&& obj.parents('.slider').find('.sliderHeader').html() == 'Акционные товары') {
list = 'panePromo';
} else if (obj.parents('.slider').length > 0
&& obj.parents('.slider').find('.sliderHeader').html() == 'Популярные товары'
&& $('body').hasClass('Page--itemCard')) {
list = 'panePopDetail';
} else if (obj.parents('.slider').length > 0
&& obj.parents('.slider').find('.sliderHeader').html() == 'Популярные товары'
&& document.location.pathname.indexOf('/personal/cart/') >= 0) {
list = 'panePopCart';
} else if (obj.parents('.slider').length > 0
&& obj.parents('.slider').find('.sliderHeader').html() == 'Популярные товары'
&& $('.Rubric--category').length > 0) {
list = 'panePopRubrics';
} else if (obj.parents('.slider').length > 0
&& obj.parents('.slider').find('.sliderHeader').html() == 'Популярные товары') {
list = 'panePopCatalog';
} else if (obj.parents('.relatedItem').length > 0
&& obj.parents('.relatedItem').find('.relatedItemsHeader').html() == 'Сопутствующий товар') {
list = 'relatedCart';
} else if (obj.parents('.analogues').length > 0
&& document.location.search.indexOf('REMOVE_CODE') >= 0) {
list = 'replacements';
} else if (obj.parents('.analogues').length > 0) {
list = 'analog';
} else if (obj.parents('.consumables').length > 0) {
list = 'consumables';
} else if (document.location.pathname.indexOf('/search/') >= 0) {
list = 'search';
} else if (document.location.pathname.indexOf('/promo/actions/') >= 0) {
list = 'promo';
} else if (document.location.pathname.indexOf('/personal/favorite/') >= 0) {
list = 'favorite';
} else if (document.location.pathname.indexOf('/personal/remind/') >= 0) {
list = 'remind';
} else if (document.location.pathname.indexOf('/personal/order/') >= 0) {
if (document.location.href.indexOf('plist=Y') >= 0) {
list = 'allMyOrder';
} else {
list = 'myOrder';
}
} else if (document.location.pathname.indexOf('/services/code/') >= 0) {
list = 'orderByCode';
} else if (document.location.pathname.indexOf('/catalog/compare/') >= 0) {
list = 'compare';
} else if (document.location.pathname.indexOf('/services/cartridges/') >= 0) {
list = 'cartridge';
} else if (document.location.pathname.indexOf('/promo/best_price/') >= 0) {
list = 'bestPrice';
} else if (document.location.pathname.indexOf('/promo/sale/') >= 0) {
list = 'sale';
} else if (document.location.pathname.indexOf('/catalog/novelty/') >= 0) {
list = 'novelty';
} else if (document.location.pathname.indexOf('/services/sets/') >= 0) {
list = 'collections';
} else if (document.location.pathname.indexOf('/catalog/brands/') >= 0) {
list = 'brands';
} else if (obj.parents('.listItemsContainer').length > 0
&& document.location.search.indexOf('REMOVE_CODE') >= 0) {
list = 'replacements';
} else if (obj.parents('.listItemsContainer').length > 0) {
list = 'catalog';
} else if ($('body').hasClass('Page--itemCard')) {
list = 'detail';
}
return list;
},