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:
- Productivity boost
- Conflict Free
- Performance Boost
- 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:
- 22% decrease in number of requests
- 67.5% decrease in css and js file size
More details can be found on RubikIntegration Wiki
Link to download: (Last updated on Aug 26 2009)
(Please download from mirrors first if possible)
Note that download link may change later. If you want to get updated with the latest news, make sure you subscribe to our feed
Related posts:
- New version of CJ Loader released This new version has some major updates: The browser detection...
- The hidden feature of CSS Javascript Loader One of the most important feature many web developers need...
- Zencart + Ajax made easy (part 3) As an update to the long delayed series Zencart Ajax...
- New Zencart Webdesign (Admin backend) If you haven’t known already, we are working with Mano...
- Simple Seo Url + Zencart news Recently some hosts have made a move to php 5.3x,...



Thank you for non-stop developing
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
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/
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.
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!
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?
You can try this instead:
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);
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.
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.
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.
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
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
Never mind.. after upgrading PHP to 5.2.8, it works.
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?
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?
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.
Problem Solved
I just created .png buttons for the french and that worked.
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 ?
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
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.
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
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.
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
If you disable minify, the loader feature will still work.
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.
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.
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!):
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)
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 : )
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.
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 : )
@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