Перенос Кнопки "в Корзину"
#1
Отправлено 02 Апрель 2016 - 10:54
#2
Отправлено 03 Апрель 2016 - 10:39
Ильяc (02 Апрель 2016 - 10:54) писал:
кнопка.png
Здравствуйте. На данном аккаунте кнопка "в корзину" уже расположена, как Вы указываете. Правильно ли я понимаю, что вопрос уже не актуален?
#3
Отправлено 11 Апрель 2016 - 19:58
#5
Отправлено 11 Апрель 2016 - 20:32
Ильяc (11 Апрель 2016 - 20:22) писал:
Здравствуйте. В шаблоне main.css найдите строку:
.ajax-buttons .button {margin:0 0 10px 0; background: ffdb4d;}замените ее на:
.ajax-buttons .button {margin:0 0 10px 0; background: #ffdb4d; border: 1px solid #cbad33;} .ajax-buttons .button:hover {background: #ff5f1f;color:#fff;}
#6
Отправлено 11 Апрель 2016 - 20:35
RedHead (11 Апрель 2016 - 20:32) писал:
.ajax-buttons .button {margin:0 0 10px 0; background: ffdb4d;}замените ее на:
.ajax-buttons .button {margin:0 0 10px 0; background: #ffdb4d; border: 1px solid #cbad33;} .ajax-buttons .button:hover {background: #ff5f1f;color:#fff;}
1.jpg
А теперь можно еще в корзине 2 кнопки поменять на такой цвет?
#7
Отправлено 11 Апрель 2016 - 20:45
Ильяc (11 Апрель 2016 - 20:35) писал:
В шаблоне main.css найдите строки:
.ajax-buttons .button {margin:0 0 10px 0; background: #ffdb4d; border: 1px solid #cbad33;} .ajax-buttons .button:hover {background: #ff5f1f;color:#fff;}
замените их на:
.ajax-buttons .button, .buttons .left a, .buttons .right a {margin:0 0 10px 0; background: #ffdb4d; border: 1px solid #cbad33;} .ajax-buttons .button:hover, .buttons .left a:hover, .buttons .right a:hover {background: #ff5f1f;color:#fff;}
#9
Отправлено 12 Апрель 2016 - 17:40
Ильяc (12 Апрель 2016 - 16:57) писал:
слайд.png
Здравствуйте! На данный момент у Вас слайдер скрыт. Если Вы имеете ввиду, уменьшить его размеры, то в шаблоне html найдите строку:
<div id="slideshow" class="wrap" style="display:none;"/>замените ее на:
<div id="slideshow" class="wrap" />
Затем, в шаблоне main.js найдите строку:
jssor_slider1.$SetScaleWidth(Math.min(bodyWidth, 1920));замените ее на:
jssor_slider1.$SetScaleWidth(Math.min(bodyWidth, 1170));
Результат:
#10
Отправлено 12 Апрель 2016 - 17:55
RedHead (12 Апрель 2016 - 17:40) писал:
<div id="slideshow" class="wrap" style="display:none;"/>замените ее на:
<div id="slideshow" class="wrap" />
Затем, в шаблоне main.js найдите строку:
jssor_slider1.$SetScaleWidth(Math.min(bodyWidth, 1920));замените ее на:
jssor_slider1.$SetScaleWidth(Math.min(bodyWidth, 1170));
Результат:
1.jpg
Отлично! Спасибо, то что нужно. Еще можно исправить функцию "показать еще" сейчас сразу все товары видны когда открываешь главную страницу, можно сделать по умолчанию, чтобы часть была скрыта и раскрывалась при нажатии на кнопку "показать еще"
#11
Отправлено 12 Апрель 2016 - 18:53
Ильяc (12 Апрель 2016 - 17:55) писал:
Внесли Вам небольшие правки для слайдера в шаблоне main.css: строки:
#slider {position: relative; margin: 0 auto;top: 0px; left: 0px; width: 1170px; height: 347px; overflow: hidden;z-index:1;} .slides_container {cursor: move; position: absolute; left: 0px; top: 0px; width: 1170px;height: 347px; overflow: hidden;}
изменили размер слайдера, чтобы он при перезагрузке страницы оставался с нужными размерами.
На вопрос о функции "показать еще" , Вам ответят чуть позже.
#12
Отправлено 12 Апрель 2016 - 19:20
RedHead (12 Апрель 2016 - 18:53) писал:
#slider {position: relative; margin: 0 auto;top: 0px; left: 0px; width: 1170px; height: 347px; overflow: hidden;z-index:1;} .slides_container {cursor: move; position: absolute; left: 0px; top: 0px; width: 1170px;height: 347px; overflow: hidden;}
изменили размер слайдера, чтобы он при перезагрузке страницы оставался с нужными размерами.
На вопрос о функции "показать еще" , Вам ответят чуть позже.
Спасибо большое! А я думал что так и должно быть)
#13
Отправлено 15 Апрель 2016 - 16:36
#14
Отправлено 15 Апрель 2016 - 18:15
Ильяc (15 Апрель 2016 - 16:36) писал:
Здравствуйте.
К сожалению сделать отдельную функцию по отправке почты не получится.
Как вариант, Вы можете использовать один из статусов смс оповещения (например, Согласовано) и внести свой текст в шаблон смс, после изменения статуса на "Доставлено" Вам нужно будет изменить статус на "Согласовано" и клиенту отправится смс сообщение с просьбой оставить отзыв на Яндекс маркете.
#15
Отправлено 16 Апрель 2016 - 10:21
RedHead (12 Апрель 2016 - 18:53) писал:
#slider {position: relative; margin: 0 auto;top: 0px; left: 0px; width: 1170px; height: 347px; overflow: hidden;z-index:1;} .slides_container {cursor: move; position: absolute; left: 0px; top: 0px; width: 1170px;height: 347px; overflow: hidden;}
изменили размер слайдера, чтобы он при перезагрузке страницы оставался с нужными размерами.
На вопрос о функции "показать еще" , Вам ответят чуть позже.
Добрый день! Мне все еще не ответили по данному вопросу
#16
Отправлено 16 Апрель 2016 - 15:07
Ильяc (16 Апрель 2016 - 10:21) писал:
Здравствуйте. Извините за долгое ожидание. Перед внесением изменений, создайте бэкап шаблона.
1) В шаблоне main.css найдите строки:
.item.item-animate.show-addtocart:nth-child(1), .item.item-animate.show-addtocart:nth-child(2), .item.item-animate.show-addtocart:nth-child(3), .item.item-animate.show-addtocart:nth-child(4), .item.item-animate.show-addtocart:nth-child(5), .item.item-animate.show-addtocart:nth-child(6), .item.item-animate.show-addtocart:nth-child(7), .item.item-animate.show-addtocart:nth-child(8), .item.item-animate.show-addtocart:nth-child(9), .item.item-animate.show-addtocart:nth-child(10), .item.item-animate.show-addtocart:nth-child(11), .item.item-animate.show-addtocart:nth-child(12), .item.item-animate.show-addtocart:nth-child(13), .item.item-animate.show-addtocart:nth-child(14), .item.item-animate.show-addtocart:nth-child(15), .item.item-animate.show-addtocart:nth-child(16), .item.item-animate.show-addtocart:nth-child(17), .item.item-animate.show-addtocart:nth-child(18), .item.item-animate.show-addtocart:nth-child(19), .item.item-animate.show-addtocart:nth-child(20) {display:block;}
замените их на:
.item.item-animate.show-addtocart:nth-child(1), .item.item-animate.show-addtocart:nth-child(2), .item.item-animate.show-addtocart:nth-child(3), .item.item-animate.show-addtocart:nth-child(4), .item.item-animate.show-addtocart:nth-child(5), .item.item-animate.show-addtocart:nth-child(6), .item.item-animate.show-addtocart:nth-child(7), .item.item-animate.show-addtocart:nth-child(8) {display:block;}
2) В шаблоне main.js найдите строки:
//Функция показать больше для Товаров на главной $(function(){ var i = 0; $('.pdt_best_sales .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=20){$('.pdt_best_sales .showAllGoods').hide()} $('.pdt_best_sales .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_best_sales .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Показать все'); }else{ $('.pdt_best_sales .item.item-animate.show-addtocart').addClass('showThis'); $(this).text('Скрыть'); $(this).addClass('active'); } }) }); //Функция показать больше для Новинок $(function(){ var i = 0; $('.pdt_created_at .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=8){$('.pdt_created_at .showAllGoods').hide()} $('.pdt_created_at .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_created_at .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Показать все'); }else{ $('.pdt_created_at .item.item-animate.show-addtocart').addClass('showThis'); $(this).text('Скрыть'); $(this).addClass('active'); } }) }); //Функция показать больше для Хитов продаж $(function(){ var i = 0; $('.pdt_top_rating .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=8){$('.pdt_top_rating .showAllGoods').hide()} $('.pdt_top_rating .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_top_rating .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Показать все'); }else{ $('.pdt_top_rating .item.item-animate.show-addtocart').addClass('showThis'); $(this).text('Скрыть'); $(this).addClass('active'); } }) });
замените их на:
//Функция показать больше для Товаров на главной $(function(){ var i = 0; $('.pdt_best_sales .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=8){$('.pdt_best_sales .showAllGoods').hide()} $('.pdt_best_sales .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_best_sales .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Показать еще'); $(this).attr('title', 'Показать еще'); }else{ $('.pdt_best_sales .item.item-animate.show-addtocart').addClass('showThis'); $(this).addClass('active'); $(this).text('Скрыть'); $(this).attr('title', 'Скрыть'); } }) }); //Функция показать больше для Новинок $(function(){ var i = 0; $('.pdt_created_at .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=8){$('.pdt_created_at .showAllGoods').hide()} $('.pdt_created_at .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_created_at .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Загрузить все'); $(this).attr('title', 'Загрузить все'); }else{ $('.pdt_created_at .item.item-animate.show-addtocart').addClass('showThis'); $(this).addClass('active'); $(this).text('Скрыть'); $(this).attr('title', 'Скрыть'); } }) }); //Функция показать больше для Хитов продаж $(function(){ var i = 0; $('.pdt_top_rating .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=8){$('.pdt_top_rating .showAllGoods').hide()} $('.pdt_top_rating .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_top_rating .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Загрузить все'); $(this).attr('title', 'Загрузить все'); }else{ $('.pdt_top_rating .item.item-animate.show-addtocart').addClass('showThis'); $(this).addClass('active'); $(this).text('Скрыть'); $(this).attr('title', 'Скрыть'); } }) });
3) Теперь, в шаблоне html найдите блок кода:
{% IFNOT index_page_goods_empty %} <div class="pdt-content tab-content-actived is-loaded pdt_best_sales"> <div class="pdt-list products-grid zoomOut play"> <div class="inner"> {% FOR index_page_goods %} <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{index_page_goods.MIN_PRICE_NOW_ID} goodsListForm"> <div class="item item-animate show-addtocart col-xs-3 col-lg-4 col-md-6 col-sm-12 {% IF index_page_goods.index> 8 %}load-animate{% ENDIF %}" itemscope itemtype="http://schema.org/Product"> <div class="item-inner clearfix"> <div class="item-img have-additional clearfix"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{index_page_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{index_page_goods.MIN_PRICE_NOW_ID}" /> {% IF index_page_goods.IS_NEW %} <span class="ico-product new">Новинка</span> {% ELSEIF index_page_goods.IS_TOP %} <span class="ico-product best">Популярное</span> {% ENDIF %} {% IF index_page_goods.MAX_DISCOUNT %} <span class="ico-product sale">Скидка</span> {% ENDIF %}
замените его на:
{% IFNOT index_page_goods_empty %} <div class="pdt-content tab-content-actived is-loaded pdt_best_sales"> <div class="pdt-list products-grid zoomOut play"> <div class="inner"> {% FOR index_page_goods %} <div class="item item-animate show-addtocart col-xs-3 col-lg-4 col-md-6 col-sm-12 {% IF index_page_goods.index> 8 %}load-animate{% ENDIF %}" itemscope itemtype="http://schema.org/Product"> <div class="item-inner clearfix"> <div class="item-img have-additional clearfix"> {% IF index_page_goods.IS_NEW %} <span class="ico-product new">Новинка</span> {% ELSEIF index_page_goods.IS_TOP %} <span class="ico-product best">Популярное</span> {% ENDIF %} {% IF index_page_goods.MAX_DISCOUNT %} <span class="ico-product sale">Скидка</span> {% ENDIF %} <div class="item-img-info"> <a href="{index_page_goods.URL_MIN_PRICE_NOW | url_amp}" title="{index_page_goods.NAME}" class="product-image"> <span class="img-main"> <img src="{% IF index_page_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=azure{% ELSE %}{index_page_goods.IMAGE_MEDIUM}{% ENDIF %}" class="goods-image-small" alt="{index_page_goods.NAME}"> </span> </a>
Затем, найдите строки:
</form> {% ENDFOR %} <div class="pdt-loadmore"> <div class="button btn-loadmore showAllGoods"><span>Показать еще</span></div>
замените их на:
{% ENDFOR %} <div class="pdt-loadmore"> <div class="button btn-loadmore showAllGoods"><span>Показать еще</span></div>
Затем, блок кода:
<div class="item-info"> <div class="info-inner"> <div class="item-title"> <a href="{index_page_goods.URL_MIN_PRICE_NOW | url_amp}" title="{index_page_goods.NAME}" itemprop="name">{index_page_goods.NAME}</a> <meta itemprop="description" content="{% IF index_page_goods.DESCRIPTION_SHORT %}{index_page_goods.DESCRIPTION_SHORT}{% ELSE %}Описание отсутствует{% ENDIF %}"> </div> <div class="item-content"> <div class="item-price"> <div class="price-box" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <!-- информация для поисковика о валюте товара --> <meta itemprop="priceCurrency" content="{CURRENCY_CHAR_CODE}"/> {% IF index_page_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>index_page_goods.MIN_PRICE_NOW %} <p class="old-price"> <span class="price">{index_page_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT}</span> </p> {% ELSEIF index_page_goods.MIN_PRICE_OLD>index_page_goods.MIN_PRICE_NOW %} <p class="old-price"> <span class="price">{index_page_goods.MIN_PRICE_OLD}</span> </p> {% ENDIF %} <p class="special-price"> <span class="price" itemprop="price">{index_page_goods.MIN_PRICE_NOW}</span> </p> </div> </div> <div class="rating"> <div class="ratings"> <div class="spk-good-rating" shop-id="4ba156e59a2fb095321234" good-id="{index_page_goods.ID}" good-url="{index_page_goods.URL}" ></div> <div class="rating-box" itemscope itemtype="http://schema.org/AggregateRating"> {% IF index_page_goods.OPINION_RATING_VALUE %} <meta itemprop="worstRating" content = "1"> <meta itemprop="bestRating" content = "10"> <meta itemprop="ratingValue" content = "{index_page_goods.OPINION_RATING_VALUE}"> <div class="rating" style="width:{index_page_goods.OPINION_RATING_VALUE}0%" alt="{index_page_goods.OPINION_RATING_VALUE}"></div> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён"></div> {% ENDIF %} </div> </div> </div> <br><br><br> <div class="cart-wrap"> <div class="cart"> <a id="button-cart" class="add-cart button btn-cart" {% IF index_page_goods.MAX_REST_VALUE>0 %}style="display:none;"{% ENDIF %} onclick="if($(this).text() == 'Предзаказ') { document.location = '/feedback/?form[feedback_message]=Могли бы Вы уведомить меня о наличии товара «{index_page_goods.NAME}»?' } return false;" title="Положить «{index_page_goods.NAME}» в корзину"/ >Предзаказ</a> <a class="add-cart btn-cart button btn-addto" title="В корзину" {% IF SETTINGS_GOODS_DONT_PUT_TO_CART_MORE_THAN_AVAILABLE %}{% IF index_page_goods.MAX_REST_VALUE=0 %}style="display:none;"{% ENDIF %}{% ENDIF %}>В корзину</a> </div> </div> </div> </div> </div>
замените на:
<form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{index_page_goods.MIN_PRICE_NOW_ID} goodsListForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{index_page_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{index_page_goods.MIN_PRICE_NOW_ID}" /> <div class="item-info"> <div class="info-inner"> <div class="item-title"> <a href="{index_page_goods.URL_MIN_PRICE_NOW | url_amp}" title="{index_page_goods.NAME}" itemprop="name">{index_page_goods.NAME}</a> <meta itemprop="description" content="{% IF index_page_goods.DESCRIPTION_SHORT %}{index_page_goods.DESCRIPTION_SHORT}{% ELSE %}Описание отсутствует{% ENDIF %}"> </div> <div class="item-content"> <div class="item-price"> <div class="price-box" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <!-- информация для поисковика о валюте товара --> <meta itemprop="priceCurrency" content="{CURRENCY_CHAR_CODE}"/> {% IF index_page_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>index_page_goods.MIN_PRICE_NOW %} <p class="old-price"> <span class="price">{index_page_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT}</span> </p> {% ELSEIF index_page_goods.MIN_PRICE_OLD>index_page_goods.MIN_PRICE_NOW %} <p class="old-price"> <span class="price">{index_page_goods.MIN_PRICE_OLD}</span> </p> {% ENDIF %} <p class="special-price"> <span class="price" itemprop="price">{index_page_goods.MIN_PRICE_NOW}</span> </p> </div> </div> <div class="rating"> <div class="ratings"> <div class="spk-good-rating" shop-id="4ba156e59a2fb095321234" good-id="{index_page_goods.ID}" good-url="{index_page_goods.URL}" ></div> <div class="rating-box" itemscope itemtype="http://schema.org/AggregateRating"> {% IF index_page_goods.OPINION_RATING_VALUE %} <meta itemprop="worstRating" content = "1"> <meta itemprop="bestRating" content = "10"> <meta itemprop="ratingValue" content = "{index_page_goods.OPINION_RATING_VALUE}"> <div class="rating" style="width:{index_page_goods.OPINION_RATING_VALUE}0%" alt="{index_page_goods.OPINION_RATING_VALUE}"></div> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён"></div> {% ENDIF %} </div> </div> </div> <br><br><br> <div class="cart-wrap"> <div class="cart"> <a id="button-cart" class="add-cart button btn-cart" {% IF index_page_goods.MAX_REST_VALUE>0 %}style="display:none;"{% ENDIF %} onclick="if($(this).text() == 'Предзаказ') { document.location = '/feedback/?form[feedback_message]=Могли бы Вы уведомить меня о наличии товара «{index_page_goods.NAME}»?' } return false;" title="Положить «{index_page_goods.NAME}» в корзину"/ >Предзаказ</a> <a class="add-cart btn-cart button btn-addto" title="В корзину" {% IF SETTINGS_GOODS_DONT_PUT_TO_CART_MORE_THAN_AVAILABLE %}{% IF index_page_goods.MAX_REST_VALUE=0 %}style="display:none;"{% ENDIF %}{% ENDIF %}>В корзину</a> </div> </div> </div> </div> </div> </form>
Товары на главной будут отображаться корректно, кнопка будет работать. Проделайте, пожалуйста, данную инструкцию. Чтобы не запутаться, для новинок и хитов выполним инструкцию в следующем письме.
#17
Отправлено 20 Апрель 2016 - 17:51
RedHead (16 Апрель 2016 - 15:07) писал:
1) В шаблоне main.css найдите строки:
.item.item-animate.show-addtocart:nth-child(1), .item.item-animate.show-addtocart:nth-child(2), .item.item-animate.show-addtocart:nth-child(3), .item.item-animate.show-addtocart:nth-child(4), .item.item-animate.show-addtocart:nth-child(5), .item.item-animate.show-addtocart:nth-child(6), .item.item-animate.show-addtocart:nth-child(7), .item.item-animate.show-addtocart:nth-child(8), .item.item-animate.show-addtocart:nth-child(9), .item.item-animate.show-addtocart:nth-child(10), .item.item-animate.show-addtocart:nth-child(11), .item.item-animate.show-addtocart:nth-child(12), .item.item-animate.show-addtocart:nth-child(13), .item.item-animate.show-addtocart:nth-child(14), .item.item-animate.show-addtocart:nth-child(15), .item.item-animate.show-addtocart:nth-child(16), .item.item-animate.show-addtocart:nth-child(17), .item.item-animate.show-addtocart:nth-child(18), .item.item-animate.show-addtocart:nth-child(19), .item.item-animate.show-addtocart:nth-child(20) {display:block;}
замените их на:
.item.item-animate.show-addtocart:nth-child(1), .item.item-animate.show-addtocart:nth-child(2), .item.item-animate.show-addtocart:nth-child(3), .item.item-animate.show-addtocart:nth-child(4), .item.item-animate.show-addtocart:nth-child(5), .item.item-animate.show-addtocart:nth-child(6), .item.item-animate.show-addtocart:nth-child(7), .item.item-animate.show-addtocart:nth-child(8) {display:block;}
2) В шаблоне main.js найдите строки:
//Функция показать больше для Товаров на главной $(function(){ var i = 0; $('.pdt_best_sales .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=20){$('.pdt_best_sales .showAllGoods').hide()} $('.pdt_best_sales .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_best_sales .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Показать все'); }else{ $('.pdt_best_sales .item.item-animate.show-addtocart').addClass('showThis'); $(this).text('Скрыть'); $(this).addClass('active'); } }) }); //Функция показать больше для Новинок $(function(){ var i = 0; $('.pdt_created_at .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=8){$('.pdt_created_at .showAllGoods').hide()} $('.pdt_created_at .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_created_at .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Показать все'); }else{ $('.pdt_created_at .item.item-animate.show-addtocart').addClass('showThis'); $(this).text('Скрыть'); $(this).addClass('active'); } }) }); //Функция показать больше для Хитов продаж $(function(){ var i = 0; $('.pdt_top_rating .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=8){$('.pdt_top_rating .showAllGoods').hide()} $('.pdt_top_rating .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_top_rating .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Показать все'); }else{ $('.pdt_top_rating .item.item-animate.show-addtocart').addClass('showThis'); $(this).text('Скрыть'); $(this).addClass('active'); } }) });
замените их на:
//Функция показать больше для Товаров на главной $(function(){ var i = 0; $('.pdt_best_sales .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=8){$('.pdt_best_sales .showAllGoods').hide()} $('.pdt_best_sales .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_best_sales .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Показать еще'); $(this).attr('title', 'Показать еще'); }else{ $('.pdt_best_sales .item.item-animate.show-addtocart').addClass('showThis'); $(this).addClass('active'); $(this).text('Скрыть'); $(this).attr('title', 'Скрыть'); } }) }); //Функция показать больше для Новинок $(function(){ var i = 0; $('.pdt_created_at .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=8){$('.pdt_created_at .showAllGoods').hide()} $('.pdt_created_at .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_created_at .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Загрузить все'); $(this).attr('title', 'Загрузить все'); }else{ $('.pdt_created_at .item.item-animate.show-addtocart').addClass('showThis'); $(this).addClass('active'); $(this).text('Скрыть'); $(this).attr('title', 'Скрыть'); } }) }); //Функция показать больше для Хитов продаж $(function(){ var i = 0; $('.pdt_top_rating .item.item-animate.show-addtocart').each(function(){ i++; }) if(i<=8){$('.pdt_top_rating .showAllGoods').hide()} $('.pdt_top_rating .showAllGoods').on('click',function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); $('.pdt_top_rating .item.item-animate.show-addtocart').removeClass('showThis'); $(this).text('Загрузить все'); $(this).attr('title', 'Загрузить все'); }else{ $('.pdt_top_rating .item.item-animate.show-addtocart').addClass('showThis'); $(this).addClass('active'); $(this).text('Скрыть'); $(this).attr('title', 'Скрыть'); } }) });
3) Теперь, в шаблоне html найдите блок кода:
{% IFNOT index_page_goods_empty %} <div class="pdt-content tab-content-actived is-loaded pdt_best_sales"> <div class="pdt-list products-grid zoomOut play"> <div class="inner"> {% FOR index_page_goods %} <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{index_page_goods.MIN_PRICE_NOW_ID} goodsListForm"> <div class="item item-animate show-addtocart col-xs-3 col-lg-4 col-md-6 col-sm-12 {% IF index_page_goods.index> 8 %}load-animate{% ENDIF %}" itemscope itemtype="http://schema.org/Product"> <div class="item-inner clearfix"> <div class="item-img have-additional clearfix"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{index_page_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{index_page_goods.MIN_PRICE_NOW_ID}" /> {% IF index_page_goods.IS_NEW %} <span class="ico-product new">Новинка</span> {% ELSEIF index_page_goods.IS_TOP %} <span class="ico-product best">Популярное</span> {% ENDIF %} {% IF index_page_goods.MAX_DISCOUNT %} <span class="ico-product sale">Скидка</span> {% ENDIF %}
замените его на:
{% IFNOT index_page_goods_empty %} <div class="pdt-content tab-content-actived is-loaded pdt_best_sales"> <div class="pdt-list products-grid zoomOut play"> <div class="inner"> {% FOR index_page_goods %} <div class="item item-animate show-addtocart col-xs-3 col-lg-4 col-md-6 col-sm-12 {% IF index_page_goods.index> 8 %}load-animate{% ENDIF %}" itemscope itemtype="http://schema.org/Product"> <div class="item-inner clearfix"> <div class="item-img have-additional clearfix"> {% IF index_page_goods.IS_NEW %} <span class="ico-product new">Новинка</span> {% ELSEIF index_page_goods.IS_TOP %} <span class="ico-product best">Популярное</span> {% ENDIF %} {% IF index_page_goods.MAX_DISCOUNT %} <span class="ico-product sale">Скидка</span> {% ENDIF %} <div class="item-img-info"> <a href="{index_page_goods.URL_MIN_PRICE_NOW | url_amp}" title="{index_page_goods.NAME}" class="product-image"> <span class="img-main"> <img src="{% IF index_page_goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=azure{% ELSE %}{index_page_goods.IMAGE_MEDIUM}{% ENDIF %}" class="goods-image-small" alt="{index_page_goods.NAME}"> </span> </a>
Затем, найдите строки:
</form> {% ENDFOR %} <div class="pdt-loadmore"> <div class="button btn-loadmore showAllGoods"><span>Показать еще</span></div>
замените их на:
{% ENDFOR %} <div class="pdt-loadmore"> <div class="button btn-loadmore showAllGoods"><span>Показать еще</span></div>
Затем, блок кода:
<div class="item-info"> <div class="info-inner"> <div class="item-title"> <a href="{index_page_goods.URL_MIN_PRICE_NOW | url_amp}" title="{index_page_goods.NAME}" itemprop="name">{index_page_goods.NAME}</a> <meta itemprop="description" content="{% IF index_page_goods.DESCRIPTION_SHORT %}{index_page_goods.DESCRIPTION_SHORT}{% ELSE %}Описание отсутствует{% ENDIF %}"> </div> <div class="item-content"> <div class="item-price"> <div class="price-box" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <!-- информация для поисковика о валюте товара --> <meta itemprop="priceCurrency" content="{CURRENCY_CHAR_CODE}"/> {% IF index_page_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>index_page_goods.MIN_PRICE_NOW %} <p class="old-price"> <span class="price">{index_page_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT}</span> </p> {% ELSEIF index_page_goods.MIN_PRICE_OLD>index_page_goods.MIN_PRICE_NOW %} <p class="old-price"> <span class="price">{index_page_goods.MIN_PRICE_OLD}</span> </p> {% ENDIF %} <p class="special-price"> <span class="price" itemprop="price">{index_page_goods.MIN_PRICE_NOW}</span> </p> </div> </div> <div class="rating"> <div class="ratings"> <div class="spk-good-rating" shop-id="4ba156e59a2fb095321234" good-id="{index_page_goods.ID}" good-url="{index_page_goods.URL}" ></div> <div class="rating-box" itemscope itemtype="http://schema.org/AggregateRating"> {% IF index_page_goods.OPINION_RATING_VALUE %} <meta itemprop="worstRating" content = "1"> <meta itemprop="bestRating" content = "10"> <meta itemprop="ratingValue" content = "{index_page_goods.OPINION_RATING_VALUE}"> <div class="rating" style="width:{index_page_goods.OPINION_RATING_VALUE}0%" alt="{index_page_goods.OPINION_RATING_VALUE}"></div> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён"></div> {% ENDIF %} </div> </div> </div> <br><br><br> <div class="cart-wrap"> <div class="cart"> <a id="button-cart" class="add-cart button btn-cart" {% IF index_page_goods.MAX_REST_VALUE>0 %}style="display:none;"{% ENDIF %} onclick="if($(this).text() == 'Предзаказ') { document.location = '/feedback/?form[feedback_message]=Могли бы Вы уведомить меня о наличии товара «{index_page_goods.NAME}»?' } return false;" title="Положить «{index_page_goods.NAME}» в корзину"/ >Предзаказ</a> <a class="add-cart btn-cart button btn-addto" title="В корзину" {% IF SETTINGS_GOODS_DONT_PUT_TO_CART_MORE_THAN_AVAILABLE %}{% IF index_page_goods.MAX_REST_VALUE=0 %}style="display:none;"{% ENDIF %}{% ENDIF %}>В корзину</a> </div> </div> </div> </div> </div>
замените на:
<form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="product-form-{index_page_goods.MIN_PRICE_NOW_ID} goodsListForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{index_page_goods.GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{index_page_goods.MIN_PRICE_NOW_ID}" /> <div class="item-info"> <div class="info-inner"> <div class="item-title"> <a href="{index_page_goods.URL_MIN_PRICE_NOW | url_amp}" title="{index_page_goods.NAME}" itemprop="name">{index_page_goods.NAME}</a> <meta itemprop="description" content="{% IF index_page_goods.DESCRIPTION_SHORT %}{index_page_goods.DESCRIPTION_SHORT}{% ELSE %}Описание отсутствует{% ENDIF %}"> </div> <div class="item-content"> <div class="item-price"> <div class="price-box" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <!-- информация для поисковика о валюте товара --> <meta itemprop="priceCurrency" content="{CURRENCY_CHAR_CODE}"/> {% IF index_page_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT>index_page_goods.MIN_PRICE_NOW %} <p class="old-price"> <span class="price">{index_page_goods.MIN_PRICE_NOW_WITHOUT_DISCOUNT}</span> </p> {% ELSEIF index_page_goods.MIN_PRICE_OLD>index_page_goods.MIN_PRICE_NOW %} <p class="old-price"> <span class="price">{index_page_goods.MIN_PRICE_OLD}</span> </p> {% ENDIF %} <p class="special-price"> <span class="price" itemprop="price">{index_page_goods.MIN_PRICE_NOW}</span> </p> </div> </div> <div class="rating"> <div class="ratings"> <div class="spk-good-rating" shop-id="4ba156e59a2fb095321234" good-id="{index_page_goods.ID}" good-url="{index_page_goods.URL}" ></div> <div class="rating-box" itemscope itemtype="http://schema.org/AggregateRating"> {% IF index_page_goods.OPINION_RATING_VALUE %} <meta itemprop="worstRating" content = "1"> <meta itemprop="bestRating" content = "10"> <meta itemprop="ratingValue" content = "{index_page_goods.OPINION_RATING_VALUE}"> <div class="rating" style="width:{index_page_goods.OPINION_RATING_VALUE}0%" alt="{index_page_goods.OPINION_RATING_VALUE}"></div> {% ELSE %} <div class="rating" style="width:0%" alt="Рейтинг не определён"></div> {% ENDIF %} </div> </div> </div> <br><br><br> <div class="cart-wrap"> <div class="cart"> <a id="button-cart" class="add-cart button btn-cart" {% IF index_page_goods.MAX_REST_VALUE>0 %}style="display:none;"{% ENDIF %} onclick="if($(this).text() == 'Предзаказ') { document.location = '/feedback/?form[feedback_message]=Могли бы Вы уведомить меня о наличии товара «{index_page_goods.NAME}»?' } return false;" title="Положить «{index_page_goods.NAME}» в корзину"/ >Предзаказ</a> <a class="add-cart btn-cart button btn-addto" title="В корзину" {% IF SETTINGS_GOODS_DONT_PUT_TO_CART_MORE_THAN_AVAILABLE %}{% IF index_page_goods.MAX_REST_VALUE=0 %}style="display:none;"{% ENDIF %}{% ENDIF %}>В корзину</a> </div> </div> </div> </div> </div> </form>
Товары на главной будут отображаться корректно, кнопка будет работать. Проделайте, пожалуйста, данную инструкцию. Чтобы не запутаться, для новинок и хитов выполним инструкцию в следующем письме.
Все сделал как написано, но сайт совсем искажается
#20
Отправлено 20 Апрель 2016 - 19:07
Ильяc (20 Апрель 2016 - 18:39) писал:
Вам были внесены изменения для товаров на главной. Они стали показываться по 8 штук на страницу. Работали кнопки "свернуть" "Развернуть" "В корзину". Уточните, пожалуйста, почему Вы откатили изменения? Где была ошибка, или что Вас не устроило?
Количество пользователей, читающих эту тему: 0
0 пользователей, 0 гостей, 0 анонимных