Блок "вы Смотрели"
#1
Отправлено 23 Сентябрь 2017 - 14:19
Сейчас данный блок выглядит так https://prnt.sc/gooiad
- Внести изменения для каталога: http://prntscr.com/gooq2b
1. Изменить расположение кнопок
2. Добавить кнопку "В корзину"
3. Увеличить шрифт с ценой примерно в полтора раза
4. Сократить видимый текст названия до 2х строк
5. Отделять товары между собой строчкой
- Внести изменения для карточки товара:
1. Добавить блок в карточку товара с названием "Недавно просмотренные" https://prnt.sc/goom35
2. Вывести его после "С ЭТИМ ТОВАРОМ СМОТРЯТ"
3. Визуально сделать его аналогичным с "С ЭТИМ ТОВАРОМ СМОТРЯТ"
#2
Отправлено 27 Сентябрь 2017 - 08:11
Зайдите в раздел Сайт - Редактор шаблонов - HTML - найдите:
<!-- Вы смотрели --> {% IFNOT recently_viewed_goods_empty %} <div class="block viewed"> <h4 class="title">Вы смотрели</h4> <div class="content"> <ul class="viewed-items"> {% FOR recently_viewed_goods %} {% IFNOT recently_viewed_goods.NAME=Otzyvy-o-magazine %} <div class="recently-item"> <a href="{recently_viewed_goods.URL}" title="{recently_viewed_goods.NAME}" class="product-image"> <img class="goods-image-icon" src="{% IF recently_viewed_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=sport{% ELSE %}{recently_viewed_goods.IMAGE_ICON}{% ENDIF %}" alt="{recently_viewed_goods.NAME}"> </a> <div class="recently-item-content"> <p class="product-name"> <a href="{recently_viewed_goods.URL}" title="{recently_viewed_goods.NAME}">{recently_viewed_goods.NAME}</a> </p> <div class="ratings"> <div class="rating-box"> {% IF recently_viewed_goods.OPINION_RATING_VALUE %} <span> <div class="rating" style="width:{recently_viewed_goods.OPINION_RATING_VALUE}0%" alt="{recently_viewed_goods.OPINION_RATING_VALUE}" title="Рейтинг товара"></div> </span> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён" title="Рейтинг не определён"></div> {% ENDIF %} </div> </div> <div class="price-box"> {% IF recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>recently_viewed_goods.MIN_PRICE_NOW %} <span class="old-price"> <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT | money_format}</span> </span> {% ELSEIF recently_viewed_goods.MIN_PRICE_OLD>recently_viewed_goods.MIN_PRICE_NOW %} <span class="old-price"> <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_OLD | money_format}</span> </span> {% ENDIF %} <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_NOW | money_format}</span> </div> <div class="actions"> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{recently_viewed_goods.MIN_PRICE_NOW_ID} goodsListForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{recently_viewed_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{recently_viewed_goods.MIN_PRICE_NOW_ID}" /> <!--a class="add-cart quick" title="Быстро оформить заказ" {% IF SETTINGS_GOODS_DONT_PUT_TO_CART_MORE_THAN_AVAILABLE && recently_viewed_goods.MAX_REST_VALUE=0 %}style="display:none;"{% ENDIF %}><i class="fa fa-shopping-cart"></i></a--> <a class="add-cart" title="В корзину" {% IF SETTINGS_GOODS_DONT_PUT_TO_CART_MORE_THAN_AVAILABLE && recently_viewed_goods.MAX_REST_VALUE=0 %}style="display:none;"{% ENDIF %}><i class="fa fa-shopping-cart"></i></a> <!-- Если есть возможность добавить товар в избранное --> {% IF recently_viewed_goods.IS_HAS_IN_FAVORITES_LIST %} <a class="add-wishlist added" data-action-is-add="0" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" title="Убрать «{recently_viewed_goods.NAME}» из избранного" href="{FAVORITES_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ELSE %} <a class="add-wishlist" data-action-is-add="1" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" title="Добавить «{recently_viewed_goods.NAME}» в избранное" href="{FAVORITES_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ENDIF %} <!-- END Если есть возможность добавить товар в избранное --> <!-- Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> {% IF TARIFF_FEATURE_GOODS_COMPARE && SETTINGS_COMPARE_DISABLE=0 %} {% IF recently_viewed_goods.IS_HAS_IN_COMPARE_LIST %} <a class="add-compare added" data-action-is-add="0" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" href="{COMPARE_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ELSE %} <a class="add-compare" data-action-is-add="1" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" href="{COMPARE_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ENDIF %} {% ENDIF %} <!-- END Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> </form> </div> </div> </div> {% ENDIF %} {% ENDFOR %} </ul> </div> </div> {% ENDIF %} <!-- /END Вы смотрели -->
замените на:
<!-- Вы смотрели --> {% IFNOT recently_viewed_goods_empty %} <div class="block viewed"> <h4 class="title">Вы смотрели</h4> <div class="content"> <ul class="viewed-items"> {% FOR recently_viewed_goods %} {% IFNOT recently_viewed_goods.NAME=Otzyvy-o-magazine %} <div class="recently-item"> <a href="{recently_viewed_goods.URL}" title="{recently_viewed_goods.NAME}" class="product-image"> <img class="goods-image-icon" src="{% IF recently_viewed_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=sport{% ELSE %}{recently_viewed_goods.IMAGE_ICON}{% ENDIF %}" alt="{recently_viewed_goods.NAME}"> </a> <div class="ratings"> <div class="rating-box"> {% IF recently_viewed_goods.OPINION_RATING_VALUE %} <span> <div class="rating" style="width:{recently_viewed_goods.OPINION_RATING_VALUE}0%" alt="{recently_viewed_goods.OPINION_RATING_VALUE}" title="Рейтинг товара"></div> </span> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён" title="Рейтинг не определён"></div> {% ENDIF %} </div> </div> <div class="recently-item-content"> <p class="product-name"> <a href="{recently_viewed_goods.URL}" title="{recently_viewed_goods.NAME}">{recently_viewed_goods.NAME}</a> </p> <div class="price-box"> {% IF recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>recently_viewed_goods.MIN_PRICE_NOW %} <span class="old-price"> <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT | money_format}</span> </span> {% ELSEIF recently_viewed_goods.MIN_PRICE_OLD>recently_viewed_goods.MIN_PRICE_NOW %} <span class="old-price"> <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_OLD | money_format}</span> </span> {% ENDIF %} <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_NOW | money_format}</span> </div> <div class="actions"> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{recently_viewed_goods.MIN_PRICE_NOW_ID} goodsListForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{recently_viewed_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{recently_viewed_goods.MIN_PRICE_NOW_ID}" /> <a class="add-cart button button2" title="В корзину" {% IF SETTINGS_GOODS_DONT_PUT_TO_CART_MORE_THAN_AVAILABLE && recently_viewed_goods.MAX_REST_VALUE=0 %}style="display:none;"{% ENDIF %}>В корзину</a> <!-- Если есть возможность добавить товар в избранное --> {% IF recently_viewed_goods.IS_HAS_IN_FAVORITES_LIST %} <a class="add-wishlist added" data-action-is-add="0" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" title="Убрать «{recently_viewed_goods.NAME}» из избранного" href="{FAVORITES_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ELSE %} <a class="add-wishlist" data-action-is-add="1" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" title="Добавить «{recently_viewed_goods.NAME}» в избранное" href="{FAVORITES_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ENDIF %} <!-- END Если есть возможность добавить товар в избранное --> <!-- Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> {% IF TARIFF_FEATURE_GOODS_COMPARE && SETTINGS_COMPARE_DISABLE=0 %} {% IF recently_viewed_goods.IS_HAS_IN_COMPARE_LIST %} <a class="add-compare added" data-action-is-add="0" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" href="{COMPARE_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ELSE %} <a class="add-compare" data-action-is-add="1" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" href="{COMPARE_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ENDIF %} {% ENDIF %} <!-- END Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> </form> </div> <div class="clear"></div> </div> </div> {% ENDIF %} {% ENDFOR %} </ul> </div> </div> {% ENDIF %} <!-- /END Вы смотрели -->
Далее зайдите в main.css - найдите:
/** Вы смотрели **/ .viewed-items {margin: 0;padding: 0;list-style: none;list-style-position: inside;} .viewed-items .item {float: left;width: 100%;border-bottom: 1px dotted #eee;margin-bottom: 10px;padding: 0 10px 10px 0;} .viewed-items .item:last-child {border: 0;} .viewed-items .item .product-name a {display: block;font-weight: 400;margin-bottom: 10px;max-height: 56px;overflow: hidden;} .viewed-items .item .product-img {float: left;margin-right: 15px;} .viewed-items .item img {max-width: 75px;max-height: 75px;box-shadow: none;} .viewed-items .item .rating-box {display: none;float: none;margin-bottom: 10px;} .viewed-items .item .price-box {display: block;text-align: right;}
замените на:
/** Вы смотрели **/ .viewed-items {margin: 0;padding: 0;list-style: none;list-style-position: inside;} .viewed-items .recently-item {width: 100%;border-bottom: 2px solid #ccc;margin-bottom: 10px;padding: 0 10px 10px 0;position: relative;} .viewed-items .recently-item:last-child {border: 0;} .viewed-items .recently-item .product-name a {display: block;font-weight: 400;margin-bottom: 10px;max-height: 56px;overflow: hidden;} .viewed-items .recently-item .product-image {float: left;margin-bottom: 15px;} .viewed-items .recently-item img {max-width: 75px;max-height: 75px;box-shadow: none;} .viewed-items .recently-item .ratings {float: right;;margin-bottom: 10px;} .viewed-items .recently-item .recently-item-content{clear: both;} .viewed-items .recently-item .recently-item-content .price-box {display: block;text-align: right;float: left;} .viewed-items .recently-item .recently-item-content .price-box span{font-size: 20px;line-height: 40px;} .viewed-items .recently-item .recently-item-content .actions{float: right;} .viewed-items .recently-item .recently-item-content .actions .add-compare, .viewed-items .recently-item .recently-item-content .actions .add-wishlist{position: absolute;top:20px;} .viewed-items .recently-item .recently-item-content .actions .add-compare{right:12px;} .viewed-items .recently-item .recently-item-content .actions .add-wishlist{right:32px;}
Результат:
Далее зайдите в шаблон Товар - найдите:
</div> {%ELSE%} <!-- Если в тарифном плане подключен модуль отзывов о товаре --> {% IF TARIFF_FEATURE_GOODS_OPINION %} <!-- Если не выключен модуль отзывов о товаре --> {% IFNOT SETTINGS_OPINION_DISABLE %}
перед ним вставьте:
<div class="recently_viewed_goods clear"> <!-- Недавно просмотренные --> {% IFNOT recently_viewed_goods_empty %} <div class="recently_viewed_goods"> <div class="box-up-sell products-container"> <h3 class="title"><span>Недавно просмотренные</span></h3> <div class="navigation"> <a href="#" class="prev"><i class="fa fa-angle-left"></i></a> <a href="#" class="next"><i class="fa fa-angle-right"></i></a> </div> <div class="products-grid"> {% FOR recently_viewed_goods %} <div class="item"> <div class="item-inner" itemscope itemtype="http://schema.org/Product"> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{recently_viewed_goods.MIN_PRICE_NOW_ID} goodsListForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{recently_viewed_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{recently_viewed_goods.MIN_PRICE_NOW_ID}" /> <div class="product-image"> <a href="{recently_viewed_goods.URL_MIN_PRICE_NOW | url_amp}" title="{recently_viewed_goods.NAME}" class="product-img"> <img class="goods-image-small" src="{% IF recently_viewed_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=sunrise{% ELSE %}{recently_viewed_goods.IMAGE_MEDIUM}{% ENDIF %}" alt="{recently_viewed_goods.NAME}" title="{recently_viewed_goods.NAME}" itemprop="image"> {% IF recently_viewed_goods.IS_NEW %} <span class="ico-new">Новинка</span> {% ELSEIF recently_viewed_goods.IS_TOP %} <span class="ico-best">Хит</span> {% ENDIF %} {% IF recently_viewed_goods.MAX_DISCOUNT %} <span class="ico-sale">Скидка</span> {% ENDIF %} </a> <div class="actions"> <div class="group-mask"> <div class="inner-mask"> <div class="ratings"> <a href="{recently_viewed_goods.URL | url_amp}" title="Перейти к отзывам"> <div class="rating-box"> {% IF recently_viewed_goods.OPINION_RATING_VALUE %} <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <meta itemprop="worstRating" content = "1"> <meta itemprop="bestRating" content = "10"> <meta itemprop="ratingValue" content = "{recently_viewed_goods.OPINION_RATING_VALUE}"> <meta itemprop="reviewCount" content = "{recently_viewed_goods.OPINION_RATING_CNT_ALL}"> <div class="rating" style="width:{recently_viewed_goods.OPINION_RATING_VALUE}0%" alt="{recently_viewed_goods.OPINION_RATING_VALUE}" title="Рейтинг товара"></div> </span> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён" title="Рейтинг не определён"></div> {% ENDIF %} </div> </a> </div> <div class="add-to-links"> <!-- Если есть возможность добавить товар в избранное --> {% IF recently_viewed_goods.IS_HAS_IN_FAVORITES_LIST %} <a class="add-wishlist added" data-action-is-add="0" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" data-add-tooltip="В Избранное" data-del-tooltip="Убрать из избранного" data-tooltip="Убрать из избранного" title="Убрать «{recently_viewed_goods.NAME}» из избранного" href="{FAVORITES_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ELSE %} <a class="add-wishlist" data-action-is-add="1" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" data-add-tooltip="В Избранное" data-del-tooltip="Убрать из избранного" data-tooltip="В Избранное" title="Добавить «{recently_viewed_goods.NAME}» в избранное" href="{FAVORITES_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" href="{FAVORITES_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ENDIF %} <!-- END Если есть возможность добавить товар в избранное --> <!-- Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> {% IF TARIFF_FEATURE_GOODS_COMPARE && SETTINGS_COMPARE_DISABLE=0 %} {% IF recently_viewed_goods.IS_HAS_IN_COMPARE_LIST %} <a class="add-compare added" data-action-is-add="0" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" data-add-tooltip="В Сравнение" data-del-tooltip="Убрать из сравнения" data-tooltip="Убрать из сравнения" title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" href="{COMPARE_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ELSE %} <a class="add-compare" data-action-is-add="1" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" data-add-tooltip="В Сравнение" data-del-tooltip="Убрать из сравнения" data-tooltip="В Сравнение" title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" href="{COMPARE_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ENDIF %} {% ENDIF %} <!-- END Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> </div> </div> </div> </div> </div> <div class="product-shop"> <meta itemprop="name" content="{recently_viewed_goods.NAME}"> <meta itemprop="description" content="{% IF recently_viewed_goods.DESCRIPTION_SHORT %}{recently_viewed_goods.DESCRIPTION_SHORT}{% ELSE %}Описание отсутствует{% ENDIF %}"> <div class="product-name"><a href="{recently_viewed_goods.URL_MIN_PRICE_NOW | url_amp}" title="{recently_viewed_goods.NAME}" itemprop="url">{recently_viewed_goods.NAME}</a></div> <div class="av"> Наличие товара: {% IF recently_viewed_goods.MAX_REST_VALUE=0 %}<span class="false">Нет в наличии</span>{% ELSE %}<span class="true">В наличии</span>{% ENDIF %} </div> <!-- Выводим бренд --> {% IFNOT recently_viewed_goods.goods_attr_list_empty %} <div class="attr-list"> {% FOR goods_attr_list %}{% IF recently_viewed_goods.goods_attr_list.NAME = Бренд %} <div class="attr"> <span class="name">{recently_viewed_goods.goods_attr_list.NAME}:</span> <span class="value">{recently_viewed_goods.goods_attr_list.VALUE}</span> </div> {% ENDIF %}{% ENDFOR %} </div> {% ENDIF %} <div class="price-box" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <meta itemprop="priceCurrency" content="{CURRENCY_CHAR_CODE}"/> {% IF recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>recently_viewed_goods.MIN_PRICE_NOW %} <span class="price old-price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT | money_format}</span> {% ELSEIF recently_viewed_goods.MIN_PRICE_OLD>recently_viewed_goods.MIN_PRICE_NOW %} <span class="price old-price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_OLD | money_format}</span> {% ENDIF %} <span class="price {CURRENCY_CHAR_CODE}" itemprop="price" content="{recently_viewed_goods.MIN_PRICE_NOW}">{recently_viewed_goods.MIN_PRICE_NOW | money_format}</span> </div> <div class="addtocart"> {% IF recently_viewed_goods.MAX_REST_VALUE>0 %} <a class="add-cart button button2" title="В корзину" data-tooltip="В корзину">Добавить в корзину</a> {% ELSE %} <a class="button" onclick="document.location = '/feedback/?form[feedback_message]=Могли бы Вы уведомить меня о наличии товара «{recently_viewed_goods.NAME}»?'; return false;" / >Узнать о поступлении</a> {% ENDIF %} </div> </div> </form> </div> </div> {% ENDFOR %} </div> </div> </div> {% ENDIF %}
В main.js найдите:
// Сопутствующие товары jQuery(function($) { var carouselU = $('.related-goods .products-grid'); carouselU.owlCarousel({ items: 4, itemsDesktop: [1199,3], itemsDesktopSmall: [991,2], itemsTablet: [767,2], itemsTabletSmall: [641,1], itemsMobile: [481,1], responsive: true, responsiveRefreshRate : 200, responsiveBaseWidth: window, lazyLoad: true, pagination: false, itemsScaleUp: true, slideSpeed: 800, stopOnHover: true, touchDrag: false, mouseDrag: false, autoPlay: false, addClassActive: true, autoHeight: false, afterAction: function (e) { if(this.$owlItems.length > this.options.items){ $('.related-goods .navigation').show(); }else{ $('.related-goods .navigation').hide(); $('.related-goods .owl-carousel .owl-item').css("max-width", "300px"); } } }); jQuery('.related-goods .navigation .prev').on('click', function(e){ e.preventDefault(); carouselU.trigger('owl.prev'); }); jQuery('.related-goods .navigation .next').on('click', function(e){ e.preventDefault(); carouselU.trigger('owl.next'); }); });
после него пропишите:
// Недавно просмотренные jQuery(function($) { var carouselU = $('.recently_viewed_goods .products-grid'); carouselU.owlCarousel({ items: 4, itemsDesktop: [1199,3], itemsDesktopSmall: [991,2], itemsTablet: [767,2], itemsTabletSmall: [641,1], itemsMobile: [481,1], responsive: true, responsiveRefreshRate : 200, responsiveBaseWidth: window, lazyLoad: true, pagination: false, itemsScaleUp: true, slideSpeed: 800, stopOnHover: true, touchDrag: false, mouseDrag: false, autoPlay: false, addClassActive: true, autoHeight: false, afterAction: function (e) { if(this.$owlItems.length > this.options.items){ $('.recently_viewed_goods .navigation').show(); }else{ $('.recently_viewed_goods .navigation').hide(); $('.recently_viewed_goods .owl-carousel .owl-item').css("max-width", "300px"); } } }); jQuery('.recently_viewed_goods .navigation .prev').on('click', function(e){ e.preventDefault(); carouselU.trigger('owl.prev'); }); jQuery('.recently_viewed_goods .navigation .next').on('click', function(e){ e.preventDefault(); carouselU.trigger('owl.next'); }); });
Результат:
#3
Отправлено 27 Сентябрь 2017 - 21:05
Vaccina (27 Сентябрь 2017 - 08:11) писал:
Зайдите в раздел Сайт - Редактор шаблонов - HTML - найдите:
<!-- Вы смотрели --> {% IFNOT recently_viewed_goods_empty %} <div class="block viewed"> <h4 class="title">Вы смотрели</h4> <div class="content"> <ul class="viewed-items"> {% FOR recently_viewed_goods %} {% IFNOT recently_viewed_goods.NAME=Otzyvy-o-magazine %} <div class="recently-item"> <a href="{recently_viewed_goods.URL}" title="{recently_viewed_goods.NAME}" class="product-image"> <img class="goods-image-icon" src="{% IF recently_viewed_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=sport{% ELSE %}{recently_viewed_goods.IMAGE_ICON}{% ENDIF %}" alt="{recently_viewed_goods.NAME}"> </a> <div class="recently-item-content"> <p class="product-name"> <a href="{recently_viewed_goods.URL}" title="{recently_viewed_goods.NAME}">{recently_viewed_goods.NAME}</a> </p> <div class="ratings"> <div class="rating-box"> {% IF recently_viewed_goods.OPINION_RATING_VALUE %} <span> <div class="rating" style="width:{recently_viewed_goods.OPINION_RATING_VALUE}0%" alt="{recently_viewed_goods.OPINION_RATING_VALUE}" title="Рейтинг товара"></div> </span> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён" title="Рейтинг не определён"></div> {% ENDIF %} </div> </div> <div class="price-box"> {% IF recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>recently_viewed_goods.MIN_PRICE_NOW %} <span class="old-price"> <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT | money_format}</span> </span> {% ELSEIF recently_viewed_goods.MIN_PRICE_OLD>recently_viewed_goods.MIN_PRICE_NOW %} <span class="old-price"> <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_OLD | money_format}</span> </span> {% ENDIF %} <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_NOW | money_format}</span> </div> <div class="actions"> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{recently_viewed_goods.MIN_PRICE_NOW_ID} goodsListForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{recently_viewed_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{recently_viewed_goods.MIN_PRICE_NOW_ID}" /> <!--a class="add-cart quick" title="Быстро оформить заказ" {% IF SETTINGS_GOODS_DONT_PUT_TO_CART_MORE_THAN_AVAILABLE && recently_viewed_goods.MAX_REST_VALUE=0 %}style="display:none;"{% ENDIF %}><i class="fa fa-shopping-cart"></i></a--> <a class="add-cart" title="В корзину" {% IF SETTINGS_GOODS_DONT_PUT_TO_CART_MORE_THAN_AVAILABLE && recently_viewed_goods.MAX_REST_VALUE=0 %}style="display:none;"{% ENDIF %}><i class="fa fa-shopping-cart"></i></a> <!-- Если есть возможность добавить товар в избранное --> {% IF recently_viewed_goods.IS_HAS_IN_FAVORITES_LIST %} <a class="add-wishlist added" data-action-is-add="0" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" title="Убрать «{recently_viewed_goods.NAME}» из избранного" href="{FAVORITES_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ELSE %} <a class="add-wishlist" data-action-is-add="1" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" title="Добавить «{recently_viewed_goods.NAME}» в избранное" href="{FAVORITES_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ENDIF %} <!-- END Если есть возможность добавить товар в избранное --> <!-- Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> {% IF TARIFF_FEATURE_GOODS_COMPARE && SETTINGS_COMPARE_DISABLE=0 %} {% IF recently_viewed_goods.IS_HAS_IN_COMPARE_LIST %} <a class="add-compare added" data-action-is-add="0" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" href="{COMPARE_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ELSE %} <a class="add-compare" data-action-is-add="1" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" href="{COMPARE_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ENDIF %} {% ENDIF %} <!-- END Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> </form> </div> </div> </div> {% ENDIF %} {% ENDFOR %} </ul> </div> </div> {% ENDIF %} <!-- /END Вы смотрели -->
замените на:
<!-- Вы смотрели --> {% IFNOT recently_viewed_goods_empty %} <div class="block viewed"> <h4 class="title">Вы смотрели</h4> <div class="content"> <ul class="viewed-items"> {% FOR recently_viewed_goods %} {% IFNOT recently_viewed_goods.NAME=Otzyvy-o-magazine %} <div class="recently-item"> <a href="{recently_viewed_goods.URL}" title="{recently_viewed_goods.NAME}" class="product-image"> <img class="goods-image-icon" src="{% IF recently_viewed_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=sport{% ELSE %}{recently_viewed_goods.IMAGE_ICON}{% ENDIF %}" alt="{recently_viewed_goods.NAME}"> </a> <div class="ratings"> <div class="rating-box"> {% IF recently_viewed_goods.OPINION_RATING_VALUE %} <span> <div class="rating" style="width:{recently_viewed_goods.OPINION_RATING_VALUE}0%" alt="{recently_viewed_goods.OPINION_RATING_VALUE}" title="Рейтинг товара"></div> </span> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён" title="Рейтинг не определён"></div> {% ENDIF %} </div> </div> <div class="recently-item-content"> <p class="product-name"> <a href="{recently_viewed_goods.URL}" title="{recently_viewed_goods.NAME}">{recently_viewed_goods.NAME}</a> </p> <div class="price-box"> {% IF recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>recently_viewed_goods.MIN_PRICE_NOW %} <span class="old-price"> <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT | money_format}</span> </span> {% ELSEIF recently_viewed_goods.MIN_PRICE_OLD>recently_viewed_goods.MIN_PRICE_NOW %} <span class="old-price"> <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_OLD | money_format}</span> </span> {% ENDIF %} <span class="price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_NOW | money_format}</span> </div> <div class="actions"> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{recently_viewed_goods.MIN_PRICE_NOW_ID} goodsListForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{recently_viewed_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{recently_viewed_goods.MIN_PRICE_NOW_ID}" /> <a class="add-cart button button2" title="В корзину" {% IF SETTINGS_GOODS_DONT_PUT_TO_CART_MORE_THAN_AVAILABLE && recently_viewed_goods.MAX_REST_VALUE=0 %}style="display:none;"{% ENDIF %}>В корзину</a> <!-- Если есть возможность добавить товар в избранное --> {% IF recently_viewed_goods.IS_HAS_IN_FAVORITES_LIST %} <a class="add-wishlist added" data-action-is-add="0" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" title="Убрать «{recently_viewed_goods.NAME}» из избранного" href="{FAVORITES_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ELSE %} <a class="add-wishlist" data-action-is-add="1" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" title="Добавить «{recently_viewed_goods.NAME}» в избранное" href="{FAVORITES_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ENDIF %} <!-- END Если есть возможность добавить товар в избранное --> <!-- Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> {% IF TARIFF_FEATURE_GOODS_COMPARE && SETTINGS_COMPARE_DISABLE=0 %} {% IF recently_viewed_goods.IS_HAS_IN_COMPARE_LIST %} <a class="add-compare added" data-action-is-add="0" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" href="{COMPARE_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ELSE %} <a class="add-compare" data-action-is-add="1" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" href="{COMPARE_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ENDIF %} {% ENDIF %} <!-- END Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> </form> </div> <div class="clear"></div> </div> </div> {% ENDIF %} {% ENDFOR %} </ul> </div> </div> {% ENDIF %} <!-- /END Вы смотрели -->
Далее зайдите в main.css - найдите:
/** Вы смотрели **/ .viewed-items {margin: 0;padding: 0;list-style: none;list-style-position: inside;} .viewed-items .item {float: left;width: 100%;border-bottom: 1px dotted #eee;margin-bottom: 10px;padding: 0 10px 10px 0;} .viewed-items .item:last-child {border: 0;} .viewed-items .item .product-name a {display: block;font-weight: 400;margin-bottom: 10px;max-height: 56px;overflow: hidden;} .viewed-items .item .product-img {float: left;margin-right: 15px;} .viewed-items .item img {max-width: 75px;max-height: 75px;box-shadow: none;} .viewed-items .item .rating-box {display: none;float: none;margin-bottom: 10px;} .viewed-items .item .price-box {display: block;text-align: right;}
замените на:
/** Вы смотрели **/ .viewed-items {margin: 0;padding: 0;list-style: none;list-style-position: inside;} .viewed-items .recently-item {width: 100%;border-bottom: 2px solid #ccc;margin-bottom: 10px;padding: 0 10px 10px 0;position: relative;} .viewed-items .recently-item:last-child {border: 0;} .viewed-items .recently-item .product-name a {display: block;font-weight: 400;margin-bottom: 10px;max-height: 56px;overflow: hidden;} .viewed-items .recently-item .product-image {float: left;margin-bottom: 15px;} .viewed-items .recently-item img {max-width: 75px;max-height: 75px;box-shadow: none;} .viewed-items .recently-item .ratings {float: right;;margin-bottom: 10px;} .viewed-items .recently-item .recently-item-content{clear: both;} .viewed-items .recently-item .recently-item-content .price-box {display: block;text-align: right;float: left;} .viewed-items .recently-item .recently-item-content .price-box span{font-size: 20px;line-height: 40px;} .viewed-items .recently-item .recently-item-content .actions{float: right;} .viewed-items .recently-item .recently-item-content .actions .add-compare, .viewed-items .recently-item .recently-item-content .actions .add-wishlist{position: absolute;top:20px;} .viewed-items .recently-item .recently-item-content .actions .add-compare{right:12px;} .viewed-items .recently-item .recently-item-content .actions .add-wishlist{right:32px;}
Результат:
BAKER.png
Далее зайдите в шаблон Товар - найдите:
</div> {%ELSE%} <!-- Если в тарифном плане подключен модуль отзывов о товаре --> {% IF TARIFF_FEATURE_GOODS_OPINION %} <!-- Если не выключен модуль отзывов о товаре --> {% IFNOT SETTINGS_OPINION_DISABLE %}
перед ним вставьте:
<div class="recently_viewed_goods clear"> <!-- Недавно просмотренные --> {% IFNOT recently_viewed_goods_empty %} <div class="recently_viewed_goods"> <div class="box-up-sell products-container"> <h3 class="title"><span>Недавно просмотренные</span></h3> <div class="navigation"> <a href="#" class="prev"><i class="fa fa-angle-left"></i></a> <a href="#" class="next"><i class="fa fa-angle-right"></i></a> </div> <div class="products-grid"> {% FOR recently_viewed_goods %} <div class="item"> <div class="item-inner" itemscope itemtype="http://schema.org/Product"> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{recently_viewed_goods.MIN_PRICE_NOW_ID} goodsListForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{recently_viewed_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{recently_viewed_goods.MIN_PRICE_NOW_ID}" /> <div class="product-image"> <a href="{recently_viewed_goods.URL_MIN_PRICE_NOW | url_amp}" title="{recently_viewed_goods.NAME}" class="product-img"> <img class="goods-image-small" src="{% IF recently_viewed_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=sunrise{% ELSE %}{recently_viewed_goods.IMAGE_MEDIUM}{% ENDIF %}" alt="{recently_viewed_goods.NAME}" title="{recently_viewed_goods.NAME}" itemprop="image"> {% IF recently_viewed_goods.IS_NEW %} <span class="ico-new">Новинка</span> {% ELSEIF recently_viewed_goods.IS_TOP %} <span class="ico-best">Хит</span> {% ENDIF %} {% IF recently_viewed_goods.MAX_DISCOUNT %} <span class="ico-sale">Скидка</span> {% ENDIF %} </a> <div class="actions"> <div class="group-mask"> <div class="inner-mask"> <div class="ratings"> <a href="{recently_viewed_goods.URL | url_amp}" title="Перейти к отзывам"> <div class="rating-box"> {% IF recently_viewed_goods.OPINION_RATING_VALUE %} <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <meta itemprop="worstRating" content = "1"> <meta itemprop="bestRating" content = "10"> <meta itemprop="ratingValue" content = "{recently_viewed_goods.OPINION_RATING_VALUE}"> <meta itemprop="reviewCount" content = "{recently_viewed_goods.OPINION_RATING_CNT_ALL}"> <div class="rating" style="width:{recently_viewed_goods.OPINION_RATING_VALUE}0%" alt="{recently_viewed_goods.OPINION_RATING_VALUE}" title="Рейтинг товара"></div> </span> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён" title="Рейтинг не определён"></div> {% ENDIF %} </div> </a> </div> <div class="add-to-links"> <!-- Если есть возможность добавить товар в избранное --> {% IF recently_viewed_goods.IS_HAS_IN_FAVORITES_LIST %} <a class="add-wishlist added" data-action-is-add="0" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" data-add-tooltip="В Избранное" data-del-tooltip="Убрать из избранного" data-tooltip="Убрать из избранного" title="Убрать «{recently_viewed_goods.NAME}» из избранного" href="{FAVORITES_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ELSE %} <a class="add-wishlist" data-action-is-add="1" data-action-add-url="{FAVORITES_ADD_URL}" data-action-delete-url="{FAVORITES_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в избранное" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из избранного" data-add-tooltip="В Избранное" data-del-tooltip="Убрать из избранного" data-tooltip="В Избранное" title="Добавить «{recently_viewed_goods.NAME}» в избранное" href="{FAVORITES_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" href="{FAVORITES_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-heart"></i></a> {% ENDIF %} <!-- END Если есть возможность добавить товар в избранное --> <!-- Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> {% IF TARIFF_FEATURE_GOODS_COMPARE && SETTINGS_COMPARE_DISABLE=0 %} {% IF recently_viewed_goods.IS_HAS_IN_COMPARE_LIST %} <a class="add-compare added" data-action-is-add="0" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" data-add-tooltip="В Сравнение" data-del-tooltip="Убрать из сравнения" data-tooltip="Убрать из сравнения" title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" href="{COMPARE_DELETE_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ELSE %} <a class="add-compare" data-action-is-add="1" data-action-add-url="{COMPARE_ADD_URL}" data-action-delete-url="{COMPARE_DELETE_URL}" data-action-add-title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" data-action-delete-title="Убрать «{recently_viewed_goods.NAME}» из списка сравнения с другими товарами" data-prodname="{recently_viewed_goods.NAME}" data-produrl="{recently_viewed_goods.URL}" data-id="{recently_viewed_goods.ID}" data-mod-id="{recently_viewed_goods.MIN_PRICE_NOW_ID}" data-add-tooltip="В Сравнение" data-del-tooltip="Убрать из сравнения" data-tooltip="В Сравнение" title="Добавить «{recently_viewed_goods.NAME}» в список сравнения с другими товарами" href="{COMPARE_ADD_URL}?id={recently_viewed_goods.MIN_PRICE_NOW_ID}&from={recently_viewed_goods.GOODS_FROM}&return_to={CURRENT_URL | urlencode}" ><i class="fa fa-retweet"></i></a> {% ENDIF %} {% ENDIF %} <!-- END Если в тарифном плане подключен модуль сравнения товаров и он не выключен в настройках магазина --> </div> </div> </div> </div> </div> <div class="product-shop"> <meta itemprop="name" content="{recently_viewed_goods.NAME}"> <meta itemprop="description" content="{% IF recently_viewed_goods.DESCRIPTION_SHORT %}{recently_viewed_goods.DESCRIPTION_SHORT}{% ELSE %}Описание отсутствует{% ENDIF %}"> <div class="product-name"><a href="{recently_viewed_goods.URL_MIN_PRICE_NOW | url_amp}" title="{recently_viewed_goods.NAME}" itemprop="url">{recently_viewed_goods.NAME}</a></div> <div class="av"> Наличие товара: {% IF recently_viewed_goods.MAX_REST_VALUE=0 %}<span class="false">Нет в наличии</span>{% ELSE %}<span class="true">В наличии</span>{% ENDIF %} </div> <!-- Выводим бренд --> {% IFNOT recently_viewed_goods.goods_attr_list_empty %} <div class="attr-list"> {% FOR goods_attr_list %}{% IF recently_viewed_goods.goods_attr_list.NAME = Бренд %} <div class="attr"> <span class="name">{recently_viewed_goods.goods_attr_list.NAME}:</span> <span class="value">{recently_viewed_goods.goods_attr_list.VALUE}</span> </div> {% ENDIF %}{% ENDFOR %} </div> {% ENDIF %} <div class="price-box" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <meta itemprop="priceCurrency" content="{CURRENCY_CHAR_CODE}"/> {% IF recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>recently_viewed_goods.MIN_PRICE_NOW %} <span class="price old-price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT | money_format}</span> {% ELSEIF recently_viewed_goods.MIN_PRICE_OLD>recently_viewed_goods.MIN_PRICE_NOW %} <span class="price old-price {CURRENCY_CHAR_CODE}">{recently_viewed_goods.MIN_PRICE_OLD | money_format}</span> {% ENDIF %} <span class="price {CURRENCY_CHAR_CODE}" itemprop="price" content="{recently_viewed_goods.MIN_PRICE_NOW}">{recently_viewed_goods.MIN_PRICE_NOW | money_format}</span> </div> <div class="addtocart"> {% IF recently_viewed_goods.MAX_REST_VALUE>0 %} <a class="add-cart button button2" title="В корзину" data-tooltip="В корзину">Добавить в корзину</a> {% ELSE %} <a class="button" onclick="document.location = '/feedback/?form[feedback_message]=Могли бы Вы уведомить меня о наличии товара «{recently_viewed_goods.NAME}»?'; return false;" / >Узнать о поступлении</a> {% ENDIF %} </div> </div> </form> </div> </div> {% ENDFOR %} </div> </div> </div> {% ENDIF %}
В main.js найдите:
// Сопутствующие товары jQuery(function($) { var carouselU = $('.related-goods .products-grid'); carouselU.owlCarousel({ items: 4, itemsDesktop: [1199,3], itemsDesktopSmall: [991,2], itemsTablet: [767,2], itemsTabletSmall: [641,1], itemsMobile: [481,1], responsive: true, responsiveRefreshRate : 200, responsiveBaseWidth: window, lazyLoad: true, pagination: false, itemsScaleUp: true, slideSpeed: 800, stopOnHover: true, touchDrag: false, mouseDrag: false, autoPlay: false, addClassActive: true, autoHeight: false, afterAction: function (e) { if(this.$owlItems.length > this.options.items){ $('.related-goods .navigation').show(); }else{ $('.related-goods .navigation').hide(); $('.related-goods .owl-carousel .owl-item').css("max-width", "300px"); } } }); jQuery('.related-goods .navigation .prev').on('click', function(e){ e.preventDefault(); carouselU.trigger('owl.prev'); }); jQuery('.related-goods .navigation .next').on('click', function(e){ e.preventDefault(); carouselU.trigger('owl.next'); }); });
после него пропишите:
// Недавно просмотренные jQuery(function($) { var carouselU = $('.recently_viewed_goods .products-grid'); carouselU.owlCarousel({ items: 4, itemsDesktop: [1199,3], itemsDesktopSmall: [991,2], itemsTablet: [767,2], itemsTabletSmall: [641,1], itemsMobile: [481,1], responsive: true, responsiveRefreshRate : 200, responsiveBaseWidth: window, lazyLoad: true, pagination: false, itemsScaleUp: true, slideSpeed: 800, stopOnHover: true, touchDrag: false, mouseDrag: false, autoPlay: false, addClassActive: true, autoHeight: false, afterAction: function (e) { if(this.$owlItems.length > this.options.items){ $('.recently_viewed_goods .navigation').show(); }else{ $('.recently_viewed_goods .navigation').hide(); $('.recently_viewed_goods .owl-carousel .owl-item').css("max-width", "300px"); } } }); jQuery('.recently_viewed_goods .navigation .prev').on('click', function(e){ e.preventDefault(); carouselU.trigger('owl.prev'); }); jQuery('.recently_viewed_goods .navigation .next').on('click', function(e){ e.preventDefault(); carouselU.trigger('owl.next'); }); });
Результат:
Воблер Baker RGD 2 crankbait 57 floating 14 г T007.png
Все как всегда замечательно
Только вот в карточке товара пропал слайдер "С этим товаром смотрят"(
#4
Отправлено 01 Октябрь 2017 - 15:57
- С ЭТИМ ТОВАРОМ СМОТРЯТ
- Недавно просмотренные
#5
Отправлено 03 Октябрь 2017 - 16:45
Ribka (01 Октябрь 2017 - 15:57) писал:
- С ЭТИМ ТОВАРОМ СМОТРЯТ
- Недавно просмотренные
Сейчас оба слайдера должны отображаться в карточке товара.
#6
Отправлено 03 Октябрь 2017 - 22:54
В разделе Настройки - Основные активировал пункт "Не скрывать блок «С этим товаром смотрели», если у товара есть сопутствующие товары"
Сейчас оба слайдера должны отображаться в карточке товара.
[/Цитата]
просмотрела несколько товаров,у всех аналогичная https://prnt.sc/gsw25e картина
Mr.Nito (03 Октябрь 2017 - 16:45) писал:
Сейчас оба слайдера должны отображаться в карточке товара.
просмотрела несколько товаров,у всех аналогичная https://prnt.sc/gsw25e картина
#7
Отправлено 04 Октябрь 2017 - 08:10
У вас отсутствует часть изменений по инструкции выше в шаблоне Товар, сохраните их пожалуйста. Товары "С этим товаром смотрят" у вас отображаются.
#8
Отправлено 05 Октябрь 2017 - 23:10
Vaccina (04 Октябрь 2017 - 08:10) писал:
У вас отсутствует часть изменений по инструкции выше в шаблоне Товар, сохраните их пожалуйста. Товары "С этим товаром смотрят" у вас отображаются.
Внесла часть изменений. и что то я совсем запуталась https://prnt.sc/gtrd7i
#9
Отправлено 06 Октябрь 2017 - 05:29
Зайдите в раздел Сайт - Редактор шаблонов - Товар - найдите:
{% IFNOT goods_images_empty %}С ЭТИМ ТОВАРОМ СМОТРЯТ <div class="goodsImageList" style="display: none;"> {% FOR goods_images %} <a href="{goods_images.LARGE}" data="{goods_images.ID}" title="{goods_images.NAME}" rel="gallery"><img src="{goods_images.ICON}" alt="{goods_images.NAME}" /></a> {% ENDFOR %} </div> {% ENDIF %}
замените на:
{% IFNOT goods_images_empty %} <div class="goodsImageList" style="display: none;"> {% FOR goods_images %} <a href="{goods_images.LARGE}" data="{goods_images.ID}" title="{goods_images.NAME}" rel="gallery"><img src="{goods_images.ICON}" alt="{goods_images.NAME}" /></a> {% ENDFOR %} </div> {% ENDIF %}
Блок недавно просмотренных товаров и с этим товаром смотрят отображается и работает у вас сейчас корректно.
#10
Отправлено 03 Ноябрь 2017 - 16:52
#11
Отправлено 03 Ноябрь 2017 - 17:12
f1ame (03 Ноябрь 2017 - 16:52) писал:
В шаблоне html найдите и удалите код
<!-- Вы смотрели --> {% IFNOT recently_viewed_goods_empty %} <div class="block viewed"> <h4 class="title">Вы смотрели</h4> <div class="content"> <ul class="viewed-items"> {% FOR recently_viewed_goods %} {% IF recently_viewed_goods.index > 5 %}{break}{% ENDIF %} <div class="item"> <div class="item-inner" itemscope itemtype="https://schema.org/Product"> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{recently_viewed_goods.MIN_PRICE_NOW_ID} goodsListForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{recently_viewed_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{recently_viewed_goods.MIN_PRICE_NOW_ID}" /> <meta itemprop="name" content="{recently_viewed_goods.NAME}"> <meta itemprop="description" content="{% IF recently_viewed_goods.DESCRIPTION_SHORT %}{recently_viewed_goods.DESCRIPTION_SHORT}{% ELSE %}Описание отсутствует{% ENDIF %}"> <div class="product-img"> <a href="{recently_viewed_goods.URL_MIN_PRICE_NOW | url_amp}" title="{recently_viewed_goods.NAME}" itemprop="url"> <img src="{% IF recently_viewed_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=sunrise{% ELSE %}{recently_viewed_goods.IMAGE_ICON}{% ENDIF %}" class="goods-image-icon" alt="{recently_viewed_goods.NAME}" title="{recently_viewed_goods.NAME}" itemprop="image"> </a> </div> <div class="product-name"> <a href="{recently_viewed_goods.URL_MIN_PRICE_NOW | url_amp}" title="{recently_viewed_goods.NAME}" itemprop="url"> <span>{recently_viewed_goods.NAME}</span> </a> </div> <div class="rating-box"> {% IF recently_viewed_goods.OPINION_RATING_VALUE %} <span itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating"> <meta itemprop="worstRating" content = "1"> <meta itemprop="bestRating" content = "10"> <meta itemprop="ratingValue" content = "{recently_viewed_goods.OPINION_RATING_VALUE}"> <meta itemprop="reviewCount" content = "{recently_viewed_goods.OPINION_RATING_CNT_ALL}"> <div class="rating" style="width:{recently_viewed_goods.OPINION_RATING_VALUE}0%" alt="{recently_viewed_goods.OPINION_RATING_VALUE}" title="Рейтинг товара"></div> </span> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён" title="Рейтинг не определён"></div> {% ENDIF %} </div> <div class="price-box" itemprop="offers" itemscope itemtype="https://schema.org/Offer"> <meta itemprop="priceCurrency" content="{CURRENCY_CHAR_CODE}"/> <span class="price {CURRENCY_CHAR_CODE}" itemprop="price" content="{recently_viewed_goods.MIN_PRICE_NOW}">{recently_viewed_goods.MIN_PRICE_NOW | money_format}</span> </div> </form> </div> </div> {% ENDFOR %} </ul> </div> </div> {% ENDIF %} <!-- /END Вы смотрели -->Так же найдите код
{BODY}и после него вставьте
{% IF MOD_LNAME = catalog || MOD_LNAME = user && ACT= settings || MOD_LNAME = user && ACT= favorites || MOD_LNAME = user && ACT= history_list || MOD_LNAME = discount || MOD_LNAME = search || MOD_LNAME = news %} <!-- Вы смотрели --> {% IFNOT recently_viewed_goods_empty %} <div class="block viewed"> <h4 class="title">Вы смотрели</h4> <div class="content"> <ul class="viewed-items"> {% FOR recently_viewed_goods %} {% IF recently_viewed_goods.index > 5 %}{break}{% ENDIF %} <div class="item"> <div class="item-inner" itemscope itemtype="https://schema.org/Product"> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{recently_viewed_goods.MIN_PRICE_NOW_ID} goodsListForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{recently_viewed_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{recently_viewed_goods.MIN_PRICE_NOW_ID}" /> <meta itemprop="name" content="{recently_viewed_goods.NAME}"> <meta itemprop="description" content="{% IF recently_viewed_goods.DESCRIPTION_SHORT %}{recently_viewed_goods.DESCRIPTION_SHORT}{% ELSE %}Описание отсутствует{% ENDIF %}"> <div class="product-img"> <a href="{recently_viewed_goods.URL_MIN_PRICE_NOW | url_amp}" title="{recently_viewed_goods.NAME}" itemprop="url"> <img src="{% IF recently_viewed_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=sunrise{% ELSE %}{recently_viewed_goods.IMAGE_ICON}{% ENDIF %}" class="goods-image-icon" alt="{recently_viewed_goods.NAME}" title="{recently_viewed_goods.NAME}" itemprop="image"> </a> </div> <div class="product-name"> <a href="{recently_viewed_goods.URL_MIN_PRICE_NOW | url_amp}" title="{recently_viewed_goods.NAME}" itemprop="url"> <span>{recently_viewed_goods.NAME}</span> </a> </div> <div class="rating-box"> {% IF recently_viewed_goods.OPINION_RATING_VALUE %} <span itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating"> <meta itemprop="worstRating" content = "1"> <meta itemprop="bestRating" content = "10"> <meta itemprop="ratingValue" content = "{recently_viewed_goods.OPINION_RATING_VALUE}"> <meta itemprop="reviewCount" content = "{recently_viewed_goods.OPINION_RATING_CNT_ALL}"> <div class="rating" style="width:{recently_viewed_goods.OPINION_RATING_VALUE}0%" alt="{recently_viewed_goods.OPINION_RATING_VALUE}" title="Рейтинг товара"></div> </span> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён" title="Рейтинг не определён"></div> {% ENDIF %} </div> <div class="price-box" itemprop="offers" itemscope itemtype="https://schema.org/Offer"> <meta itemprop="priceCurrency" content="{CURRENCY_CHAR_CODE}"/> <span class="price {CURRENCY_CHAR_CODE}" itemprop="price" content="{recently_viewed_goods.MIN_PRICE_NOW}">{recently_viewed_goods.MIN_PRICE_NOW | money_format}</span> </div> </form> </div> </div> {% ENDFOR %} </ul> </div> </div> {% ENDIF %} <!-- /END Вы смотрели --> {% ENDIF %}В main.css найдите код
/*** Левая часть ***/ .col-left .block {margin-bottom: 30px;} .col-left .block > .title {background: #e3e1d5;margin-bottom: 15px;padding: 0 15px;text-align: center;height: 50px;line-height: 50px;font-size: 21px;color: #8C2C29;} .col-left .block > .title a {color: #8C2C29;}и замените на
/*** Левая часть ***/ .col-left .block {margin-bottom: 30px;} .col-left .block > .title, .block.viewed > .title {background: #e3e1d5;margin-bottom: 15px;padding: 0 15px;text-align: center;height: 50px;line-height: 50px;font-size: 21px;color: #8C2C29;} .col-left .block > .title a, .block.viewed > .title a{color: #8C2C29;}
Количество пользователей, читающих эту тему: 0
0 пользователей, 0 гостей, 0 анонимных