There is equipment. He has 5 species. Each type of 10-15 different sizes of equipment. Each size has its own price.

How to implement it through js ?

On this site there is a block of equipment (you can see the source code)

For some reason, the 5th form (baking sheets for hotdogs) does not change at all.

How would he change the price for a particular block, but if you close all the blocks and leave only 7 blocks, the price does not change.

Here is the code to change the price to the specific. block

function _GetPriceAll() { var _prices_all = 0; var _counts_all = 0; $.each($(".p-project-items fieldset"), function() { var _obj = this; if ($(".p-project-list .choise .pactive", this).size() > 0) { var _prices = 0; var _counts = 0; $.each($(".p-project-list .choise .pactive", this), function() { var _g_parent = $(this).parents(".p-project-item"); if (!$(_g_parent).find(".p-project-item-add:visible").size()) { var _count = parseInt($(this).find(".b-item-count").val()); var _price = parseFloat($(this).find(".value-title").attr("title")); _prices += _count * _price; _counts += _count; } }); _prices_all += _prices; _counts_all += _counts; $(".p-project-items-sum", _obj).html('<b>' + _counts + '</b> наименований на сумму <b>' + formatNumber(parseInt(_prices)) + ' тг.</b>'); } }); $(".goods-total-all strong").html(formatNumber(parseInt(_prices_all)) + " тг."); $(".goods-total-all span i").html("(" + _counts_all + " наименований)"); } 
 <li class="pactive"> <h3> <input type="checkbox" name="itemcard[]" id="item_211356" value="211356" checked="checked"> <!-- <input type="checkbox" name="item_211356" id="item_211356" value="1"/> --> <img src="../../bakery/upload/oboryd/prot_6.jpg" width="150" height="150" alt="" class="image"><br> <b class="fn">Противни штампованные <br>Размер: <select id="my_prot1" name="my_prot"> <option value="4100"> 400*600</option> <option value="5500"> 400*800</option> <option value="4700"> 325*530</option> <option value="5500"> 490*740</option> <option value="6700"> 500*700</option> <option value="5500"> 530*650</option> <option value="6700"> 550*700</option> <option value="8500"> 550*900</option> <option value="6700"> 590*800</option> <option value="8000"> 600*900</option> <option value="12300"> 740*980</option> <option value="12700"> 750*1040</option> <option value="13100"> 780*1000</option> <option value="13100"> 800*1000</option> </select></b> </h3> <p class="p-project-item-desc description"> <!-- 600 кг/ч, вибрац.типа, с магнитн. улавливателем, 0,55 кВт, 680х820х980, 380 В --> </p> <div class="p-project-item-buy"> <abbr class="value-title" id="prot_total_6t" title="4100">4 100<abbr class="currency" title="RUB">тг.</abbr></abbr> <label class="counter"> <u class="input"><u><u><input type="text" value="1" name="count_211356" id="count_211356" data="598.html" class="b-item-count"></u></u> </u> <ul> <li> <a href="#"></a> </li> <li> <a href="#"></a> </li> </ul> </label> <span class="p-project-item-totalprice" id="prot_total_6t2" title="4100">4 100</span> </div> <script type="text/javascript"> document.getElementById("my_prot1").addEventListener("change", function() { document.getElementById('prot_total_6t').innerHTML = this.value + "тг."; document.getElementById('prot_total_6t2').innerHTML = this.value + "тг."; }); </script> </li> 

  • Help me more pliz - Lyubov Dalobaeva

0