Thread: Help me please

Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2010
    Posts
    5
    Plugin Contributions
    0

    Default Help me please

    i need a little help, i'm new to php and zen cart and i want to install a pop up in jquery ui that states if you are under the age of 21 you can not enter my site.. I have the jquery script but i do not understand where to or how to install it. i read a few posts and they did not help me at all. i sell tobacco products and do not want minors not knowing the site is intended for 21 years + viewers. i tried to place it in the javascript folder and in the on load folder but it didn't work. i am also not sure where to place the buttons and text information as well.. thank you in advance. here is my jquery script, also need to know where to place my cookie to check for the answer to my original script.

    <script type="text/javascript">
    $(document).ready(function() {

    $('#test').click(function() {
    $.blockUI({ message: $('#question'), css: { width: '275px' } });
    });

    $('#yes').click(function() {
    // update the block message
    $.blockUI({ message: "<h1>Remote call in progress...</h1>" });

    $.ajax({
    url: 'wait.php',
    cache: false,
    complete: function() {
    // unblock when remote call returns
    $.unblockUI();
    }
    });
    });

    $('#no').click(function() {
    $.unblockUI();
    return false;
    });

    });
    </script>

    ...

    <input id="test" type="submit" value="Show Dialog" />

    ...

    <div id="question" style="display:none; cursor: default">
    <h1>you must be 21 years of age to enter this site. Do you agree to the terms?</h1>
    <input type="button" id="yes" value="Yes" />
    <input type="button" id="no" value="No" />
    </div>
    Last edited by casperphx; 8 Aug 2010 at 07:46 AM.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Help me please

    Read this tutorial and find the section for
    Adding Extra Javascript to a specific page

    https://www.zen-cart.com/tutorials/index.php?article=36
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Aug 2010
    Posts
    5
    Plugin Contributions
    0

    Default Re: Help me please

    i read it, but apparently to stupid to understand it. i added the jscript to the folder onload and everything else it said to do, it still wont work for me. need a step by step help i guess from point a to z. i didnt think i was this dumb. i placed

    file name: jscript_terms.js


    $(document).ready(function() {

    $('#test').click(function() {
    $.blockUI({ message: $('#question'), css: { width: '275px' } });
    });

    $('#yes').click(function() {
    // update the block message
    $.blockUI({ message: "<h1>Remote call in progress...</h1>" });

    $.ajax({
    url: 'wait.php',
    cache: false,
    complete: function() {
    // unblock when remote call returns
    $.unblockUI();
    }
    });
    });

    $('#no').click(function() {
    $.unblockUI();
    return false;
    });

    });

    in the jscript folder and then placed


    file name on_load_terms.js
    terms();

    into the onload folder.

    but can not figure out where to place the <div> buttons and text stating my popup window and also its not popping up blank either..

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Help me please

    i added the jscript to the folder onload
    This is not where it goes

    It should be in a folder named
    jscript in your template folder

    /includes/templates/your_template_name/jscript/
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Aug 2010
    Posts
    5
    Plugin Contributions
    0

    Default Re: Help me please

    i dont understand, this is where my template is located and my jscript folder is

    includes/template/template_default/jscript

    i placed the jscript in there, and then in the onload folder placed the file and text in the file onload=terms();

    but have no idea where to add my

    <div id="question" style="display:none; cursor: default">
    <h1>you must be 21 years of age to enter this site. Do you agree to the terms?</h1>
    <input type="button" id="yes" value="Yes" />
    <input type="button" id="no" value="No" />
    </div>
    with the buttons, am i doing this completely wrong, as i said before im new to this php stuff and this is my first php page..

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Help me please

    I am not familiar with your script but onload terms has no code for diplay that you have referenced

    You need code to display antthing
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Aug 2010
    Posts
    5
    Plugin Contributions
    0

    Default Re: Help me please

    exactly, i do not understand and would like help walking through the process. I am installing a jqury mask block script so people accessing my site must read the terms i place in the <div> tag and then agree to enter or leave... but its not working. i know you are not i do not think im a complete idiot but this is my first php page and i have no idea where to start or what to edit, think i have done pretty good so far but now im stuck on this javascript onload function. please help. what to place in the onload file in js and also where to place my div code from

    <div id="question" style="display:none; cursor: default">
    <h1>you must be 21 years of age to enter this site. Do you agree to the terms?</h1>
    <input type="button" id="yes" value="Yes" />
    <input type="button" id="no" value="No" />
    </div>


    thank you for your help so far
    Last edited by casperphx; 8 Aug 2010 at 08:34 AM.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Help me please

    Are you wanting this just on the home page? Or every page?

    Your custom HTML needs to go into a template file ... probably /includes/templates/Name_Of_Your_Custom_Template/templates/tpl_index_default.php ... probably above the first <div>
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Aug 2010
    Posts
    5
    Plugin Contributions
    0

    Default Re: Help me please

    what i want is a cookie to detect if you have agreed to my terms and conditions of the page before entering, it pops up on page load only you select yes or no and then you do not see it again for 30 days of the cookies life. this way if someone finds me on google and misses my homepage they still see my box. i am making a smokeshop to sell pipes and scales but my lawyer has advised me to make sure i advise everyone they must be 21 years of age or older to enter so i avoid any legal problems state by state.

    is there a way i can add my cookie info and my javascript into an html page and then somehow echo that into php code into my tpl_header or something like that or is there a simpler way?

 

 

Similar Threads

  1. v150 $db-Execute() issue with fields... Please please please help.
    By Ooba_Scott in forum General Questions
    Replies: 11
    Last Post: 3 Oct 2012, 09:36 AM
  2. Replies: 4
    Last Post: 1 Oct 2010, 05:09 AM
  3. Please Please HELP! Cross Sell not working... Any ideas People?
    By jorsara in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 Mar 2010, 12:08 AM
  4. Please anybody please help with Scrolling Sidebox Mod. in IE8
    By hcd888 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 2 Oct 2009, 03:42 AM
  5. Please help please!Premature end of script headers: index.php (null)
    By fangzhouws in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 11 Aug 2006, 06:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg