Vaccina (02 Август 2013 - 02:15) писал:
<li class="goodsPageSubmitButtonBlock" {% IF GOODS_MOD_REST_VALUE=0 %}style="display:none;"{% ENDIF %}><a class="whtblue" onclick="$('.goodsDataForm').submit(); return false;" title="Положить «{GOODS_NAME}» в корзину" href="#">В корзину</a></li> <!-- Если в тарифном плане подключен модуль сравнения товаров --> {% IF TARIFF_FEATURE_GOODS_COMPARE %} <!-- Если не выключен модуль сравнения товаров, то покажем кнопку сравнения товаров --> {% IFNOT SETTINGS_COMPARE_DISABLE %} <li><a class="goodsDataCompareButton add whtblue" {% IF GOODS_MOD_IS_HAS_IN_COMPARE_LIST %}style="display:none;"{% ENDIF %} rel="{COMPARE_ADD_URL}?return_to={CURRENT_URL | urlencode}" title="Добавить «{GOODS_NAME}» к списку сравнения с другими товарами" href="#" >Сравнить товар</a></li> <li><a class="goodsDataCompareButton delete whtblue" {% IFNOT GOODS_MOD_IS_HAS_IN_COMPARE_LIST %}style="display:none;"{% ENDIF %} rel="{COMPARE_DELETE_URL}?return_to={CURRENT_URL | urlencode}" title="Убрать «{GOODS_NAME}» из списка сравнения с другими товарами" href="#" >Не сравнивать</a></li>
и вставьте перед данным блоком следующий код
<li class="goodsPageSubmitButtonBlock" style="float: left; width: 53px;"> <label style="display:none;" for="quantity_wanted_t">Количество :</label> <div class="numeric_input"> <input type="text" maxlength="12" title="Количество" value="1" id="quantity_wanted_t" name="form[goods_mod_quantity]" class="text_q pie" style="margin-left: 0px; margin-right: 4px;"> <div style="margin-left: 5px;margin-top: -1px; width:10px;"> <input type="button" style="background-color: transparent;" class="addone(1)"> <input type="button" onclick="addone(-1)" style="background-color: transparent;" class="down_button"> </div> </div> </li>
в файл main.js добавьте
function addone(obj, i) { var input = $(obj).closest('.numeric_input').find('.text_q'); input.val(parseInt(input.val())+i); if(parseInt(input.val()) <= 0) { input.val(1); } }
В файл стилей main.css добавьте
.goodsDataMainModificationDataBlock .block .right li { float: left; } input.text_q { border: 1px solid #E8E8E8; border-radius: 4px 4px 4px 4px; color: #CC0000; float: left; font: bold 12px Verdana,Geneva,sans-serif; height: 16px; margin: 2px; padding: 2px; position: relative; text-align: right; width: 20px; } .numeric_input div { float: left; width: 20px; } .up_button, .down_button { background-color: #FFFFFF; background-position: center center; background-repeat: no-repeat; border: 0 none; height: 10px; width: 10px; } .up_button { background-image: url("{ASSETS_IMAGES_PATH}bg_up.png"); } .down_button { background-image: url("{ASSETS_IMAGES_PATH}bg_down.png"); }
Изображения стрелок можете взять из сообщения http://forum.storela...__40#entry44560