anson.c Posted April 16, 2010 Share Posted April 16, 2010 Hello,I managed to make my Top Seller module to display each product with its image and price. But as if the title is long then the price will go under the picture. Is there any way to shorter the title automatically with '...'? And I would like to do the same for New Products (with random display as well)Thanks! Link to comment Share on other sites More sharing options...
anson.c Posted April 16, 2010 Author Share Posted April 16, 2010 Oh... and by the way, for some reason all prices there are not correct. They all display the same. Any idea to fix it?Thanks! Link to comment Share on other sites More sharing options...
anson.c Posted April 17, 2010 Author Share Posted April 17, 2010 A tpl file attached if it helps. Thank you! blockbestsellers.zip Link to comment Share on other sites More sharing options...
razaro Posted April 17, 2010 Share Posted April 17, 2010 Try to replace $new_products.0 with $product So from this {if !$priceDisplay || $priceDisplay == 2}{displayWtPrice p=$new_products.0.price}{if $priceDisplay == 2} {l s='s DPH'}{/if}{/if} {if $priceDisplay == 2} {/if} {if $priceDisplay}{displayWtPrice p=$new_products.0.price_tax_exc}{if $priceDisplay == 2} {l s='bez DPH'}{/if}{/if} to this {if !$priceDisplay || $priceDisplay == 2}{displayWtPrice p=$product.price}{if $priceDisplay == 2} {l s='s DPH'}{/if}{/if} {if $priceDisplay == 2} {/if} {if $priceDisplay}{displayWtPrice p=$product.price_tax_exc}{if $priceDisplay == 2} {l s='bez DPH'}{/if}{/if} Link to comment Share on other sites More sharing options...
anson.c Posted April 17, 2010 Author Share Posted April 17, 2010 Thanks! But now it only shows $0... something's still missing? http://www.ecyclog.com Link to comment Share on other sites More sharing options...
razaro Posted April 17, 2010 Share Posted April 17, 2010 To display tax excluded you need to change blockbestsellers.php in modules/blockbestsellers.So first make backup.Add following line after line 40 $bestseller['price_tax_exc'] = Tools::displayPrice(Product::getPriceStatic(intval($bestseller['id_product']),false), $currency); so that part of code looks like foreach ($bestsellers AS $bestseller) { $bestseller['price'] = Tools::displayPrice(Product::getPriceStatic(intval($bestseller['id_product'])), $currency); $bestseller['price_tax_exc'] = Tools::displayPrice(Product::getPriceStatic(intval($bestseller['id_product']),false), $currency); $best_sellers[] = $bestseller; } Then changes from previous post will work.Another thing for text in blockbestsellers.tpl .Should look like this {l s='s DPH' mod='blockbestsellers'} and {l s='bez DPH' mod='blockbestsellers'} Link to comment Share on other sites More sharing options...
anson.c Posted April 17, 2010 Author Share Posted April 17, 2010 Still not showing the price correctly... Any idea?Really appreciated!! blackbestsellers.zip Link to comment Share on other sites More sharing options...
razaro Posted April 17, 2010 Share Posted April 17, 2010 Don't know really, it works for me on local server.Try to delete all files from prestashop\tools\smarty\compile folder except index.php.And try different settings for Price display inBack Office >> Preferences >> Products Link to comment Share on other sites More sharing options...
Degsey Posted April 17, 2010 Share Posted April 17, 2010 I have used this with the price commented out as its a good contribution. Link to comment Share on other sites More sharing options...
anson.c Posted April 17, 2010 Author Share Posted April 17, 2010 But why it doesn't work for me? ((( Link to comment Share on other sites More sharing options...
razaro Posted April 17, 2010 Share Posted April 17, 2010 What version of Prestashop do you have ?I tried this on 1.2.5 works ok and 1.3.0.1 and it works with one currency but with otherit is same problem you have - price is 0 . Link to comment Share on other sites More sharing options...
anson.c Posted April 17, 2010 Author Share Posted April 17, 2010 I use 1.3.0.1 and none of the currencies work Link to comment Share on other sites More sharing options...
razaro Posted April 18, 2010 Share Posted April 18, 2010 I think i got it.I changed in blockbestsellers.php from $bestsellers = ProductSale::getBestSalesLight(intval($params['cookie']->id_lang), 0, 5); to $bestsellers = ProductSale::getBestSales(intval($params['cookie']->id_lang), 0, 5); and deleted these two lines $bestseller['price'] = Tools::displayPrice(Product::getPriceStatic(intval($bestseller['id_product'])), $currency); $bestseller['price_tax_exc'] = Tools::displayPrice(Product::getPriceStatic(intval($bestseller['id_product']),false), $currency); and in tpl file replaced price part with this {if !$priceDisplay}{convertPrice price=$bestSellerProduct.price}{l s=' s DPH' mod='blockbestsellers'} {else}{convertPrice price=$bestSellerProduct.price_tax_exc}{l s=' bez DPH' mod='blockbestsellers'}{/if} Hope it works for you.And to change price with/out tax go toBack Office » Customers » Groups and edit . blackbestsellers.zip Link to comment Share on other sites More sharing options...
anson.c Posted April 18, 2010 Author Share Posted April 18, 2010 THanks a lot, but still not working. check it out http://www.ecyclog.comI'm feeling like giving it up... but it would be lame if showing top sellers without prices Link to comment Share on other sites More sharing options...
razaro Posted April 18, 2010 Share Posted April 18, 2010 Sorry but nothing else come to my mind. Link to comment Share on other sites More sharing options...
anson.c Posted April 18, 2010 Author Share Posted April 18, 2010 No problem man. You've been a great help!Feel free to sign up on my site then tell me what's your email. You'll get VIP discount! ;-) Link to comment Share on other sites More sharing options...
zac Posted April 28, 2010 Share Posted April 28, 2010 @anson.cLooking at your shop it seems you solved the problem. Wanna share? Link to comment Share on other sites More sharing options...
anson.c Posted April 28, 2010 Author Share Posted April 28, 2010 Certainly! See attachment. As of now I still have no clue how to fix the price on "Viewed Products"If another can figure it out please let me know. Thanks!www.ecyclog.com new&best.zip Link to comment Share on other sites More sharing options...
zac Posted April 29, 2010 Share Posted April 29, 2010 Thanks,works almost perfect & and I like the idea to add the cart-button.But the prices are shown without tax. Any idea how to show the inclusive-prices?EDIT: only in blockbestsellers the prices are without tax. Blocknewproducts works fine - I have no idea whyZaC Link to comment Share on other sites More sharing options...
anson.c Posted April 29, 2010 Author Share Posted April 29, 2010 Hi Zac,I could have looked at it if my internet was working at home. Unfortunately my internet is down for 2 days now. Hopefully I will get it back tonight, meanwhile you should see if anybody else can give you some help here. Link to comment Share on other sites More sharing options...
zac Posted April 29, 2010 Share Posted April 29, 2010 BTW anson.c,I just recognised that clicking the tiny cart button within a block does not move the correct product into the cart. It seems you have the same problem. You'd better check it out...regards, ZaC Link to comment Share on other sites More sharing options...
razaro Posted April 29, 2010 Share Posted April 29, 2010 I attached fixed ( i hope) tpl files for both modules.Copy them in appropriate module folders. new&bestTPL.zip Link to comment Share on other sites More sharing options...
anson.c Posted April 29, 2010 Author Share Posted April 29, 2010 Wow... Thanks again to razaro! He's the best!!! Link to comment Share on other sites More sharing options...
zac Posted April 29, 2010 Share Posted April 29, 2010 I guess the fix is concerning the cart button.It works fine for bestsellers, but not for new_products. It says something like 'wrong token' (Free translation, don't use the english version)Concerning the price I still have the prices without tax in the bestsellers block. Link to comment Share on other sites More sharing options...
anson.c Posted April 29, 2010 Author Share Posted April 29, 2010 Hmmm... the add to cart thing seems to work fine for me in both blocks..... 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