simberak Posted March 1, 2012 Share Posted March 1, 2012 Hello, I modified my module bestsellers to show like this: Product name Product picture Product price -------------------- Product name Product picture Product price -------------------- Product name Product picture Product price -------------------- it shows 5 products... And problem is, that in second and third product the price is "1" - wich is not the price of product Here is code of blockbestsellers.tpl <!-- MODULE Block best sellers --> <div id="best-sellers_block_right" class="block productbests_block"> <h4><a href="{$link->getPageLink('best-sales.php')}">{l s='Top sellers' mod='blockbestsellers'}</a></h4> <div class="block_content"> {if $best_sellers|@count > 0} {foreach from=$best_sellers item=productbest name=myLoop} <div style="text-align:center; width: 100%;border-bottom: 1px dashed #0087CC; margin-bottom: 7px; padding-bottom: 10px; color: black; font-weight:bold;" class="noveprodukty"> <a href="{$productbest.link}" title="{$productbest.name|escape:htmlall:'UTF-8'}" class="title" style="color: black; text-shadow: white 1px 1px 1px; font-size:12px; font-weight:bold;">{$productbest.name|strip_tags|escape:htmlall:'UTF-8'}<br /><img src="{$link->getImageLink($productbest.link_rewrite, $productbest.id_image, 'home')}" alt="{$productbest.legend|escape:htmlall:'UTF-8'}" style="border: 1px solid #ffdfea; margin: 5px 0px 0px 0px" /></a> <br /> {if !$priceDisplay || $priceDisplay == 2} {convertPrice price=$productbest.price}{if $priceDisplay == 2} {l s='+Tx' mod='blockbestsellers'}{/if} {/if} {if $priceDisplay} {convertPrice price=$productbest.price_tax_exc}{if $priceDisplay == 2} {l s='-Tx' mod='blockbestsellers'}{/if} {/if} </div> {/foreach} <div><a href="{$link->getPageLink('best-sales.php')}" title="{l s='All best sellers' mod='blockbestsellers'}" class="button_large">{l s='All best sellers' mod='blockbestsellers'}</a></div> {else} {l s='No best sellers at this time' mod='blockbestsellers'} {/if} </div> </div> <!-- /MODULE Block best sellers --> Can anyone help what is wrong with that prices? In First and fourth and fifth product it shows the price great... Of course everybody can use this code for its shop But the prices are not shown well... And sorry for thyt styling, I am going to add it to external css file after it will be working Thanks Link to comment Share on other sites More sharing options...
JesseNaylor Posted March 4, 2013 Share Posted March 4, 2013 Hi. Did you manage to solve this? I am having trouble customising my BlockBestSellers module on my Prestashop 1.4 site. Link to comment Share on other sites More sharing options...
simberak Posted March 4, 2013 Author Share Posted March 4, 2013 Hi, I dont know, how I did that, but it just started to work Maybee try to clean ale caches (shops and browsers to). Thats the only reason why it start working I think... Link to comment Share on other sites More sharing options...
JesseNaylor Posted March 5, 2013 Share Posted March 5, 2013 What version of PS are you running this on? Link to comment Share on other sites More sharing options...
simberak Posted March 5, 2013 Author Share Posted March 5, 2013 I, for example, run it on 1.4.5.1 Link to comment Share on other sites More sharing options...
Vince at RockPOS.com Posted March 6, 2013 Share Posted March 6, 2013 Mybe because you are using " {if $priceDisplay}" => it always is "1" or "2". Link to comment Share on other sites More sharing options...
JesseNaylor Posted May 30, 2013 Share Posted May 30, 2013 I have a different problem though. For some reason, the prices in my blockbestsellers.tpl module are appearing rounded!!! So that you can understand exactly what I mean, I have for example a product that is supposed to cost 14,95€, but it displays the price of 14,00€! For some reason it is removing all the decimals from the real price (,95), but then displays the price with two zero decimals (,00). This is probably because I edited my blockbestsellers.php file some time ago in order to display random best selling products. In my PrestaShop 1.4.8.3 I edited line 104 of my blockbestsellers.php file, where I took: $bestsellers = ProductSale::getBestSalesLight((int)($params['cookie']->id_lang), 0, 5); and I replaced it with: $bestsellers = ProductSale::getBestSalesLight((int)($params['cookie']->id_lang), 1, ($nb ? $nb : 10), NULL, NULL, false, true, true, 2); shuffle($bestsellers); Perhaps if somebody could explain to me what all the different part of that array are for, maybe I can solve the problem. Is anybody else getting rounded decimals on their blockbestsellers module? Many thanks for any knowledge and input! Link to comment Share on other sites More sharing options...
JesseNaylor Posted June 4, 2013 Share Posted June 4, 2013 Nobody else with the rounded prices problem? Does anybody recognise the code I posted above and can explain what each part of the Array does? This would really help me solve the problem if I can at least understand what it says there. 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