Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Location
    Northern Rivers, NSW
    Posts
    159
    Plugin Contributions
    0

    help question Adding Custom Javascript to head and body

    I am trying to add a javascript to my site, and having followed all the adive from this site that searching has turned up, it's still not working.

    It is a click to expand menu type script that I want to use with my product description. I have sections in my description that would be good to collapse so the viewer can just open whatever they need to read. The site is www.shopwicked.com/store to give you an idea of the product description layout, but you will see no changes there as the changes have only be added locally.
    The header script needs to be in the head section and the body script needs to be in the product description itself.

    I added my header script to includes/templates/wicked15/product_info/html_header.php just above the </header> tag. I added the body code to the product description via Admin\Catalog\Categories/Products.
    It doesn't work.

    Any help would be most appreciated.

  2. #2
    Join Date
    Dec 2005
    Posts
    1,509
    Plugin Contributions
    6

    Default Re: Adding Custom Javascript to head and body

    Have you tried using the Overrides system yet? You can create just the ".js" file and simply by placing it in the proper override directory, it will be called when the page loads.

    Near the bottom of this page is an example of how to name the file. Basically, any file name that starts with jscript_[yourname] and that is place in the proper directory, will be called when the page loads (which is what it sounds like you are looking for).

    https://www.zen-cart.com/tutorials/index.php?article=36
    Eric
    20 Ways to Increase Sales Using Zen Cart
    Zen Cart contribs: Simple Google Analytics, Export Shipping Information

  3. #3
    Join Date
    Jun 2004
    Location
    Northern Rivers, NSW
    Posts
    159
    Plugin Contributions
    0

    Default Re: Adding Custom Javascript to head and body

    I have tried that method and it didn't produce any results either. I put the header script into a file and named it jscript_expand.js (and tried the .php variant as well) and put it into includes/modules/pages/product_info folder.

    Thank you for the suggestion though

 

 

Similar Threads

  1. Adding Code to HEAD and BODY tags?
    By redpanda in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 3 Nov 2021, 12:02 PM
  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. I need to put something in the <head> and <body> tag
    By milobloom in forum General Questions
    Replies: 10
    Last Post: 18 Jan 2009, 01:01 AM
  5. Where do my head and body elements go?
    By cosmocanuck in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 8 Sep 2006, 10:33 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