Zencart Css Javascript Loader Released

Yes, Zencart Css Javascript Loader aka CJ Loader is finally released (well, technically it has been released for a while but this is the first official version).

This 1.6 version is packed with tons of new features that will SPEED UP your Zencart store and MAKE LIFE EASIER for you.

At a glance:

  1. Productivity boost
  2. Conflict Free
  3. Performance Boost
  4. User Friendly / Cross browser compatibility

Seeing is believing

Alright, so you want us to show you some statistics to prove that right? We did a little experiment ourselves on Eazy-Templates.com:

Before minifying with CJ Loader

After minifying with CJ Loader

Performance boost:

  1. 22% decrease in number of requests
  2. 67.5% decrease in css and js file size

More details can be found on RubikIntegration Wiki

Links: https://github.com/yellow1912/cjloader

Note that download link may change later. If you want to get updated with the latest news, make sure you subscribe to our feed

65 Comments

  1. Thank you for non-stop developing

    Reply
  2. We are very pleased with the noticeable performance gain reported from people who installed this plugin.

    We also discovered a minor bug in the last release and thus encourage everyone to update the module, same link, just overwrite all files

    Raine

    Reply
  3. Updated with the new “browser” class to give better browser detection

    Credit goes to
    http://mavrick.id.au/programming/2008/the-all-new-php-browser-detection/

    Reply
  4. Useful Tools | Numinix Blog

    [...] Zen Cart CSS JavaScript Loader – originally developed here at Numinix, this module was completed by Rubik Integration and allows Zen Cart stores to quickly and easily minify their CSS and JS files to decrease the number of HTTP objects downloaded on the site. [...]

    Reply
  5. I really love this module and recommend it to EVERYONE. I’ve been running my store for 6 months and it has been slow. I blamed several factors including the number of pictures on my site, my webhost and some careless table html in my template (that I plan to fix) but when I found the JS Loader I thought I’d give it a spin and I have noticed an INCREDIBLE difference.

    Thank you very much for this good work.

    Reply
    • I have this installed but have not been able to get it to work. If anyone can assit me that would be great. Thanks so much!

      Reply
  6. New version of CJ Loader released | eCommerce and Marketing News & Tips

    [...] to get the new version has been updated on the original Zencart CSS Javascript Loader [...]

    Reply
  7. The hidden feature of CSS Javascript Loader | eCommerce and Marketing News & Tips

    [...] modules available on Zencart download that provide this specific feature, but if you already use CJ Loader (and you should), you already has this [...]

    Reply
  8. INSTALLATION FAILED!?!?

    I have ZC v 1.3.8a and tried to install CSS JS Loader, but the configuration pages in the ZC admin->Configuration area are just blank without any entry column (only first column with titles available)!!!

    When running the CSS JS Loader SQL patch I got the error message ‘Cannot insert configuration_key “” because it already exists’. I ignored this message and proceeded.

    Could this be the problem?

    I am kind of lost!!! Why don’t I see the content of the configuration page?

    Reply
    • You can try this instead:

      SET @t4=0;
      SELECT (@t4:=configuration_group_id) as t4
      FROM configuration_group
      WHERE configuration_group_title= 'CSS/JS Loader';
      DELETE FROM configuration WHERE configuration_group_id = @t4;
      DELETE FROM configuration_group WHERE configuration_group_id = @t4;

      INSERT INTO configuration_group (`configuration_group_title`,`configuration_group_description`,`sort_order`,`visible`) VALUES ('CSS/JS Loader', 'Set CSS/JS Loader Options', '1', '1');
      UPDATE configuration_group SET sort_order = last_insert_id() WHERE configuration_group_id = last_insert_id();

      SET @t4=0;
      SELECT (@t4:=configuration_group_id) as t4
      FROM configuration_group
      WHERE configuration_group_title= 'CSS/JS Loader';

      INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES
      ('Enable Minify', 'MINIFY_STATUS', 'true', 'Minifying will speed up your site\'s loading speed by combining and compressing css/js files.', @t4, 1, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'),
      ('Max URL Lenght', 'MINIFY_MAX_URL_LENGHT', '500', 'On some server the maximum lenght of any POST/GET request URL is limited. If this is the case for your server, you can change the setting here', @t4, 2, NOW(), NOW(), NULL, NULL),
      ('Minify Cache Time', 'MINIFY_CACHE_TIME_LENGHT', '31536000', 'Set minify cache time (in second). Default is 1 year (31536000)', @t4, 3, NOW(), NOW(), NULL, NULL),
      ('Latest Cache Time', 'MINIFY_CACHE_TIME_LATEST', '0', 'Normally you don\'t have to set this, but if you have just made changes to your js/css files and want to make sure they are reloaded right away, you can reset this to 0.', @t4, 4, NOW(), NOW(), NULL, NULL);
      Reply
  9. Thanks, this blog aided me somewhat in narrowing down some problems with the latest release, Why do they always seem to leave out vital information when they release a new version? It may be trivial to them but not for us! I’m sure we’re not alone either.

    Reply
  10. Stuart Fevrier

    I’m getting a blank page after installing CJ Loader and Jquery Lightbox, here is the error I’ve received: PHP Parse error: syntax error, unexpected ‘)’, expecting ‘(‘ in /catalog/includes/classes/class.cj_loader.php on line 158

    if (file_exists(DIR_WS_CLASSES . ‘browser.php’)) {
    include(DIR_WS_CLASSES . ‘browser.php’);
    $browser = new _Browser();
    $browser_name = $browser->getBrowser();
    line158 if ($browser_name == _Browser::BROWSER_IE) {
    $browser_name = ‘ie’;
    }
    else
    $browser_name = preg_replace(“/[^a-zA-Z0-9s]/”, “-”, strtolower($browser_name));

    $browser_version = floor($browser->getVersion());

    // this is to make it compatible with the other ie css hack
    if ($browser_name == _Browser::BROWSER_IE) {
    $browser_name = ‘ie’;
    }

    Can any one help.

    Reply
    • It is possible that you are using php4, CJ Loader requires PHP5.

      You can also comment out the whole part (which including several lines of code) in that “if” so that browser.php is not called. You will lose the ability to be able to use that specific feature (load css/js by browser) but that shouldnt affect jquery lightbox.

      Reply
      • I tried removing those lines as you suggested however I still get the same blank page with that line 158 error. This is the second time that I tried to install this, both times I got blank page. I need to have this module in order to provide the guest checkout function as customers are asking for it however I can’t seem to install this successfully.

        i appreciate any help to get this working. thanks

        Reply
        • We can’t really help if you just provide us the info that you see a blank page. A blank page means a fatal error appears, but which fatal error? Without that kind of info there is no way we can help. It’s similar to calling a car center telling them your car broke down without giving any additional info. In such cases, you have 2 options:
          1. You will have to provide more info so the support center can help you somehow
          2. You will have to wait for the road service team to come and help you, of course you will have to pay all the expense in this case

          Here, the situation is the same. You will need to give us more info, or you can have us go into your site and fix the issue for you, but it will not be free service

          Reply
        • Never mind.. after upgrading PHP to 5.2.8, it works.

          Reply
  11. Stuart Fevrier

    I’ve just noticed that I’m having a slight problem on the eve before going live. I’ve got two languages set up for the store, and when to did the installation, I had English set up as my default language, but now that I’ve set it to French, I have now buttons display for the different steps even if I’ve copied the buttons to the includes/templates/
    etondiffusion/buttons/french folder.

    I’ve checked the View source code and have

    for example. I’ve tried copying the buttons to the default folder but still got no results.

    Also is it normal that it is calling a .png file when the buttons are .gif? I’ve got the same in the english file but some how that works normal. generated code :

    Can any one help as I’m out of solutions?

    Reply
    • Stuart Fevrier

      I’ve just noticed that I’m having a slight problem on the eve before going live. I’ve got two languages set up for the store, and when your team helped me with the installation, I had English set up as my default language, but now that I’ve set it to French, I have no buttons display for the different steps even if I’ve copied the buttons to the includes/templates/
      etondiffusion/buttons/french folder.

      I’ve checked the View source code and have “”

      for example. I’ve tried copying the buttons to the default folder but still got no results.

      Also is it normal that it is call a .png file when the buttons are .gif? I’ve got the same in the english file but some how that works normal. generated code : “”

      Can any one help as I’m out of solutions?

      Reply
      • Stuart Fevrier

        Some how I keep posting the generated html but nothing seems to appear in the post. I’ll try one late time.

        Here is the code generated from the French page :

        This doesn’t seem right as I’m not using the default template.

        Here is the code generated from the English page :

        Like I stated previously, the English page displays the buttons, but the French page has no buttons displayed. I’ve even copied the buttons to the template_default folder but that does seem to work.

        Do I have to rename the buttons as .png files? Although that doesn’t seem to be the problem with the English version.

        Any help would be greatly accepted.

        Reply
        • Stuart Fevrier

          Problem Solved

          I just created .png buttons for the french and that worked.

          Reply
  12. I am having trouble installing the “CSS JS Loader” that is required for the latest version of Fast and Easy Checkout (FEC) to work.

    The process hangs right in the 1st Step, when I try install the “SQL Patch” using this file “cj_loader_install.sql”

    The broswer run for a few seconds after clicking the “Send” button and then just hangs …. !

    I have tried different browsers but same result.

    I am running
    ZenCart Version 1.3.9e
    Windows 2008 Server (IIS 7)
    PHP Version 5.2.13
    MySQL 5.0.51a

    Can someone plz suggest any solution ?

    Reply
    • This problem doesn’t seem to have anything to do with the module, it’s rather the issue of the sql patch tool somehow not working as it should. You may also try to run the patch directly via phpmyadmin for example, of course if you do so you will have to manually add prefix to the table names if you are using prefix

      Reply
      • Thanks, I got it installed… Instead of “copy & paste” the SQL code in SQL Patch window, I uploaded the SQL file and it processed and installed the scripts in a flash.

        Reply
  13. After installing CJ Loader and FEC Checkout Module. CJ Loader is not loading CSS files … All pages are messed up, looks like that CSS file is not loading …. Any help is appreciated.
    Here is my website http://governmenttraininginc.com/gticart/

    Thanks

    Reply
    • It’s loading, it’s just that your server configuration somehow prevent minify to work properly (it is returning the error HTTP/1.0 400 Bad Request). I suggest the quickest fix is to go to your admin – cj loader config to turn of minify option. You of course will then lose the benefit of having your css/js files minified, but the files will load normally for you.

      Reply
      • But if I disable “Minify” from the Admin Panel, the Fast & Easy Checkout Module will also not work, and I really want that module to work. Any other fix ? Thanks

        Reply
        • If you disable minify, the loader feature will still work.

          Reply
          • Yes, the loader may work but “FEC” won’t ? I just disabled minify from admin, and now the “FEC” is not working/showing ?

          • Nerver Mind, My Bad, I didn’t turned on the “Checkout Without Account” option from the “FEC Configuration” in the Admin Panel, I just turned on the following 2 options

            1. Fast & Easy Checkout and
            2. One Page Checkout

            I thought “Fast & Easy” checkout is same as “Check without Login/Account”. The terminology looks so similar that it confused me.

  14. Hi,

    I recently installed the Zen Cart Tabbed Products Pro module which included this handy CJ Loader as well. I’m keen to use it as I have 15 stylesheets (eek!). I have 1 problem and 2 questions:

    Problem: CJ Loader is compressing what should be ‘trebuchet ms’ into ‘trebuchetms’ (minus the space) which I think is causing my browser (firefox – latest version) to not recognise ‘trebuchetms’ as a font. Instead it uses the next available font (for me it’s veranda). How can I fix this?

    Question #1: I noticed their has been a new version of CJ Loader released since the TPP author originally packaged TPP and CJ Loader together. How hard would it be to update the CJ Loader version packaged within TPP ( a few years old now) to use the latest CJ Loader version?

    Question #2: When I disable CJ Loader via my ZC admin (was just testing a few things) the links to the stylesheets contain an extra ‘/’ forward slash before them. Is this a problem that I should worry about? Do you know a way of fixing it? See example below:


    Thanks.

    Reply
    • Whoops looks like the example stylesheet link was blocked.. probably thought I was spam lol. Here’s another go (with a few spaces chucked in!):

      Reply
    • Problem with minify: well, maybe you are doing it wrong. The correct way should be “trebuchet ms” (you have to quote the font name if there are spaces in between).

      Question #1: well, it’s relative easy I think, simply upgrade all the CJ related files only, take care of html_header.php file though, if you hardcoded css/js link in there then you may want to compare and merge.

      Question #2: the site seems to block out the link, so I don’t know. There should not be any problem though (if the site is loading the files just fine then it’s okie)

      Reply
      • Hi,

        Thanks for the quick response.

        Yep.. putting quotes around “trebuchet ms” fixed the css issue (schoolboy error I know lol!), thanks for that.

        Yep all stylesheets are loading fine with cj loader turned off via admin and the extra forward slash – so I won’t worry about that.

        The only difference I could find in the latest versions /min/ folder when compared to the /min/ folder in Tabbed Products Pro was some true/false settings in the /min/config.php file so I just went ahead and updated that. As for the Zen Cart side of the files their are quite a few differences between the TPP version and your latest version.. comparing and merging these differences is a bit beyond my abilities. So I guess I’ll just stick with the older CJ Loader version that is packaged with TPP. Their wasn’t any major bugs with the older version was their?

        Also I was wondering about the /min/.htaccess file – as your probably aware ZC 1.3.9x implements various .htaccess based security measures – would it be ok the add the ZC .htaccess security measures to the existing /min/.htaccess ? And also it seems that /min/cache/ fills up fairly quickly – do I need to clear it every now and then? Or does it clear automatically?

        Thanks for your help so far : )

        Reply
        • You can keep the old version I believe. There were a few bugs fixed etc, but if older version is working for you then you dont have to do anything.

          In case you want to upgrade, I believe you dont have to merge other files, just overwrite all files except html_header.php if you made changes to this file before, otherwise you can also overwrite it. Remember that there are files needed to be deleted from older version, those files are listed in the readme.

          Reply
          • Hi,

            Again, thanks for the quick response. In that case I think I’ll just stick with the older version, maybe I’ll contact you in the future for a quote to do the upgrade.

            Also, sorry to be a pain but can I get an answer to the bottom part of my previous post regarding clearing the /min/cache/ & implementing .htaccess security in /min/

            Thanks : )

  15. @TJ: Frankly speaking, I don’t know. If you want you can put it in there, if it doesn’t work anymore you know you have an issue and you know the cause

    Reply
  16. Hi, I’ve been using your Modern Zen template which uses the css js minify loader – I’m having a serious problem since I started configuring my shared SSL though!! for whatever reason, it’s not loading the proper URL’s for the images on secured pages – it’s literally missing part of the address. I can’t figure out where to even START looking to fix this!

    its so strange- when I have minify enabled from the admin, the layout looks right, but the images don’t display – but when i have it DISABLED, it’s like it’s not loading the CSS page at all.

    Where did I go wrong?? and how do i fix it??!
    any help would be much appreciated.
    www frozenrosedesign com

    Reply
  17. I’ve been using this add-on since it was released and am in the process of updating to ZC v1.3.9, using the ZC feature where you can have a local (e.g. XAMPP) version of the configure.php file in the directory /includes/local.

    This, unfortunately, breaks the CJ Loader function since it doesn’t recognize the /local directory. To fix this, the first line in the file /min/config.php needs to be modified to:

    // added for Zen Cart
    if (file_exists(‘../includes/local/configure.php’)) {
    include(‘../includes/local/configure.php’);
    } else {
    include(‘../includes/configure.php’);
    }

    Reply
  18. Hi,

    I was wondering how I can add the auto loader and minify function to a simple banner rotation java script I use on my homepage?

    The banner is located in the following directory of my site:

    includes/templates/trublu/jscript/banner_rotator.js

    Do I just add a file to the /auto_loaders/ directory or something? I’m not sure :s

    Thanks.

    Reply
    • It’s that simple, add a file to your auto_loaders template, if you have other modules using CJ Loader you can open and view the content for reference. If you want to load the file on the homepage only, the “pages” would be array(‘index_home’)

      Reply
      • Hi,

        Thanks for the reply. I did look at the loader_sample.php.sample file and I have read the readme.txt but as a complete php novice I’m still struggling. Using another loader_ file from another mod I came up with this (please don’t laugh haha!!):

        array(
        ‘banner_rotator.js’ => 1,
        );

        I have the above code in a file I have named loader_banner.php which I have placed in the /includes/templates/my_template/auto_loaders folder. Unfortunately that just gives me a blank page! Any ideas where I’m going wrong?

        Also two questions:

        #1: Should the ‘jscript_files’ => array code above instead read ‘jscript’ => array( – as the name of my javascript folder in my store is just /my_template/jscript/ – or have I got that completely wrong and it has nothing to do with it!?!

        #2: Will the array(‘index_home’) work for both the http://www.example.com/ & http://www.example.com/index.php?main_page=index pages or will it only work on index.php?main_page=index

        Thanks.

        Reply
        • Oh dear – it looks like most of the php code I pasted in my previous post has been blocked as spam or something. Maybe I can email you the file?

          Thanks.

          Reply
  19. Hi,

    I was reading this post on how to load browser specific stylesheets, but I don’t fully understand how to do it:

    http://blog.rubikintegration.com/2010/04/22/the-hidden-feature-of-css-javascript-loader/

    So if I want to load a different stylesheet for ie6 do I just create a stylesheet called ie6.css ?

    Thanks.

    Reply
    • Ok so I think I have managed it by creating a stylesheet called ‘ie6-stylesheet.css’ (still not sure if this 100% correct though?)

      One thing I have noticed though is that when I view the page source in IE6 the normal stylesheet.css and the IE6 browser specific ie6-stylesheet.css are *both* loading. Is this normal?

      Thanks.

      Reply
  20. The Top 10 Free Zen Cart Modules

    [...] Rubik Integration Download: http://blog.rubikintegration.com/2009/08/08/zencart-css-javascript-loader-released/ What does this module do? This module adds the ability to load stylesheets and JavaScript files [...]

    Reply
  21. is there a demo? I am trying to use it on my site. Thanks for your excellent work!

    Reply
    • There is no demo because well it’s not something to look at (UI wise), you can however check many sites using it, such as eazyecommerce.com

      Reply
  22. hmmm, pretty nice work, with this loader the store becoming more faster.

    Reply
  23. New feature for CSS Javascript Loader | eCommerce and Marketing News & Tips

    [...] resolve that problem, I have added a new feature to our loader, this feature will greatly help in reducing the risk of loading the same library more than once. If [...]

    Reply
  24. ” At a glance:

    Productivity boost
    Conflict Free
    Performance Boost
    User Friendly / Cross browser compatibility “.

    Did your CJ loader succeed on all these pros you mentioned? It seemed that the subscribers have some problems installing and using it at first. But you handled them well by explaining. So I guess this will do for now.

    Reply
    • most users have problems with installation because they either did not follow the installation process correctly or lack the knowledge of the site’s css/js (in some cases, further tweaking needs to be done for best result)

      As far as the goals go, we believe that this module has given a way for devs as well as store owners to prevent conflicts of js, minifying css/js for performance

      Reply
    • This module works straight out of the box.

      But with all Zen Cart add-ons, you have to follow instructions to the letter.

      When you don’t do that, it will not work.

      Reply
  25. Franklin Veaux

    I’ve run into what seems to be a bug in the way that CSS JS loader does its minification: if you have a template in a directory whose name contains spaces (such as “my template directory”) then CSS in this directory won’t load. The minify creates a correct path to the CSS file, but it doesn’t quote the path, so on many servers the CSS never loads–since the path to a CSS file must be quoted if it contains spaces. Any ideas about how to work around this?

    Reply
    • I think you should always avoid spaces in the folder name. Renaming the folder seems to be the best option.

      Reply
  26. I might be having a dim moment here – but where is the link to download the module?

    Reply
  27. Where can I find the link to the newest release?

    Thank you,

    Avel

    Reply
  28. I keep getting the following errors:

    [20-Nov-2011 16:01:48] PHP Warning: require_once(/home/peifkcom/public_html/shop/plugins/riCjLoader/RiCjLoaderPlugin.php) [function.require-once]: failed to open stream: No such file or directory in /home/peifkcom/public_html/shop2/includes/init_includes/init_ricjloader.php on line 12

    [20-Nov-2011 16:01:48] PHP Fatal error: require_once() [function.require]: Failed opening required ‘/home/peifkcom/public_html/shop/plugins/riCjLoader/RiCjLoaderPlugin.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/peifkcom/public_html/shop2/includes/init_includes/init_ricjloader.php on line 12

    I triple checked that all files are in the correct location. Is it due to the sub-domain? Any ideas?

    Zen Cart 1.3.9h

    Thanks

    Reply
    • Found an error in my cart’s config files. Made the correction and now getting the following:

      [20-Nov-2011 16:34:47] PHP Parse error: syntax error, unexpected T_DNUMBER, expecting ‘)’ in /home/peifkcom/public_html/shop2/includes/templates/gold_passion/auto_loaders/loader_new.php on line 33

      Reply
  29. Hi,

    Will this work with Zen Cart v1.5.0?

    Thanks.

    Reply
    • It should work with zen 1.5.0 but you may also want to check the new version, link will be posted soon

      Reply

Leave a Reply



Warning: Unknown: open(/tmp/sess_ebd01907ff4d4c822063f3ea4ec7be22, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0