Jump to content

lonlywolf

Members
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • Location
    Sevastopol, Ukraine
  • Activity
    User/Merchant

lonlywolf's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Добрый день, форумчане! Подскажите, пожалуйста, несколько вещей: 1. Как изменять общую цену товара при изменении количества вводом текста (без кнопок +-)? Сейчас у меня добавлены два метода в product.js, которые отрабатывают при нажатии на кнопки (+) и (-), но если просто исправить в строке ввода значение, то общая стоимость останется прежней. 2. Как отображать общую цену товара, если задано необходимое минимальное количество? Когда пользователь заходит на страницу товара, для которого задано необходимое минимальное количество, то видит, например, количество = 5, но общую цену = цене одной единицы. На всякий случай product.js в аттаче. Заранее спасибо! product.js.txt
  2. Hello, Jan Jansen! I've met the same problem, but I figured out that the code you placed in product.js should be also put to the product.tpl itself if you don't know how to change product.js properly. Here is the code from my product.tpl: <!-- quantity wanted --> <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> {literal} <script type="text/javascript"> $(document).ready(function(){ $('#quantity_wanted').val(1); $('.qty_up img').on('click',function(){ if (isNaN(parseInt($('#quantity_wanted').val()))){$('#quantity_wanted').val(1);} else {$('#quantity_wanted').val(parseInt($('#quantity_wanted').val())+1); $("#our_price_display").html(((productPrice*$("#quantity_wanted").val()).toFixed(2)+" "+currencySign).replace('.',','));} }); $('.qty_down img').on('click',function(){ if (isNaN(parseInt($('#quantity_wanted').val()))){$('#quantity_wanted').val(1);} else { if(parseInt($('#quantity_wanted').val())<=1){ } else {$('#quantity_wanted').val(parseInt($('#quantity_wanted').val())-1); $("#our_price_display").html(((productPrice*$("#quantity_wanted").val()).toFixed(2)+" "+currencySign).replace('.',','));[spam-filter] }); }); </script> {/literal} <label> {l s='Quantity:'} </label> <span class="qty_down floatleft"> <img src="{$img_dir}minus.png" width="12" height="12" alt="" title="" /> </span> <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> <span class="qty_up floatleft"> <img src="{$img_dir}plus.png" width="12" height="12" alt="" title="" /> </span> </p> You can find the place to put the code by the starting <!-- quantity wanted --> string. It should be in the original product.tpl also. But! You need to add changes to the product.js also, because as I figured out, it has the function, which will fire when user will change quantity by typing the amount in the field manually without buttons. Hope it will help. P.S.: be sure to use your currency format, mine is for Ukraine.
  3. vekia, thank you very very much! Now it works like a charm
  4. Thanks again! Now it shows me rounded value. But it still shows it with the dot, not a comma. It shows the value like: 60.00 $, 120.00 $ But it should show the value like: 60,00 $, 120,00 $ My currency settings needs this "," instead of ".", and it is used on the whole website and it will be strange if the currency format will change after user's actions. Do you have any idea how to change "." to ","?
  5. Hey, your solution worked perfectly! Thanks! But can you help me with the way it shows? Now it shows like $60, $120 etc., but I need it to be like this: 60,00 $, 120,00 $, etc. Can you help, please?
  6. Добрый день. Очень извиняюсь за глупый вопрос, но как этот модуль можно прилепить к картинке, а не к тексту?
×
×
  • Create New...