A
A
alex88a2017-02-01 19:03:35
JavaScript
alex88a, 2017-02-01 19:03:35

How to set value to all text fields?

Good afternoon. On the category page it is possible to select the quantity of the added product prntscr.com/e36hea there is also a simple filter for these products. Filter code on this page

<ul>
                <li><label><input type="checkbox" name="hide_prices" value="1" <?php if($hide_prices) { ?> checked <?php } ?> />Скрыть цены</label></li>
                <li><label><input type="checkbox" name="hide_header" value="1" <?php if($hide_header) { ?> checked <?php } ?> />Скрыть шапку сайта и Контакты</label></li>
                <li><label><input type="checkbox" name="hide_menu_items" value="1" <?php if($hide_menu_items) { ?> checked <?php } ?> />Скрыть Оптовикам, Оплата и доставка, Контакты</label></li>
                <li><button>Применить</button></li>
            </ul>

You need to add to this filter the ability to set the quantity for all products on this page. For example, we put the quantity 150 in the new field and for all products on this page the number 150 will appear in the quantity field. Example prntscr.com/e36j4h
The code where the quantity of the product is is here
<input type="text" value="<?php echo $product['minimum']; ?>" size="2" class="quantity" id="quantity_tovarr" name="quantity_<?php echo $product['product_id']; ?>">			
Буду очень признателен за любую помощь.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ruchiev, 2017-02-01
@alex88a

in file /catalog/view/javascript/common.js
right after $(document).ready(function() {
paste

$( "#quantity_tovarr" ).keyup(function() {
  $('.quantity').val($(this).val());
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question