Изменение Количества В Корзине
#1
Отправлено 26 Ноябрь 2013 - 18:05
#2
Отправлено 26 Ноябрь 2013 - 18:20
borisovd (26 Ноябрь 2013 - 18:05) писал:
Редактируем шаблон Корзина
Находим
<td class="cell3"> <input name="form[quantity][{cart_items.GOODS_MOD_ID}]" value="{cart_items.ORDER_LINE_QUANTITY}" /> {cart_items.GOODS_MOD_MEASURE_NAME} </td>
Заменяем на
<td class="cell3"> <input name="form[quantity][{cart_items.GOODS_MOD_ID}]" value="{cart_items.ORDER_LINE_QUANTITY}" class="number txtalgncnt" type="number" min="1" /> {cart_items.GOODS_MOD_MEASURE_NAME} </td>
#3
Отправлено 26 Ноябрь 2013 - 18:23
Castiel (26 Ноябрь 2013 - 18:20) писал:
Находим
<td class="cell3"> <input name="form[quantity][{cart_items.GOODS_MOD_ID}]" value="{cart_items.ORDER_LINE_QUANTITY}" /> {cart_items.GOODS_MOD_MEASURE_NAME} </td>
Заменяем на
<td class="cell3"> <input name="form[quantity][{cart_items.GOODS_MOD_ID}]" value="{cart_items.ORDER_LINE_QUANTITY}" class="number txtalgncnt" type="number" min="1" /> {cart_items.GOODS_MOD_MEASURE_NAME} </td>
И нужно запретить вписывать значение с клавиатуры
#5
Отправлено 26 Ноябрь 2013 - 18:55
#7
#8
Отправлено 27 Ноябрь 2013 - 02:54
#9
Отправлено 27 Ноябрь 2013 - 10:03
Сake (27 Ноябрь 2013 - 02:54) писал:
#10
Отправлено 27 Ноябрь 2013 - 12:46
borisovd (27 Ноябрь 2013 - 10:03) писал:
#11
Отправлено 28 Ноябрь 2013 - 05:04
#12
Отправлено 28 Ноябрь 2013 - 11:14
#13
Отправлено 29 Ноябрь 2013 - 00:29
#15
Отправлено 30 Ноябрь 2013 - 02:58
#16
Отправлено 30 Ноябрь 2013 - 14:26
Сake (30 Ноябрь 2013 - 02:58) писал:
#17
Отправлено 03 Декабрь 2013 - 05:17
$(function() { $('.cartFormTable .minus').click(function() { var product = $(this).closest('tr'); var product_box = parseInt(product.data('box')); if(!product_box) { $.get(product.find('.cell2 a.cartFormTbodyHeader').attr('href'), $.proxy(function(html) { var product = $(this).closest('tr'); if($(html).find('.goodsDataFormSubmitButton #quantity_wanted').length) { $(html).find('.goodsDataMainDeliveryBlock .goodsDataFeatures td').each(function() { if($.trim($(this).text()) === 'Количество в упаковке') { product.data('box', parseInt($.trim($(this).next().text()))); } }); if(parseInt(product.data('box'))) { $(this).trigger('click'); } } }, this)); return(false); } var input = $(this).parent().find('input'); var count = parseInt(input.val()) - product_box; count = count < product_box ? product_box : count; input.val(count); input.change(); return(false); }); $('.cartFormTable .plus').click(function() { var product = $(this).closest('tr'); var product_box = parseInt(product.data('box')); if(!product_box) { $.get(product.find('.cell2 a.cartFormTbodyHeader').attr('href'), $.proxy(function(html) { var product = $(this).closest('tr'); if($(html).find('.goodsDataFormSubmitButton #quantity_wanted').length) { $(html).find('.goodsDataMainDeliveryBlock .goodsDataFeatures td').each(function() { if($.trim($(this).text()) === 'Количество в упаковке') { product.data('box', parseInt($.trim($(this).next().text()))); } }); if(parseInt(product.data('box'))) { $(this).trigger('click'); } } }, this)); return(false); } var input = $(this).parent().find('input'); input.val(parseInt(input.val()) + product_box); input.change(); return(false); }); });
Кнопки minus, plus необходимо сделать видимыми.
#18
Отправлено 03 Декабрь 2013 - 12:15
Сake (03 Декабрь 2013 - 05:17) писал:
$(function() { $('.cartFormTable .minus').click(function() { var product = $(this).closest('tr'); var product_box = parseInt(product.data('box')); if(!product_box) { $.get(product.find('.cell2 a.cartFormTbodyHeader').attr('href'), $.proxy(function(html) { var product = $(this).closest('tr'); if($(html).find('.goodsDataFormSubmitButton #quantity_wanted').length) { $(html).find('.goodsDataMainDeliveryBlock .goodsDataFeatures td').each(function() { if($.trim($(this).text()) === 'Количество в упаковке') { product.data('box', parseInt($.trim($(this).next().text()))); } }); if(parseInt(product.data('box'))) { $(this).trigger('click'); } } }, this)); return(false); } var input = $(this).parent().find('input'); var count = parseInt(input.val()) - product_box; count = count < product_box ? product_box : count; input.val(count); input.change(); return(false); }); $('.cartFormTable .plus').click(function() { var product = $(this).closest('tr'); var product_box = parseInt(product.data('box')); if(!product_box) { $.get(product.find('.cell2 a.cartFormTbodyHeader').attr('href'), $.proxy(function(html) { var product = $(this).closest('tr'); if($(html).find('.goodsDataFormSubmitButton #quantity_wanted').length) { $(html).find('.goodsDataMainDeliveryBlock .goodsDataFeatures td').each(function() { if($.trim($(this).text()) === 'Количество в упаковке') { product.data('box', parseInt($.trim($(this).next().text()))); } }); if(parseInt(product.data('box'))) { $(this).trigger('click'); } } }, this)); return(false); } var input = $(this).parent().find('input'); input.val(parseInt(input.val()) + product_box); input.change(); return(false); }); });
Кнопки minus, plus необходимо сделать видимыми.
#19
Отправлено 04 Декабрь 2013 - 02:03
<script type="text/javascript" > $(document).ready(function() { $('.minus').click(function () { var $input = $(this).parent().find('input'); var count = parseInt($input.val()) - 1; count = count < 1 ? 1 : count; $input.val(count); $input.change(); return false; }); $('.plus').click(function () { var $input = $(this).parent().find('input'); $input.val(parseInt($input.val()) + 1); $input.change(); return false; }); }); </script>
далее найдите
<div class="nums"> <span class="minus">-</span> <input readonly="readonly" name="form[quantity][{cart_items.GOODS_MOD_ID}]" value="{cart_items.ORDER_LINE_QUANTITY}" class="number txtalgncnt" type="text" /> {cart_items.GOODS_MOD_MEASURE_NAME} <span class="plus">+</span> </div>
и замените на
<div class="nums"> <span class="minus">-</span> <input readonly="readonly" name="form[quantity][{cart_items.GOODS_MOD_ID}]" value="{cart_items.ORDER_LINE_QUANTITY}" class="number txtalgncnt" type="text" /> <span class="plus">+</span> {cart_items.GOODS_MOD_MEASURE_NAME} </div>
#20
Отправлено 04 Декабрь 2013 - 03:41
Сake (04 Декабрь 2013 - 02:03) писал:
<script type="text/javascript" > $(document).ready(function() { $('.minus').click(function () { var $input = $(this).parent().find('input'); var count = parseInt($input.val()) - 1; count = count < 1 ? 1 : count; $input.val(count); $input.change(); return false; }); $('.plus').click(function () { var $input = $(this).parent().find('input'); $input.val(parseInt($input.val()) + 1); $input.change(); return false; }); }); </script>
далее найдите
<div class="nums"> <span class="minus">-</span> <input readonly="readonly" name="form[quantity][{cart_items.GOODS_MOD_ID}]" value="{cart_items.ORDER_LINE_QUANTITY}" class="number txtalgncnt" type="text" /> {cart_items.GOODS_MOD_MEASURE_NAME} <span class="plus">+</span> </div>
и замените на
<div class="nums"> <span class="minus">-</span> <input readonly="readonly" name="form[quantity][{cart_items.GOODS_MOD_ID}]" value="{cart_items.ORDER_LINE_QUANTITY}" class="number txtalgncnt" type="text" /> <span class="plus">+</span> {cart_items.GOODS_MOD_MEASURE_NAME} </div>
И можно кнопки + и - сделать по высоте окна количества штук?или просто подставить стрелочки простые вверх и вниз?
И еще стала выскакивать js ошибка причем только если выбрать товар на слайдере на главной странице под большим банером....
На странице возникла JS ошибка:
Script error. на строке: 0.
Адрес файла:
Как исправить ошибку?
Не удалось найти решение для данной ошибки. Для решения проблемы исправьте javascript в разделе «Сайт» > «
Редактор тем».
Если необходимо помочь в решении данной ошибки, задайте вопрос в разделе "
Ошибки" на нашем форуме.
Количество пользователей, читающих эту тему: 0
0 пользователей, 0 гостей, 0 анонимных