Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2007
    Posts
    1
    Plugin Contributions
    0

    Default Including Modules in ZC installation

    Hey all..

    I'm attempting to include the Admin Profiles module in the Zen Cart installation process and I'm having some trouble.

    As Admin Profiles employs some SQL during installation, I'm having some trouble adding the module tables into the DB.

    I include the installation sql into zc_install\sql\mysql_zencart.sql and run the ZC setup but for some reason or other it only creates the tables it doesnt populate them. I don't understand it at all.

    My second thought was to put the sql file inside the install\sql\plugins. I decided to do this based on this code in header_php.php:


    PHP Code:
             for ($i 0$n sizeof($directory_array); $i $n$i++) {
               
    $file $directory_array[$i];
               if (
    file_exists($sqlpluginsdir $file)) {
                 echo 
    '<br />Processing Plugin: ' $sqlpluginsdir $file '<br />';
                 
    executeSql($sqlpluginsdir $file$_POST['db_name'], $_POST['db_prefix']);
               }
             } 
    Again, this didnt work. I even deleted the empty.txt file and tried again.

    Has anyone done something like this before? I create a lot of ZC installations using the same few modules and have been asked to see if i can reduce time down more.

    Thanks,
    Tom

  2. #2
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: Including Modules in ZC installation

    I have added custom sql files to /zc_install/sql/plugins and they load just fine, for install, they dont work well for upgrades though
    Zen cart PCI compliant Hosting

  3. #3
    Join Date
    Jan 2004
    Posts
    66,451
    Plugin Contributions
    81

    Default Re: Including Modules in ZC installation

    Try adding "mysql_" as a prefix to your plugin sql files.

    Oh, and don't forget to make a donation each time you do one of those Zen Cart installs!! It's real easy ... just click here and choose an option: http://www.zen-cart.com/index.php?ma...es&pages_id=14
    .
    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.

  4. #4

    Default Re: Including Modules in ZC installation

    Quote Originally Posted by DrByte View Post
    Try adding "mysql_" as a prefix to your plugin sql files.

    Oh, and don't forget to make a donation each time you do one of those Zen Cart installs!! It's real easy ... just click here and choose an option: http://www.zen-cart.com/index.php?ma...es&pages_id=14
    DrByte,

    Is there a reason they need to be prefixed with mysql_ ?

    I am trying to do a similar thing & had added the SQL files to /zc_install/sql/plugins/XXX_patch_name.sql (where XXX is a number between 000 and 999)

    If I name them that way, the installer ignores them completely -- but if I rename them "mysql_XXX_patch_name.sql" it works correctly.

    I presume that behaviour is caused by the: " . $_POST['db_type'] . " in the preg_match line (line 157) -- if I remove that, would they work the original way?

    (not that I mind either way, just clarifying that I could do it)

    Cheers,

    Paul

  5. #5
    Join Date
    Jan 2004
    Posts
    66,451
    Plugin Contributions
    81

    Default Re: Including Modules in ZC installation

    The "mysql_" prefix is used so that when other database engines are supported they can be differentiated there. You don't want to try running non-MySQL code on a MySQL database, nor vice-versa.

    Short solution: Use the prefix.
    .
    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.

 

 

Similar Threads

  1. Installation complete. When i remove installation folder it resets?
    By zindras2 in forum Installing on a Windows Server
    Replies: 1
    Last Post: 3 Oct 2009, 07:43 PM
  2. including modules into own design?
    By romijade in forum Basic Configuration
    Replies: 7
    Last Post: 25 Jan 2009, 03:51 AM
  3. Modules/Payments: Modules not 'clickable' !?! What now?
    By hva in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 2 Oct 2008, 08:38 PM
  4. 2 Checkout Modules Installation
    By scribbles in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 11 Jul 2007, 05:16 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