Модификации В Столбик
#1
Отправлено 30 Март 2015 - 10:15
#2
Отправлено 30 Март 2015 - 10:32
Maksim3544 (30 Март 2015 - 10:15) писал:
Сделайте бэкап. Далее в шаблоне Товар найдите код:
{% FOR goods_modifications_properties %} <div class="attribute_fieldset goodsDataMainModificationsBlockProperty"> <!-- Выдаем списки со свойствами для модификаций, чтобы определить какую модификацию товара хочет пользователь --> {% FOR values %} <!-- Если это первый элемент в списке --> {% IF goods_modifications_properties.values.first %} <label class="attribute_label">{goods_modifications_properties.NAME}:</label> <div class="attribute_list"> <select name="form[properties][]" class="attribute_select"> {% ENDIF %} <option value="{goods_modifications_properties.values.ID}" {% IF goods_modifications_properties.values.SELECTED %}selected="selected"{% ENDIF %}>{goods_modifications_properties.values.NAME}</option> <!-- Если это последний элемент в списке --> {% IF goods_modifications_properties.values.last %} </select> </div> {% ENDIF %} {% ENDFOR %} </div> {% ENDFOR %}
и замените его на:
<table class="goods_modifications"> <thead> <td>Артикул</td> <td>Модификация</td> <td>Цвет</td> <td>Тип</td> <td>Вес</td> <td>Цена</td> <td>Ед.измерения</td> <td>Остаток</td> <td>Купить</td> </thead> <tbody> {% FOR goods_modifications %} <tr rel="{goods_modifications.PROPERTIES_SLUG}"> <td>{goods_modifications.ART_NUMBER}</td> <td class="mod_name"></td> <td>{goods_modifications.DESCRIPTION | htmlspecialchars_decode}</td> <td class="mod_type"></td> <td class="mod_measure"></td> <td>{goods_modifications.PRICE_NOW}</td> <td>{goods_modifications.MEASURE_NAME}</td> <td>{goods_modifications.REST_VALUE}</td> <td> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="goodsDataForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{goods_modifications.ID}" /> <input type="number" value="1" size="2" maxlength="5" class="quantity" name="form[goods_mod_quantity]"> <a class="more-link" onclick="$(this).closest('form').submit(); return false;" title="Положить «{GOODS_NAME}» в корзину" href="#">В корзину</a> </form> </td> </tr> {% ENDFOR %} </tbody> </table> <div class="goods_modifications_properties" style="display:none;"> {% FOR goods_modifications_properties %}{% FOR values %} <div rel="{goods_modifications_properties.values.ID}">{goods_modifications_properties.values.NAME}</div> {% ENDFOR %}{% ENDFOR %} </div> <div style="display:none;"> {% FOR goods_features %} {% IF goods_features.NAME=Тип %} <div class="type">{goods_features.VALUE}</div> {%ENDIF%} {% IF goods_features.NAME=Вес %} <div class="measure">{goods_features.VALUE}</div> {%ENDIF%} {%ENDFOR%} </div> <script> $('.type').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr .mod_type').html($(this).html()); }); $('.measure').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr .mod_measure').html($(this).html()); }); $('.goods_modifications_properties > div').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr[rel="' + mod_id + '"] .mod_name').html($(this).html()); }); </script>
#3
Отправлено 30 Март 2015 - 10:59
MikDark (30 Март 2015 - 10:32) писал:
{% FOR goods_modifications_properties %} <div class="attribute_fieldset goodsDataMainModificationsBlockProperty"> <!-- Выдаем списки со свойствами для модификаций, чтобы определить какую модификацию товара хочет пользователь --> {% FOR values %} <!-- Если это первый элемент в списке --> {% IF goods_modifications_properties.values.first %} <label class="attribute_label">{goods_modifications_properties.NAME}:</label> <div class="attribute_list"> <select name="form[properties][]" class="attribute_select"> {% ENDIF %} <option value="{goods_modifications_properties.values.ID}" {% IF goods_modifications_properties.values.SELECTED %}selected="selected"{% ENDIF %}>{goods_modifications_properties.values.NAME}</option> <!-- Если это последний элемент в списке --> {% IF goods_modifications_properties.values.last %} </select> </div> {% ENDIF %} {% ENDFOR %} </div> {% ENDFOR %}
и замените его на:
<table class="goods_modifications"> <thead> <td>Артикул</td> <td>Модификация</td> <td>Цвет</td> <td>Тип</td> <td>Вес</td> <td>Цена</td> <td>Ед.измерения</td> <td>Остаток</td> <td>Купить</td> </thead> <tbody> {% FOR goods_modifications %} <tr rel="{goods_modifications.PROPERTIES_SLUG}"> <td>{goods_modifications.ART_NUMBER}</td> <td class="mod_name"></td> <td>{goods_modifications.DESCRIPTION | htmlspecialchars_decode}</td> <td class="mod_type"></td> <td class="mod_measure"></td> <td>{goods_modifications.PRICE_NOW}</td> <td>{goods_modifications.MEASURE_NAME}</td> <td>{goods_modifications.REST_VALUE}</td> <td> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="goodsDataForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{goods_modifications.ID}" /> <input type="number" value="1" size="2" maxlength="5" class="quantity" name="form[goods_mod_quantity]"> <a class="more-link" onclick="$(this).closest('form').submit(); return false;" title="Положить «{GOODS_NAME}» в корзину" href="#">В корзину</a> </form> </td> </tr> {% ENDFOR %} </tbody> </table> <div class="goods_modifications_properties" style="display:none;"> {% FOR goods_modifications_properties %}{% FOR values %} <div rel="{goods_modifications_properties.values.ID}">{goods_modifications_properties.values.NAME}</div> {% ENDFOR %}{% ENDFOR %} </div> <div style="display:none;"> {% FOR goods_features %} {% IF goods_features.NAME=Тип %} <div class="type">{goods_features.VALUE}</div> {%ENDIF%} {% IF goods_features.NAME=Вес %} <div class="measure">{goods_features.VALUE}</div> {%ENDIF%} {%ENDFOR%} </div> <script> $('.type').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr .mod_type').html($(this).html()); }); $('.measure').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr .mod_measure').html($(this).html()); }); $('.goods_modifications_properties > div').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr[rel="' + mod_id + '"] .mod_name').html($(this).html()); }); </script>
#4
Отправлено 31 Март 2015 - 18:56
#5
Отправлено 05 Апрель 2015 - 19:42
#6
Отправлено 06 Апрель 2015 - 10:49
MikDark (30 Март 2015 - 10:32) писал:
#8
Отправлено 07 Апрель 2015 - 02:51
<table class="goods_modifications"> <thead> <td>Артикул</td> <td>Модификация</td> <td>Цвет</td> <td>Тип</td> <td>Вес</td> <td>Цена</td> <td>Ед.измерения</td> <td>Остаток</td> <td>Купить</td> </thead> <tbody> {% FOR goods_modifications %} <tr rel="{goods_modifications.PROPERTIES_SLUG}"> <td>{goods_modifications.ART_NUMBER}</td> <td class="mod_name"></td> <td>{goods_modifications.DESCRIPTION | htmlspecialchars_decode}</td> <td class="mod_type"></td> <td class="mod_measure"></td> <td>{goods_modifications.PRICE_NOW}</td> <td>{goods_modifications.MEASURE_NAME}</td> <td>{goods_modifications.REST_VALUE}</td> <td> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="goodsDataForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{goods_modifications.ID}" /> <input type="number" value="1" size="2" maxlength="5" class="quantity" name="form[goods_mod_quantity]"> <a class="more-link" onclick="$(this).closest('form').submit(); return false;" title="Положить «{GOODS_NAME}» в корзину" href="#">В корзину</a> </form> </td> </tr> {% ENDFOR %} </tbody> </table> <div class="goods_modifications_properties" style="display:none;"> {% FOR goods_modifications_properties %}{% FOR values %} <div rel="{goods_modifications_properties.values.ID}">{goods_modifications_properties.values.NAME}</div> {% ENDFOR %}{% ENDFOR %} </div> <div style="display:none;"> {% FOR goods_features %} {% IF goods_features.NAME=Тип %} <div class="type">{goods_features.VALUE}</div> {%ENDIF%} {% IF goods_features.NAME=Вес %} <div class="measure">{goods_features.VALUE}</div> {%ENDIF%} {%ENDFOR%} </div> <script> $('.type').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr .mod_type').html($(this).html()); }); $('.measure').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr .mod_measure').html($(this).html()); }); $('.goods_modifications_properties > div').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr[rel="' + mod_id + '"] .mod_name').html($(this).html()); }); </script>
замените на:
<table class="goods_modifications"> <thead> <td>Размер</td> <td>Купить</td> </thead> <tbody> {% FOR goods_modifications %} <tr rel="{goods_modifications.PROPERTIES_SLUG}"> <td class="mod_name"></td> <td> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="goodsDataForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{goods_modifications.ID}" /> <input type="number" value="1" size="2" maxlength="5" class="quantity" name="form[goods_mod_quantity]"> <a class="more-link" onclick="$(this).closest('form').submit(); return false;" title="Положить «{GOODS_NAME}» в корзину" href="#">В корзину</a> </form> </td> </tr> {% ENDFOR %} </tbody> </table> <div class="goods_modifications_properties" style="display:none;"> {% FOR goods_modifications_properties %}{% FOR values %} <div rel="{goods_modifications_properties.values.ID}">{goods_modifications_properties.values.NAME}</div> {% ENDFOR %}{% ENDFOR %} </div> <script> $('.goods_modifications_properties > div').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr[rel="' + mod_id + '"] .mod_name').html($(this).html()); }); </script>
кнопка покупки, к сожалению, необходима напротив каждой модификации
#9
Отправлено 07 Апрель 2015 - 09:26
Vaccina (07 Апрель 2015 - 02:51) писал:
<table class="goods_modifications"> <thead> <td>Артикул</td> <td>Модификация</td> <td>Цвет</td> <td>Тип</td> <td>Вес</td> <td>Цена</td> <td>Ед.измерения</td> <td>Остаток</td> <td>Купить</td> </thead> <tbody> {% FOR goods_modifications %} <tr rel="{goods_modifications.PROPERTIES_SLUG}"> <td>{goods_modifications.ART_NUMBER}</td> <td class="mod_name"></td> <td>{goods_modifications.DESCRIPTION | htmlspecialchars_decode}</td> <td class="mod_type"></td> <td class="mod_measure"></td> <td>{goods_modifications.PRICE_NOW}</td> <td>{goods_modifications.MEASURE_NAME}</td> <td>{goods_modifications.REST_VALUE}</td> <td> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="goodsDataForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{goods_modifications.ID}" /> <input type="number" value="1" size="2" maxlength="5" class="quantity" name="form[goods_mod_quantity]"> <a class="more-link" onclick="$(this).closest('form').submit(); return false;" title="Положить «{GOODS_NAME}» в корзину" href="#">В корзину</a> </form> </td> </tr> {% ENDFOR %} </tbody> </table> <div class="goods_modifications_properties" style="display:none;"> {% FOR goods_modifications_properties %}{% FOR values %} <div rel="{goods_modifications_properties.values.ID}">{goods_modifications_properties.values.NAME}</div> {% ENDFOR %}{% ENDFOR %} </div> <div style="display:none;"> {% FOR goods_features %} {% IF goods_features.NAME=Тип %} <div class="type">{goods_features.VALUE}</div> {%ENDIF%} {% IF goods_features.NAME=Вес %} <div class="measure">{goods_features.VALUE}</div> {%ENDIF%} {%ENDFOR%} </div> <script> $('.type').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr .mod_type').html($(this).html()); }); $('.measure').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr .mod_measure').html($(this).html()); }); $('.goods_modifications_properties > div').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr[rel="' + mod_id + '"] .mod_name').html($(this).html()); }); </script>
замените на:
<table class="goods_modifications"> <thead> <td>Размер</td> <td>Купить</td> </thead> <tbody> {% FOR goods_modifications %} <tr rel="{goods_modifications.PROPERTIES_SLUG}"> <td class="mod_name"></td> <td> <form action="{CART_ADD_GOODS_MODIFICATION_URL | url_amp}" method="post" class="goodsDataForm"> <input type="hidden" name="hash" value="{HASH}" /> <input type="hidden" name="form[goods_from]" value="{GOODS_FROM}" /> <input type="hidden" name="form[goods_mod_id]" value="{goods_modifications.ID}" /> <input type="number" value="1" size="2" maxlength="5" class="quantity" name="form[goods_mod_quantity]"> <a class="more-link" onclick="$(this).closest('form').submit(); return false;" title="Положить «{GOODS_NAME}» в корзину" href="#">В корзину</a> </form> </td> </tr> {% ENDFOR %} </tbody> </table> <div class="goods_modifications_properties" style="display:none;"> {% FOR goods_modifications_properties %}{% FOR values %} <div rel="{goods_modifications_properties.values.ID}">{goods_modifications_properties.values.NAME}</div> {% ENDFOR %}{% ENDFOR %} </div> <script> $('.goods_modifications_properties > div').each(function() { var mod_id = $(this).attr('rel'); $('.goods_modifications tr[rel="' + mod_id + '"] .mod_name').html($(this).html()); }); </script>
кнопка покупки, к сожалению, необходима напротив каждой модификации
#10
Отправлено 08 Апрель 2015 - 02:33
На счет работы кнопки, в данном коде строку:
<p id="add_to_cart"> <input type="submit" name="Submit" value="В корзину" class="add_to_cart" onclick="closest('form').submit(); return false;"></p>
замените на:
<p id="add_to_cart"> <input type="submit" name="Submit" value="Добавить в корзину" class="add_to_cart" onclick="quickorder('.goodsDataForm');return false;"></p>
#11
Отправлено 08 Апрель 2015 - 14:41
Vaccina (08 Апрель 2015 - 02:33) писал:
На счет работы кнопки, в данном коде строку:
<p id="add_to_cart"> <input type="submit" name="Submit" value="В корзину" class="add_to_cart" onclick="closest('form').submit(); return false;"></p>
замените на:
<p id="add_to_cart"> <input type="submit" name="Submit" value="Добавить в корзину" class="add_to_cart" onclick="quickorder('.goodsDataForm');return false;"></p>
Количество пользователей, читающих эту тему: 0
0 пользователей, 0 гостей, 0 анонимных