| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
HELP-The CLICK function in my script wont work | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
HELP-The CLICK function in my script wont work
Hi-I have an html file with a script that will overlay and display a box asking Are you 18 years or older? then there is a YES and a NO button -if you click YES the overlay disappears and you can see the site. If you click NO you are redirected to google.com
The html file on my local hard drive runs fine in a browser and you can click YES or NO and it does what it is supposed to.{other than the yes no images not directed correctly, that I can fix. However, when I attempt to insert this into my home.tpl file everything other than the CLICK function works just fine. But you cannot click yes or no. I know NOTHING and I mean NOTHING about java, scripting, php, I slightly comprehend a LITTLE html so any help would be so appreciated. I ahve attached the 2 files-the pop18Clickworks.html is the file that works independently in a browser. The homeclick.tpl file is my home.tpl located in my skin/customer directory Please help me, I know this is a simple script, syntax or format error and that I do not understand-it is all a foreign language to me Thank you so much in advance for any assistance Debbie Xcart Gold pop18Clickworks.txthomeclick.tpl.txt
__________________
xcart gold 4.4.3 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: HELP-The CLICK function in my script wont work
No problem.
I think this is because X-cart's Smarty template engine is attempting to parse the {} tags in your JS code. Try wrapping it with {literal}{/literal} tags. Additionally you have used {} to display your script tags, when it should be <>. And finally you have included jQuery, and jQuery is already included in X-cart, and it should only be included once. So you have not made one, but 3 separate errors! I think you should win a gold star. Try this code, replacing everything you put after {include file="customer/pop18.html"}: Code:
So you also need to remove this line: {script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'}{/script} And I'm not sure about including a .html file like you have here: {include file="customer/pop18.html"} I would rename that file to pop18.tpl and pull it in with: {include file="customer/pop18.html"} But it may be fine, I've never tried to include a .html file before. Leave it that way at first and tell me if it worked!
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#3
|
|||||||
|
|||||||
Re: HELP-The CLICK function in my script wont work
WOW ALMOST ALL FIXED-just 1 last thing- now it all works with just one problem left-it is supposed to clear the overlay when you click YES that works fine-but it is doing the same thing for when you click NO-When you click NO it is to redirect to google.com-
But now it just clears the overlay no matter which one you click see quietcricketus.com How can i fix that? MIKE YOU ARE MY NEW BEST FRIEND!!!! I have been trying for months to find a way to get that restriction on the home page. I cannot thank you enough!!
__________________
xcart gold 4.4.3 |
|||||||
|
#4
|
|||||||
|
|||||||
Re: HELP-The CLICK function in my script wont work
I removed the include html file as it does not work in the home.tpl
however the html file run directly in a browser does redirect to google.com but the same exact code in the home.tpl is not redirecting to google.com whn you click NO it clears the overlay the same as when you click YES I cannot figure out why
__________________
xcart gold 4.4.3 |
|||||||
#5
|
|||||||
|
|||||||
Re: HELP-The CLICK function in my script wont work
Just noticed another problem-I only have this in the home.tpl- however, the same popup keeps coming up everytime you click on any and all pages
why would it do that if I only have the code in home.tpl? is it fixable?
__________________
xcart gold 4.4.3 |
|||||||
#6
|
|||||||||
|
|||||||||
Re: HELP-The CLICK function in my script wont work
Cool, you have an online vape shop. Sweet.
Sure if the code is in home.tpl, it will be called on every page. customer/home.tpl is the container for every customer side page. If you want to restrict it to the home page, you need to add an if statement around all the code. Code:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#7
|
|||||||
|
|||||||
Re: HELP-The CLICK function in my script wont work
Yes, we are just starting out, but if you can have a discount for life!
I will try to enter that if statement and be right back- not exactly sure where it goes, we will see lol What about when you click on the NO button it does not redirect to google like it is supposed to it just fades the overlay away like when you click yes- in the independent html file in a browser it redirects to google when you click no, but does not in the home.tpl file
__________________
xcart gold 4.4.3 |
|||||||
#8
|
|||||||||
|
|||||||||
Re: HELP-The CLICK function in my script wont work
Debbie,
I just read through your file pop18Clickworks.txt That file contains a <html> tag <head> tag, and so on. You should not be including all of that stuff! To explain, your home.tpl already has all those pieces, if you include them a second time it will make for a poorly formatted web page. Rename the file to .tpl, and include only the div class="popup" Just this part: Code:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#9
|
|||||||
|
|||||||
Re: HELP-The CLICK function in my script wont work
ok-I am attaching the home.tpl as it stands now for you to see
I am not using or calling the pop18 html file I took that "include" out yeah I had already removed all the STYLE stuff to the css file so here is the only file i am using which is the home.tpl file attached I am sure I entered the if statement wrong lol also, the popup comes up on the home page and when you click it clears out the overlay but when you click NO it is not redirecting to google.com the popup is still coming up on all the other pages, only you cannot click it to make it go away please see attached file that I apparently screwed up sendtomike.tpl.txt
__________________
xcart gold 4.4.3 |
|||||||
#10
|
|||||||
|
|||||||
Re: HELP-The CLICK function in my script wont work
oops sorry I am sleepy-that one still has the style nonsense in it-I am removing it now
__________________
xcart gold 4.4.3 |
|||||||
|
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|