Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Aug 2009
    Posts
    59
    Plugin Contributions
    0

    Default Adding Code to HEAD and BODY tags?

    Hi All,
    I have a feedback module i would like to install but i am not very good with Zencart and when it asks me to add some code to the <head> and the <body> tags i don't know where i should put it.

    Thanks,
    Asher

  2. #2
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: Adding Code to HEAD and BODY tags

    What kind of code?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Aug 2009
    Posts
    59
    Plugin Contributions
    0

    Default Re: Adding Code to HEAD and BODY tags

    The header needs some javascript and the body some html/css

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Adding Code to HEAD and BODY tags

    Put the javascript inside an appropriately-named file in the prescribed folder, according to this FAQ article, and Zen Cart will automatically load the code for you. No need to touch template files.
    http://www.zen-cart.com/wiki/index.p...s_-_Javascript
    .

    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.

  5. #5
    Join Date
    Aug 2009
    Posts
    59
    Plugin Contributions
    0

    Default Re: Adding Code to HEAD and BODY tags

    what about the body?

  6. #6
    Join Date
    Aug 2009
    Posts
    59
    Plugin Contributions
    0

    Default Re: Adding Code to HEAD and BODY tags

    anyone know?

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Adding Code to HEAD and BODY tags

    What page are you wanting to put it on?
    What's the code you're supposed to put in the body?
    .

    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.

  8. #8
    Join Date
    Aug 2007
    Location
    Cannon Beach, OR
    Posts
    180
    Plugin Contributions
    0

    Default Re: Adding Code to HEAD and BODY tags?

    I need to put the following code into the <head> section of the home page:


    Code:
    <script type="text/javascript">
    __compete_code = 'dcafd398df98a9f097d0384b52d77295';
    (function () {
        var s = document.createElement('script'),
            e = document.getElementsByTagName('script')[0];
        s.src = (document.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') +
            '//c.compete.com/bootstrap/dcafd398df98a9f097d0384b52d77295/bootstrap.js';
        s.type = 'text/javascript';
        s.async = true;
        if (e) { e.parentNode.insertBefore(s, e); }
    }());
    </script>
    This was a request from a company I'm using to do Google Analytics work for me. I didn't know how to convert this into a .js file. If someone can convert this to a form that can be used in a .js file, I can take care of it. But if not, is there a way to add this to the <head> section of the home page?

    Thanks.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Adding Code to HEAD and BODY tags?

    One quick way to do it would be to dump all that code into a new file and upload it to your site as: /includes/modules/pages/index/jscript_compete-com.php

    If it truly needs to *only* appear on the home page, put these two lines in the file first, and then add your code between these two lines:
    Code:
    <?php if ($this_is_home_page) {?>
    put your code here
    <?php } ?>
    .

    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.

  10. #10
    Join Date
    Aug 2007
    Location
    Cannon Beach, OR
    Posts
    180
    Plugin Contributions
    0

    Default Re: Adding Code to HEAD and BODY tags?

    Thanks, Dr Byte. I don't think it will hurt to have that code be available on other pages as well, but I don't know how to convert my code so that it can reside in a *.js file. I can't just copy it as is, can I? Or is it OK just as it is? I think I would at least take out the <script> tags, right?

    Sorry, I'm not too savvy with java script.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Head's tags goes into body tag.
    By zadok.daniel in forum General Questions
    Replies: 3
    Last Post: 7 Jan 2014, 02:42 AM
  2. Replies: 8
    Last Post: 28 Feb 2012, 03:05 PM
  3. Need to add code below </head> tag and above <body> tag in product page
    By Danielle in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Apr 2010, 07:53 PM
  4. Adding code to <head> tags in ezpages
    By donplay in forum General Questions
    Replies: 1
    Last Post: 3 May 2009, 05:13 AM
  5. Adding Custom Javascript to head and body
    By Xena in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 19 Jun 2007, 04:30 AM

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