Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2017
    Location
    NJ
    Posts
    2
    Plugin Contributions
    0

    help question New to Software/Need to Add a McAfee Javascript Code

    Hey Everyone,

    Fairly new to this software and trying to get a better understanding of it conceptually...

    Anyways, I need to add a McAfee security Javascript code on my website so that it becomes certified.

    Can anyone tell me how to add this?

    I do not have ZenCart downloaded to my macbook (running Sierra) and have been using the web admin portal to add products and edit the layout.

    Please Advise!

    Thanks!

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: New to Software/Need to Add a McAfee Javascript Code

    Only one question.... What do McAfee say? Do they say it needs to be added into the header? The footer? All pages? Index page only? Lots of possibilties here. We need another clue.

    Cheers
    Rod

  3. #3
    Join Date
    Feb 2017
    Location
    NJ
    Posts
    2
    Plugin Contributions
    0

    Default Re: New to Software/Need to Add a McAfee Javascript Code

    In the email they sent, it said: "Add the following JavaScript code to every page of your site. Copy and paste the code snippet right above the </body> tag onto every page or into a template file."

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: New to Software/Need to Add a McAfee Javascript Code

    How much "code" needs to be added?

    If it's just a couple of lines, then you do this in:

    includes/templates/YOUR-TEMPLATE/common/tpl_main_page.php

    At the bottom of that file, you will see the </body> tag...
    20 years a Zencart User

  5. #5
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: New to Software/Need to Add a McAfee Javascript Code

    If you keep your template files up-to-date with your current version of ZC, then in ZC 1.5.5 there is now a notifier in the file identified by schoolboy (notifier somewhat works like an old style gosub (basic language programming construct/area of code) or depending on the content within the observer it could cause the action to turn into a goto, never to return).
    The notifier can be observed (Those are two key words notifier/observer that are becoming more frequently used to minimize changes to the code itself and are discussed in the FAQ/Wiki) and the observer can "insert" your McAfee information.

    Assuming (it is far more helpful to your situation whatever it may be to provide more information than less as long as that information isn't specifically business sensitive or insecure) that you are using ZC 1.5.3 or higher the observer could be constructed like so:

    New file:
    /includes/classes/observers/auto.mcafee_script.php

    With the following content as a minimum.
    PHP Code:
    <?php
    /**
     *  Observer to support using the McAfree Script that was provided from:
     *  and by writing to/going to here: I can get an updated copy of this.
     *  The reason I have this installed is to/so:
     *  I am documenting this so that I understand why this file is here, so that in the future when I upgrade I can make
     *   a more informed decision about keeping it.  Also if I search for something in here, I know why I have kept it.
     *
     *  Observer template file provided by mc12345678 17-02-03 (YY-MM-DD)
     *
     **/

    class zcObserverMcafeeScript extends base
    {
      public function 
    __construct()
      {
        
    $observeThis = array(); // Define variable as an array so that PHP will not generate myDebug logs in the logs directory.
        
    $observeThis[] = 'NOTIFY_FOOTER_END'//Notifier to be observed. Additional notifiers can be added by in a similar method.

        
    $this->attach($this$observeThis); // function to call to allow the code to be triggered when the notifier(s) are reached.
      
    }

      
    // Function that is supported in ZC 1.5.3 without additional code being copied to the store by use of update + Camel_Case of notifier: NOTIFY_FOOTER_END
      
    public function updateNotifyFooterEnd(&$notifierClass$notifier)
      {
        
    ?>YOUR SCRIPT/CODE<?php // Substitution of information into YOUR SCRIPT/CODE operates the same as placing html just before the </body> tag.
        /* Or if you are supposed to use php to say echo something then uncomment the next line (remove the two forward slashes) and incorporate your script text that has not been provided to us to make this easier */
        // echo 'The information requested to be echoed (displayed to user) but with appropriate quote escape as applicable';
      
    }
    }
    Note, there is no space or other character before the first <?php. That set of characters should be the first thing in the file.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Add software registration code to confirmation email
    By StartShield in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 19 Aug 2009, 02:33 AM
  2. Where to add some javascript code?
    By snowy2007 in forum General Questions
    Replies: 11
    Last Post: 22 Feb 2009, 03:31 PM
  3. need to add some code at the bottom of home page
    By ssbeats in forum General Questions
    Replies: 1
    Last Post: 19 Nov 2008, 05:42 PM
  4. Mcafee scan says I need to fix I need help please??
    By touchclothing in forum General Questions
    Replies: 2
    Last Post: 30 Sep 2008, 08:57 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR