Podma Posted July 4, 2018 Share Posted July 4, 2018 Hello! First of all I'm new on the forum, so If I posted this topic to the wrong section then pardon me. The problem. We use prestashop 1.6. We decided to create a small calculator for our customer so they can calculate the price and the quantity of the product. We placed the code in the themes/product.tpl The code: {literal} <script src="jquery-3.3.1.min.js" type="text/javascript"></script> <meta charset="utf-8"> <script> $(function(){ $("#nm_input").on("change keyup", function(){ nm = Number($(this).val()); nm_egysegar = Number($("#egysegar").val()); $("#nm_eredmeny").text(Math.ceil(nm / 2.4) + "db,"); $("#nm_eredmeny_ar").text(Math.ceil((nm / 2.4 * nm_egysegar)) + "Ft"); }); }); </script> Felület: <input type="number" value="0" min="1" step="1" id="nm_input"> <br> ÁR:<span id="nm_eredmeny"></span> <span id="nm_eredmeny_ar"></span> {/literal} I tried with and without the literal I read a lot of forum topic where this was the problem with the code. But in my case on the site nothing happens. The site working there is no error or blank page it just won't display. I'm not sure if I'm missing something from the code because on a simple html site it works. Link to comment Share on other sites More sharing options...
Rhobur Posted July 7, 2018 Share Posted July 7, 2018 Did you try enclosing the js code in the document.ready function? And I'd recommending placing the code in the product.js within the document.ready. Link to comment Share on other sites More sharing options...
Podma Posted July 10, 2018 Author Share Posted July 10, 2018 Thank you for the answer. I will try out your suggestion. 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