faxlain Posted November 9, 2013 Share Posted November 9, 2013 (edited) Hi masters, I'm PrestaShop Newbie and I'm not english, so excuse me If I will not be able to choose the best way to explain my problem... In product page I would like to show total price of a product, according to the quantity set by the user. Untill now, instead, total price doesn't change in real time if I modify quantity value in product page and I don't understand if it is normal or not... I hope I've been clear... anyhow I attach file of my problem Sorry for my english and thanks in advance. (I have 1.5.6.0 version of Prestashop) Edited November 9, 2013 by faxlain (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted November 9, 2013 Share Posted November 9, 2013 hello this is how prestashop works, there is no "real time" price changer when you increasind / decreasing value of quantity field Link to comment Share on other sites More sharing options...
faxlain Posted November 10, 2013 Author Share Posted November 10, 2013 Master of masters Vekia, It is an honor to host you in my topic Many thanks for your reply, I suppose that to do what I would like I should add some script in my tpl files (maybe in product.tpl...?). And I suppose the script to add is similar to some script in one file like shopping-cart.tpl... Maybe is it right? Can you help me to find a solution? Unfortunately, I'm not a programmer and untill now I've worked only with WP, so I know PHP little better than TPL script (if I can say so).... anyway thanks for read my problem! Link to comment Share on other sites More sharing options...
vekia Posted November 10, 2013 Share Posted November 10, 2013 you can do this script in product.tpl file to the quantity block add this onchange="$('#our_price_display').html(currencySign+' '+$('#quantity_wanted').val()*productPrice)"; 1 Link to comment Share on other sites More sharing options...
faxlain Posted November 11, 2013 Author Share Posted November 11, 2013 WOW! It work! Sir, you are an I-D-O-L! if anybody cares I write down the string of code to change: <!-- 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}> <label>{l s='Quantity:'}</label> <input type="text" name="qty" id="quantity_wanted" class="text" onchange="$('#our_price_display').html(currencySign+' '+$('#quantity_wanted').val()*productPrice)"; 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} /> </p> Thank you very much Vekia, I hope to meet you again in the forum Link to comment Share on other sites More sharing options...
faxlain Posted November 11, 2013 Author Share Posted November 11, 2013 (edited) Ops... I spoke too soon, because I have another issue.... In my product page I set two size of product, "sample" with a small price, and "product per square meter" with normal price. Your string of code works great if I select quantity of "product per square meter"; instead if I select the other, "sample", the price that I can see always refers to "product per square meter", without consider the price difference... What is it wrong Sir? Edited November 11, 2013 by faxlain (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted November 11, 2013 Share Posted November 11, 2013 can you share url to your website? i will check it Link to comment Share on other sites More sharing options...
faxlain Posted November 11, 2013 Author Share Posted November 11, 2013 Eh eh eh, I'm working in local host... I can't show you my work... Link to comment Share on other sites More sharing options...
vekia Posted November 11, 2013 Share Posted November 11, 2013 thank you for information, so i have to test it on my own. what kind of attributes you've got defined ? Link to comment Share on other sites More sharing options...
faxlain Posted November 11, 2013 Author Share Posted November 11, 2013 I'm so sorry... Anyway... Name of attribute: "Product size"; Combinations in product panel: 1) Product size: "Sample" --> I set small price 2) Product size: "Per square meter" --> I set normal price. If it can help you, I've followed this topic to do it : http://www.prestashop.com/forums/topic/154016-add-option-to-buy-product-samples/ Link to comment Share on other sites More sharing options...
faxlain Posted November 11, 2013 Author Share Posted November 11, 2013 Ah! another thing... I set combination "Product size"-->"Per square meter" to default Link to comment Share on other sites More sharing options...
faxlain Posted November 12, 2013 Author Share Posted November 12, 2013 Yesterday night I realized that I haven't said you another important thing (I'm like a Disel, I need more time to put my brain in motion...). I get this error only if I add to "Quantity" more than one product; infact, if I select only one product, I can see the correct price difference between "Sample" and "Product per square meter"... In substance, only the sum of product always refers to "Product per square meter"; can this suggest you something, Master? Anyway, thanks for your time. Link to comment Share on other sites More sharing options...
vekia Posted November 12, 2013 Share Posted November 12, 2013 okay, thank you for clarification im going to create similar products and i have hope, that i will find solution (i know what's going on, but dunno how to solve it) 1 Link to comment Share on other sites More sharing options...
faxlain Posted November 12, 2013 Author Share Posted November 12, 2013 (edited) ...This problem is becoming more and more strange... I've noted another unusual thing: in some case (and apparently in an illogical way) the total price shows a lot of decimal numbers, although there would be no need. I attach file of this new problem (img. top is ok; img. down is sadly ko): Master, what do you think about this? Is it a bug of PS? p.s. I suspect you are starting to hate me... Edited November 12, 2013 by faxlain (see edit history) Link to comment Share on other sites More sharing options...
ventesites Posted September 14, 2014 Share Posted September 14, 2014 Vekia would you know how i can apply your fix to my dropdown quantity wanted, how can i insert your code? onchange="$('#our_price_display').html(currencySign+' '+$('#quantity_wanted').val()*productPrice)"; my code: <!-- quantity wanted drop--> <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}> <label>quantité désirée</label> {if $product->minimal_quantity > 1} <select type="text" title="{l s='Quantity'}" name="qty" id="quantity_wanted" class="text" style="width:auto;"> <option value="{$product->minimal_quantity}">{$product->minimal_quantity}</option> <option value="{$product->minimal_quantity*2}">{$product->minimal_quantity*2}</option> <option value="{$product->minimal_quantity*3}">{$product->minimal_quantity*3}</option> <option value="{$product->minimal_quantity*4}">{$product->minimal_quantity*4}</option> <option value="{$product->minimal_quantity*5}">{$product->minimal_quantity*5}</option> </select> {else}{if $product->minimal_quantity <= 1} <select type="text" title="{l s='Quantity'}" name="qty" id="quantity_wanted" class="text" style="width:auto;"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> {/if} {/if}<!-- quantity wanted drop --> Thanks! Link to comment Share on other sites More sharing options...
vekia Posted September 14, 2014 Share Posted September 14, 2014 it's not a fix, it's a feature ;-) have you got attributes? if so - it will not work Link to comment Share on other sites More sharing options...
fonteyne13 Posted October 7, 2014 Share Posted October 7, 2014 Hi, I'm using specific prices for different quantities, the price is changing but it is not correct. Can somebody help me? This is my page: http://prestashop.kaartjespost.de-wizards.prvw.eu/geboortekaartjes/348-geboortekaartje-info.html# Thanx Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now