Page 1 of 1

Adding javascript calculator to a single page

Posted: Wed Apr 10, 2019 5:04 am
by mrvogl@gmail.com
Hi, not sure if this is the right area to ask. But I'm trying to add a javascript fuel system calculator to a single page. I created a fuelcalc.js file with the script and uploaded it to catalog/view/javascript. But i'm not sure how to make it display on a page. Preferably I'd like a Tab at the top next to my other product categories that's called "calculators", but instead of products in this tab it would be an assortment of various .js automotive calculators i've created.

I used to use zencart like 6 years ago and I used EZpages to do what i'm trying to do, then I switched to prestashop and cant remember what I did to get the calculator up, but I did it. What i'm trying to do can be seen at wannaspeed.com (for now, i'm switching to opencart and it will be gone in a day or so)

Re: Adding javascript calculator to a single page

Posted: Wed Apr 10, 2019 7:43 pm
by paulfeakins
From your post you sound incredibly non-technical so I think you should probably pay a developer from the Commercial Support Forum to do this one for you:
viewforum.php?f=88

Re: Adding javascript calculator to a single page

Posted: Thu Apr 11, 2019 1:06 am
by mrvogl@gmail.com
paulfeakins wrote:
Wed Apr 10, 2019 7:43 pm
From your post you sound incredibly non-technical so I think you should probably pay a developer from the Commercial Support Forum to do this one for you:
viewforum.php?f=88
No I don't need to pay someone. Maybe I'm not "technical" or familiar with opencart. However I learn what I need to when I need to learn it and always manage to figure it out. I've managed to accomplish this same task across 3 different platforms spanning nearly 10 years. The last time I had to do this was 3 years ago, so I'm out of practice but that doesn't mean I don't have the intelligence to get it done. Anyone else have more helpful information?

Re: Adding javascript calculator to a single page

Posted: Thu Apr 11, 2019 2:17 am
by mrvogl@gmail.com
The wannaspeed website is now redirecting to my test opencart site. So I can't show my example, But I managed to replicate what I'm trying to do in a demo build of Abantecart found here

Re: Adding javascript calculator to a single page

Posted: Thu Apr 11, 2019 2:45 am
by thekrotek
You can create a new information page, then add a check for its information_id value and if it matches, add a link yo your JS file.

Re: Adding javascript calculator to a single page

Posted: Thu Apr 11, 2019 3:23 pm
by pprmkr
- Create a new Extension / Module : FuelCalculator
- Add new layout: FuelCalculator
- Add module FuelCalculator to layout FuelCalculator
- Select Layout Override : FuelCalculator for the Information page, Product or Category you want to show FuelCalculator on ...

Attached is example for OC 2.3.0.2 ( the most stable version to use ! ) ( see demo )

Re: Adding javascript calculator to a single page

Posted: Fri Apr 12, 2019 4:36 am
by mrvogl@gmail.com
Thank you for the replies guys! I'll have to work on this later as I had to focus on getting my main site moved away from godaddy hosting.