Stefand Posted October 2, 2010 Share Posted October 2, 2010 I work with the module: quantity discountsBut it displays the discount prices without taxes!?The part of the code from the module which display the prices etc: function writeDiscountsContent(price) {ldelim} var discountStr = " "; var discountedPrice = 0; {foreach from=$qd_quantity_discounts item='qd_quantity_discount' name='quantity_discounts'} discountStr += "{$qd_quantity_discount.quantity|intval} "; {if $qd_quantity_discount.quantity|intval > 1} discountStr += "{l s='quantities' mod='quantitydiscounts'}: "; {else} discountStr += "{l s='quantity' mod='quantitydiscounts'}: "; {/if} {if $qd_quantity_discount.id_discount_type|intval == 1} discountedPrice = price - (price * {$qd_quantity_discount.value} / 100); {else} discountedPrice = price - {$qd_quantity_discount.value}; {/if} discountStr += formatCurrency(discountedPrice, currencyFormat, currencySign, currencyBlank) + " "; {/foreach} discountStr += " "; P.S: It is the module from presto-changeo (I have also contact them, but the are on holiday, and I need it soon fixed!)When somebody have the solution, let me know! Link to comment Share on other sites More sharing options...
Stefand Posted October 2, 2010 Author Share Posted October 2, 2010 Nobody? This module works not for me so have somebody a alternative method for this?I need display the product discounts (quantity discounts) on the product page (product.tpl).Please help me, when it's a paid solution, let me know. Link to comment Share on other sites More sharing options...
LionMuscle Posted October 8, 2010 Share Posted October 8, 2010 Hello Stefand,I have the same problem for this module.In the table of discount why the visualized prices are wrong while in calculation in the cart it is executed correctly?4 quantities € 34,20 but the correct price is € 34,658 quantities € 32,30 but the correct price is € 32,7312 quantities € 30,40 but the correct price is € 30,80This is a bug or my error??? Link to comment Share on other sites More sharing options...
bambi Posted October 8, 2010 Share Posted October 8, 2010 Hi,Which version of PS are you using?The recent changes made in PS 1.3.2 seem to effect this module. In particular when the value of the product in the default currency is smaller that 1Cheers Dan Link to comment Share on other sites More sharing options...
Stefand Posted October 8, 2010 Author Share Posted October 8, 2010 @lionmuscle, that's the same problem I have !@bambiI use version 1.3.1 Link to comment Share on other sites More sharing options...
LionMuscle Posted October 8, 2010 Share Posted October 8, 2010 @bambiI use PS 1.3.1.I have noticed that the module it applies a discount of 1.3% but I do not understand from where takes it!Ex: € 34,65 - 1,3% = € 34,20 for 4 quantitiesEx: € 32,73 - 1,3% = € 32,30 for 8 quantitiesP.S. Sorry for my bad english but I use a on-line traslator Link to comment Share on other sites More sharing options...
Stefand Posted October 8, 2010 Author Share Posted October 8, 2010 Let me know if somebody have the solution for it! Link to comment Share on other sites More sharing options...
abatonime Posted October 13, 2010 Share Posted October 13, 2010 Hello guys,I just noticed the same issue on my website too!I dont have a clue where it comes from.Olivier. Link to comment Share on other sites More sharing options...
abatonime Posted October 13, 2010 Share Posted October 13, 2010 Got it!!The javascript code is wrong, it does not take the decimals.Per exemple 19,95€ it will take 19€ to display the discounts. Link to comment Share on other sites More sharing options...
Stefand Posted October 13, 2010 Author Share Posted October 13, 2010 @abatnime,do you have the solution?I need this fixed!! Link to comment Share on other sites More sharing options...
bambi Posted October 13, 2010 Share Posted October 13, 2010 Maybe best would be to wait until Tomerg3, that wrote the module, will make the changes.I have a lot of modules installed and sometimes using a "quick fix" effects other modules.CheersDan Link to comment Share on other sites More sharing options...
Stefand Posted October 13, 2010 Author Share Posted October 13, 2010 @bambitomerg3 is bussy right know, and that's the reason I ask for help here...I have customers who use this module, and they are not happy and wait along time right know... Link to comment Share on other sites More sharing options...
abatonime Posted October 14, 2010 Share Posted October 14, 2010 I think the problem is there: function fetchCurrentPrice() {ldelim} var val = $("#our_price_display").text(); var qd_price = ""; for (var i = 0 ; i < val.length ; i++) if (/[0-9.,]/.test(val.charAt(i))) qd_price += val.charAt(i); return parseFloat(qd_price); The function parseFloat() doesnt like the comma for separating the decimal. Do you have a dot or a comma in your prices on your website?I think in english we use a comma, and in french a dot (for separating the decimal). Link to comment Share on other sites More sharing options...
Stefand Posted October 14, 2010 Author Share Posted October 14, 2010 @abotonime,the comma or dot is not the problem, the prices display wrong.. Link to comment Share on other sites More sharing options...
abatonime Posted October 14, 2010 Share Posted October 14, 2010 Yes it is.Add this line in your function: val =val.replace(",", "."); So the function becomes: function fetchCurrentPrice() {ldelim} var val = $("#our_price_display").text(); var qd_price = ""; val =val.replace(",", "."); for (var i = 0 ; i < val.length ; i++) if (/[0-9.,]/.test(val.charAt(i))) qd_price += val.charAt(i); return parseFloat(qd_price); {rdelim} You will see it works now.EDIT: the file is /www/modules/quantitydiscounts/quantitydiscounts.tpl Link to comment Share on other sites More sharing options...
Stefand Posted October 14, 2010 Author Share Posted October 14, 2010 @abatonimeTHNX! YOU ARE THE HERO!IT WORKS! Link to comment Share on other sites More sharing options...
abatonime Posted October 14, 2010 Share Posted October 14, 2010 You are welcome.Do I get a free design for my website? Link to comment Share on other sites More sharing options...
skykit Posted October 21, 2010 Share Posted October 21, 2010 I had installed this module, but in the product page doesn't show the Quantity Discounts. Anyone know the problem is? Thank you. Link to comment Share on other sites More sharing options...
abatonime Posted October 21, 2010 Share Posted October 21, 2010 Have you created at least one discount for this product? Link to comment Share on other sites More sharing options...
johnnyboy Posted October 21, 2010 Share Posted October 21, 2010 I just install the modules. The view price show correctly how ever if you add your product into cart with the discount quantity you got the wrong price. This modules some how add 0.1395... into the unit price. Please advise!Thanks, Link to comment Share on other sites More sharing options...
skykit Posted October 21, 2010 Share Posted October 21, 2010 Have you created at least one discount for this product? Yes, I did, are you using Prestashop version 1.3.2? Link to comment Share on other sites More sharing options...
abatonime Posted October 21, 2010 Share Posted October 21, 2010 I just install the modules. The view price show correctly how ever if you add your product into cart with the discount quantity you got the wrong price. This modules some how add 0.1395... into the unit price. Please advise!Thanks, What percentage/amount of discount have you configured in the back office? Link to comment Share on other sites More sharing options...
abatonime Posted October 21, 2010 Share Posted October 21, 2010 Have you created at least one discount for this product? Yes, I did, are you using Prestashop version 1.3.2? No I have the 1.3.1.1.Does the discounts showup without the module installed?Have you tried with different browsers? (could be javascript issue) Link to comment Share on other sites More sharing options...
skykit Posted October 21, 2010 Share Posted October 21, 2010 Have you created at least one discount for this product? Yes, I did, are you using Prestashop version 1.3.2? No I have the 1.3.1.1.Does the discounts showup without the module installed?Have you tried with different browsers? (could be javascript issue) I think I figure out, it may be the theme problem. The original theme has not problem. Do you know which code and file will affect this? Link to comment Share on other sites More sharing options...
abatonime Posted October 21, 2010 Share Posted October 21, 2010 Have you created at least one discount for this product? Yes, I did, are you using Prestashop version 1.3.2? No I have the 1.3.1.1.Does the discounts showup without the module installed?Have you tried with different browsers? (could be javascript issue) I think I figure out, it may be the theme problem. The original theme has not problem. Do you know which code and file will affect this? I think it could be in /www/themes/***/product.tpl Link to comment Share on other sites More sharing options...
abatonime Posted October 21, 2010 Share Posted October 21, 2010 I just install the modules. The view price show correctly how ever if you add your product into cart with the discount quantity you got the wrong price. This modules some how add 0.1395... into the unit price. Please advise!Thanks, I see $30 Tax EXCLUDED, maybe it has something to do with the tax.... Link to comment Share on other sites More sharing options...
johnnyboy Posted October 21, 2010 Share Posted October 21, 2010 I just install the modules. The view price show correctly how ever if you add your product into cart with the discount quantity you got the wrong price. This modules some how add 0.1395... into the unit price. Please advise!Thanks, What percentage/amount of discount have you configured in the back office? Thanks for replying! When I configure quantity discount using percentage, is it working perfectly (see attachment), taxes are fine.But it doesn't work with "by amount" quantity discount, wrong price, always add 0.13953.Maybe it has something to do with the codefunction writeDiscountsContent(price) {ldelim} var discountStr = " "; var discountedPrice = 0; {foreach from=$qd_quantity_discounts item='qd_quantity_discount' name='quantity_discounts'} discountStr += "{$qd_quantity_discount.quantity|intval} "; {if $qd_quantity_discount.quantity|intval > 1} discountStr += "{l s='quantities' mod='quantitydiscounts'}: "; {else} discountStr += "{l s='quantity' mod='quantitydiscounts'}: "; {/if} {if $qd_quantity_discount.id_discount_type|intval == 1} discountedPrice = price - (price * {$qd_quantity_discount.value} / 100); {else} discountedPrice = price - {$qd_quantity_discount.value}; {/if} discountStr += formatCurrency(discountedPrice, currencyFormat, currencySign, currencyBlank) + " "; {/foreach} discountStr += " "; Note: I use PrestaShop v.1.3.2 Link to comment Share on other sites More sharing options...
skykit Posted October 21, 2010 Share Posted October 21, 2010 Have you created at least one discount for this product? Yes, I did, are you using Prestashop version 1.3.2? No I have the 1.3.1.1.Does the discounts showup without the module installed?Have you tried with different browsers? (could be javascript issue) I think I figure out, it may be the theme problem. The original theme has not problem. Do you know which code and file will affect this? I think it could be in /www/themes/***/product.tpl I have tried on this file half of the day, but still not figure out the issue , do you know? Link to comment Share on other sites More sharing options...
abatonime Posted October 21, 2010 Share Posted October 21, 2010 I just install the modules. The view price show correctly how ever if you add your product into cart with the discount quantity you got the wrong price. This modules some how add 0.1395... into the unit price. Please advise!Thanks, What percentage/amount of discount have you configured in the back office? Thanks for replying! When I configure quantity discount using percentage, is it working perfectly (see attachment), taxes are fine.But it doesn't work with "by amount" quantity discount, wrong price, always add 0.13953.Maybe it has something to do with the codefunction writeDiscountsContent(price) {ldelim} var discountStr = " "; var discountedPrice = 0; {foreach from=$qd_quantity_discounts item='qd_quantity_discount' name='quantity_discounts'} discountStr += "{$qd_quantity_discount.quantity|intval} "; {if $qd_quantity_discount.quantity|intval > 1} discountStr += "{l s='quantities' mod='quantitydiscounts'}: "; {else} discountStr += "{l s='quantity' mod='quantitydiscounts'}: "; {/if} {if $qd_quantity_discount.id_discount_type|intval == 1} discountedPrice = price - (price * {$qd_quantity_discount.value} / 100); {else} discountedPrice = price - {$qd_quantity_discount.value}; {/if} discountStr += formatCurrency(discountedPrice, currencyFormat, currencySign, currencyBlank) + " "; {/foreach} discountStr += " "; Note: I use PrestaShop v.1.3.2 So I think the module we were taking about here is not the issue. (I think the module is just displaying the discount in a better place.) You probably have an issue with the code of prestashop itself. Maybe you can start a new thread or make a bug report.@skykitNo, sorry. Link to comment Share on other sites More sharing options...
Dmcwebd Posted November 23, 2010 Share Posted November 23, 2010 Yes it is.Add this line in your function:val =val.replace(",", "."); So the function becomes: function fetchCurrentPrice() {ldelim} var val = $("#our_price_display").text(); var qd_price = ""; val =val.replace(",", "."); for (var i = 0 ; i < val.length ; i++) if (/[0-9.,]/.test(val.charAt(i))) qd_price += val.charAt(i); return parseFloat(qd_price); {rdelim} You will see it works now.EDIT: the file is /www/modules/quantitydiscounts/quantitydiscounts.tpl This did the job thx Link to comment Share on other sites More sharing options...
abatonime Posted November 23, 2010 Share Posted November 23, 2010 Yes it is.Add this line in your function:val =val.replace(",", "."); So the function becomes: function fetchCurrentPrice() {ldelim} var val = $("#our_price_display").text(); var qd_price = ""; val =val.replace(",", "."); for (var i = 0 ; i < val.length ; i++) if (/[0-9.,]/.test(val.charAt(i))) qd_price += val.charAt(i); return parseFloat(qd_price); {rdelim} You will see it works now.EDIT: the file is /www/modules/quantitydiscounts/quantitydiscounts.tpl This did the job thx You are welcome Link to comment Share on other sites More sharing options...
Fabrice Posted November 26, 2010 Share Posted November 26, 2010 Hi!I have some products which prices = 0but I have also discount prices for these productsI use attributes to calculate the final prices (so initial product price is equal to 0 and attribute = 100 $ for instance)How may I hide the discount in that case ?because, as expected, discounted prices are displayed like that : discount : 0,00 $tks for your help !! Link to comment Share on other sites More sharing options...
abatonime Posted November 27, 2010 Share Posted November 27, 2010 Hi!I have some products which prices = 0but I have also discount prices for these productsI use attributes to calculate the final prices (so initial product price is equal to 0 and attribute = 100 $ for instance)How may I hide the discount in that case ?because, as expected, discounted prices are displayed like that : discount : 0,00 $tks for your help !! I think in the template, you can do a if with smarty. Something like:{if price==0}{/if} Link to comment Share on other sites More sharing options...
torcuato Posted March 14, 2011 Share Posted March 14, 2011 Hi,I just need to find out how to enter the quantity discount amounts as actual prices for each given quantity break, instead of discounts from a base item price.For instance:Qty. Price250 $1.45500 $1.391000 $1.25And so on. Right now, in PrestaShop 1.3.6, I have to enter a base price (which I am OK doing), but I will be selling my products in bulk quantities, as shown in the above example. I will be importing a large number of products into the store's back end, but all the info I have on the Quantity discounts for each product is in the above format. Does anyone have a solution for this challenge, even a paid module or modification that I can purchase?Again, all I need is a way to enter/import the price quantity discounts as actual prices for any given quantity of the product (instead of reductions from the base price), and have them displayed as actual prices in the product detail page. The add to cart obviously needs to pick up the right quantity price, based on the quantity added to cart.Seems simple enough to me, but not sure if it requires extensive modifications to the quantity discounts files/templates.Many thanks in advance for any and all advice.Alex Link to comment Share on other sites More sharing options...
leiheng93 Posted March 14, 2011 Share Posted March 14, 2011 Everyone’s views are different, so opinions are not the same.Bing or Google may help you. Have a try! Link to comment Share on other sites More sharing options...
zyko Posted April 20, 2011 Share Posted April 20, 2011 I just need to find out how to enter the quantity discount amounts as actual prices for each given quantity break, instead of discounts from a base item price.For instance:Qty. Price250 $1.45500 $1.391000 $1.25 will this module “Group wise Quantity Price Breaks“ seems to be helpful for you ???? Link to comment Share on other sites More sharing options...
Raphael2010 Posted May 2, 2011 Share Posted May 2, 2011 quite nice! i am using prestashop 1.4 and it shows from the highest quantities first to the lowest...I saw someone did a display from lowest quantities first to highest! Do you know how to change the code for that? there's nothing in the back office to make such things...Thanks Link to comment Share on other sites More sharing options...
ChrisLNZ Posted May 3, 2011 Share Posted May 3, 2011 do you really need to change it? There is a sort function already built in in FO Link to comment Share on other sites More sharing options...
Raphael2010 Posted May 3, 2011 Share Posted May 3, 2011 There is no such things in the FO! the sorting option is only working for different price products not for the quantity discount within a product... Link to comment Share on other sites More sharing options...
dramony Posted July 2, 2011 Share Posted July 2, 2011 quite nice! i am using prestashop 1.4 and it shows from the highest quantities first to the lowest...I saw someone did a display from lowest quantities first to highest! Do you know how to change the code for that? there's nothing in the back office to make such things...Thanks I also want to know how to do this. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts