Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Load a js file on ANY page under certain condition?

    I know I can easily do that by using js_whatever.php under modules/pages. But how can this be done on any page? I thought of init_script but I just want to make sure the script is put between the head tags

    Regards
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

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

    Default Re: Load a js file on ANY page under certain condition?

    If you put it in /includes/templates/YOUR_TEMPLATE/jscript then it'll load on *every* page.
    And, if you put conditional PHP in the jscript_xxx.php file, then you can control the certain conditions during which certain portions of the script will run.
    .

    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.

  3. #3
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Load a js file on ANY page under certain condition?

    Thanks doc, I forgot that we can use .php file in there as well.

    Regards
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

 

 

Similar Threads

  1. v151 Offering Free Shipping over a certain amount and under a certain weight
    By jimmie in forum Addon Shipping Modules
    Replies: 0
    Last Post: 17 Aug 2013, 10:58 PM
  2. Any Help? Condition of Use shows incorrectly!
    By sjbglx in forum General Questions
    Replies: 2
    Last Post: 9 Jun 2011, 08:55 PM
  3. Is there any way to speed up this page load?
    By Stuff4Toys in forum General Questions
    Replies: 1
    Last Post: 17 Jun 2008, 04:09 PM
  4. Attribute File - Update value on page load...
    By Alex Clarke in forum General Questions
    Replies: 4
    Last Post: 29 Sep 2007, 11:51 AM
  5. How to Offer Free SHipping over a Certain $$ AND Under Certain Weight
    By Jeff_Mash in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 31 Aug 2007, 06:00 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