Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009
    Plugin Contributions

    Default Encapuslated Plugin changing admin base files

    Zc: 1.5.7c
    php 7.4

    I am trying to write an plugin using the new encapuslated plugin method. I need to modify the invoice.php and packingslip.php files. So I have made the modification and placed them in zc_plugins\...\admin assuming that they would override the exisiting files. This does not appear to be happening. Is this the intended method or have I misunderstood how this should work.

    Should they be placed in the YOURSTORE\YOURADMIN and overwrite the existing files?

    As a thought would it be useful to have a sction in the forum for encapuslated plugins?
    Mark Brittain

  2. #2
    Join Date
    Jul 2012
    Plugin Contributions

    Default Re: Encapuslated Plugin changing admin base files

    So, what I've seen is exactly as you describe. Meaning, if a file exists at the root of the plugins directory, then basically if it also exists in YOUR_STORE/YOUR_ADMIN the YOUR_STORE/YOUR_ADMIN version loads. If YOUR_STORE/YOUR_ADMIN doesn't include that file, then it is loaded from the plugin's directory. I haven't investigated what happens if multiple plugins have that same file in their directory without it being in YOUR_CATALOG/YOUR_ADMIN. I would suspect that some "last" version would be the one retrieved.

    My thought for retaining files in the zc_plugins directory only is that any of three things could be done, one would be to change/adjust file information another to modify/adjust database information or possibly apply file information that modifies "the database" information...

    So, if the real/original admin/xxx.php file is missing (renamed or removed) then the zc_plugins version of the file is considered. At the same time if the database reference to the information were in some way modified to point to the plugin's version of the file (*assuming* such were possible.) then when loading this plugin's software on install the admin menu would point to it. The third option would be addressed by placing a file that loads before the database loads so that the associated database link to file location is defined before any other such definition (*assuming* such is possible.)

    The long and short of it though is, if there were multiple plugins that touched the same file, what would be the way for the user to access the operation such that all desired features would be available? Having the file in the zc_plugins directory override the file in YOUR_STORE/YOUR_ADMIN would require some sort of either automated or manual merge process. There is no automated merge process as a part of the process and a manual merge in the zc_plugins directory to account for all possible uses/overrides would in my opinion be far more complicated than making the necessary edits to the file in YOUR_STORE/YOUR_ADMIN. That said, it seems to me that it would be best if those modifications wouldn't stop normal operation in absence of the plugin being installed. Now, there are at least 2 alternatives that come to mind associated with the changes being made:
    1. Use of the notifier/observer process
    2. Use of ajax and/or javascript, jquery or the like.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...



Similar Threads

  1. v155 Merging Files for Numinix Product Fields plugin
    By adb34 in forum General Questions
    Replies: 4
    Last Post: 20 Jun 2017, 07:56 PM
  2. v151 Plugin FCKeditor - where do I put the files?
    By nomadrw in forum Basic Configuration
    Replies: 2
    Last Post: 19 Oct 2012, 03:33 AM
  3. Changing the base currency
    By omeriqbal in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 8 Nov 2010, 05:49 AM
  4. Replies: 0
    Last Post: 16 Apr 2007, 05:04 PM
  5. Solution for converting Froogle files to Base complient file
    By brimsjewelry in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 4 Jul 2006, 05:29 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
Zen-Cart, Internet Selling Services, Klamath Falls, OR