Juanzo Posted February 16, 2017 Share Posted February 16, 2017 At our cloud slider order form, decimals make the price look bigger so we want to hide them. For example, the code used at the Cloud Slider order for is: jQuery("#priceTop").html(displayPrice); jQuery("#priceBottom").html(displayPrice); At this thread, gpw posted the following code to remove decimals: {$CODE|round|number_format} Any idea on how to apply this, or any other code, so that decimals are not shown at the order form? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 16, 2017 Share Posted February 16, 2017 Any idea on how to apply this, or any other code, so that decimals are not shown at the order form? if you're talking about the products.tpl page, the problem you're going to have is that the price isn't a number - it's a string (e.g $100.00 USD) - so you can't perform any maths functions on it. but if you treat it as a string, you can do many other things to adjust it... e.g looking at your website, the prices all seem to end in .00 - therefore, you can just remove that from your prices by changing ~line243 products.tpl... "displayPrice": "{$product.pricing.minprice.price}", to... "displayPrice": "{$product.pricing.minprice.price|replace:'.00':''}", 0 Quote Link to comment Share on other sites More sharing options...
Juanzo Posted February 16, 2017 Author Share Posted February 16, 2017 That worked perfectly well brian!, thank you very much! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.