Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Dec 2012
    Posts
    66
    Plugin Contributions
    0

    Default Override System in re includes/modules/pages/xxxxxx

    To the More Learned:

    Immediately after installing ZenCart, I set up override directories that I knew I would need, and I've created some additional ones along the way. I of course set up an override directory in includes/modules (includes/modules/keltkar), and I've stored there all of my customized includes/modules files. So far so good.

    Quite recently I made some minor changes to the JavaScript files stored in includes/modules/pages/popup_image and includes/modules/pages/popup_image_additional. I saved the *original* JS files as backups, but once I made my changes, I stored the changed files in the original directories. So to my question: Does the override system extend down to the level of these directories? In other words, should I have created override directories (includes/modules/pages/popup_image/keltkar and includes/modules/pages/popup_image_additional/keltkar)?

    I searched for discussions of this issue here in the forum and via search engines, but found no results. I also tested the matter by setting up the two override directories for the JS files, and they didn't seem to work. That test would seem to have answered my question, but I worry that I made some silly error in the test, so I thought it best to ask more experience users.

    Regards,

    Ken Baker

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,871
    Plugin Contributions
    96

    Default Re: Override System in re includes/modules/pages/xxxxxx

    As you've discovered, there's no direct override for the files in /includes/modules/pages/xxxxx. You can utilize the notifier/override system to perform processing in addition to the header_php.php files and you can define files named header_php_youpickthename.php in the xxxx directory; all files named header_php*.php are loaded (header_php.php first) in alphabetical order. For the jscript*.php and jscript*.js files present in those directories, there is no override possible.

  3. #3
    Join Date
    Dec 2012
    Posts
    66
    Plugin Contributions
    0

    Default Re: Override System in re includes/modules/pages/xxxxxx

    lat9,

    I appreciate your response. I'm a bit disappointed to learn that the override system doesn't extend to these subdirectories, but I'm pleased to learn that I didn't make an error in my test protocol (should trust myself more). Just to confirm, when I next upgrade ZenCart, any changes that I've made to the JS files will be wiped out, correct? If so, that won't be a *huge* problem, as I only need keep a list and backup directory of the changed JS files. I've not yet tried out the notifier/override system, and I'll have to give it some serious study before trying to use it. At first glance, even the name sounds a bit scary.

    Thanks again,

    Ken Baker

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

    Default Re: Override System in re includes/modules/pages/xxxxxx

    Quote Originally Posted by KenBaker View Post
    Just to confirm, when I next upgrade ZenCart, any changes that I've made to the JS files will be wiped out, correct?
    When you're doing an upgrade, YOU have SOLE control over which files get updated. And you can choose to merge your customizations into the new files instead of blindly replacing them. Exactly what happens in an upgrade is completely in your own control.

    Further, if your "changes" are to the actual existing functionality inside those .js files, then yes you must edit them directly. But if you're actually adding additional functionality (such as more functions, more variables, and so on) then you could certainly add more jscript_xxxxx.js files to accommodate that. Everything named jscript_XXXX.js or jscript_XXXXXX.php will be processed, so simply follow that naming convention. (Also, your "backup" files should be sure to NOT follow that pattern, else they'll be loaded all the time too.)
    .

    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
    Dec 2012
    Posts
    66
    Plugin Contributions
    0

    Default Re: Override System in re includes/modules/pages/xxxxxx

    DrByte,

    Thanks for the additional information in re ZenCart upgrade protocols. I haven't yet gone through an upgrade (I started with 1.5.1), so I'm still learning what to expect when the time comes. So far, all the cautionary admonitions that I've encountered have stated categorically that any changes to the standard files in standard directories will be wiped out during upgrades. Nice to know that's not *absolutely* the case. Live and learn.

    As for the changes to my JS files, I did in fact change existing functionality. I've also added a couple new JS files for new functions, but I followed the existing naming convention as a matter of course. I store copies of the JS files (changed and new, the "backups") entirely outside the ZC directory, so I don't reckon I'll encounter any difficulties there. Based on your additional direction, though, I won't need the backups to restore changed JS files after an upgrade. It's still reassuring to have them in my back pocket.

    Thanks again,

    Ken Baker

 

 

Similar Threads

  1. Override of includes/modules/pages
    By sfatula in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 6 Apr 2010, 05:21 PM
  2. how to override includes > modules > pages > page_folder > header_php.php
    By monkeytown in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 Feb 2008, 05:45 PM
  3. Override for includes/modules/pages?
    By dbrewster in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 27 Jan 2007, 04:51 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