Post by porter943 » Sat Feb 22, 2025 11:16 pm

Hello Everyone,
I'm trying to place a Welcome popup box on my website on page load but can seem to find the place (or file) to insert the popup box code, I have tried placing it on the header.twig but it did not work. I'm using OC version 3.0.2.0
Would anyone know where to place the popup box code?
Thank you
Last edited by porter943 on Mon Feb 24, 2025 2:41 am, edited 1 time in total.

Active Member

Posts

Joined
Fri Dec 11, 2015 11:35 pm

Post by JNeuhoff » Sun Feb 23, 2025 12:28 am

Probably the common/footer.twig would be the place to add your JQuery/javascript code for the popup, using an OpenCart event handler.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by porter943 » Sun Feb 23, 2025 12:56 am

Tried that but did not work!
Here is the code I want to insert.
<?php
echo '<script type="text/javascript">
window.onload = function () { alert("Welcome!."); }</script>';
?>

Active Member

Posts

Joined
Fri Dec 11, 2015 11:35 pm

Post by grgr » Sun Feb 23, 2025 6:23 am

You don't need the <?php ... ?> tags.

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by porter943 » Sun Feb 23, 2025 6:46 am

Okay now where do I insert the code?

Active Member

Posts

Joined
Fri Dec 11, 2015 11:35 pm

Post by johnp » Sun Feb 23, 2025 6:33 pm

porter943 wrote:
Sun Feb 23, 2025 6:46 am
Okay now where do I insert the code?
An easy way is to install an extension that lets you add custom JS to the the site header. You just need to add this:

Code: Select all

<script type="text/javascript">
window.onload = function () { alert("Welcome!."); }</script>
If in doubt post in the commercial support forum for some assistance.

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by nonnedelectari » Sun Feb 23, 2025 7:56 pm

A welcome alert on every page load, that's going to be annoying.

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by OSWorX » Sun Feb 23, 2025 11:46 pm

nonnedelectari wrote:
Sun Feb 23, 2025 7:56 pm
A welcome alert on every page load, that's going to be annoying.
No .. really .. ?
Remembers me back in the end of the '90s O0

And javascript?
No, flash would be much better .. :hammer:

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 21 guests