Magento product list AJAX scroll v2.0

Featured

A year ago, I posted an article describing our free Magento extension: Magento product list AJAX scroll v1.1. It enables your customers to view more products at less effort, hence having a positive influence on conversion. One year, 160 wordpress comments, thousands of downloads and a lot of email messages have passed…

Shiny new features!
As stated, we are happy to turn your input into new functionality. Now the time has come make true on that promise. As you know the extension for Magento is just a kind of “wrapper” around the jQuery plugin Infinite Ajax Scroll created by Jeroen Fiege. He released a few new versions since, covering most feature requests we got from you.

These new features include;
1. Show a “Load more products” button after page X. This will enable the visitor to reach your page footer in large categories.
2. Disable the history feature which creates #page urls, so the browser’s back button functionality does not break. Hence enabling you to load all the pages without a “hashtag change”.
3. Enable Google Anyaltics support, keeping track when the user scrolls to new pages.
4. Loading the next page before the user reaches the bottom of the page.

Magento AJAX Scroll with load more products button

Load more products button

In addition we did some cleaning up;
1. You can now enable or disable the inclusion of jQuery. So now you can prevent jQuery loading twice, if it’s already used in some other Magento extension. Keep in mind that jQuery is required, one way or another!
2. The CSS and JS files for the scroll to top and ajax scroll functionality will only be included if you enable those features.
3. Translation files have been added for multilingual store setups. And a Dutch translation is present by default. Send us your translations, we will include them!

I Like, I want, give!
The magical 10 steps to make this work in your Magento shop?
1. Download the zip, version 2.0(DAH!)
2. Extract it’s contents to the root of your Magento installation. You can use FTP to do that. It’s the directory containing index.php [App] [Skin] [Media] among others
3. Log in to your Magento backend
4. Go to System -> Cache Management, select all options, and in the action dropdown select “Refresh”. Then click Submit.
5. Log out/in to your backend
6. Go to System -> Configuration -> Catalog and drop down the “Front-end” selection
7. The extension adds a new option here; “Use jQuery Infinite Ajax Scroll” and this new version adds the option “Use jQuery UItoTop”.
8. Set both “Use jQuery Infinite Ajax Scroll” and “Use jQuery UItoTop” to “Yes”. Enable the jQuery include option if you do not know what the hell I’m talking about or disable it if it’s already included elsewhere. You can also mess around with the settings that correspond with the new features mentioned above.
9. Click save config.
10. All done!

You can download the Magento Ajaxscroll Extension here. You can check out the demo here.

Like this free extension?
Let us know, and like our Facebook page! We will give you free support if you do!

Magento browser update notice

Featured

A dilemma we as internet developers are facing each time we launch a new project is “what browser to support”. Generally Chrome users are always up to date (they don’t even have the option not to be) and so are Firefox and Safari users, more or less.

Health issues
Internet Explorer users are an overall “pain in the ass” for us. They tend to be old people, that just went with the default browser that came with their Windows device. Internet Explorer 9 and 10 are fine, don’t get me wrong. But the issue always seems to be IE6, which simply doesn’t eat all of the javascript we throw it’s way, IE7 messes up layouts big time and IE8 does not support rounded corners, gradients and other essential CSS standards. Not to mention the dangerous DX filters which I have even seen wrecking up sessions (if they get 404 responses) in reverse proxied projects.

So everything before IE8 tends to give the frontend developers here at RapidCommerce a headache. IE8 itself gives them a rash. That made us, here at RapidCommerce, decide to charge customers extra if they want IE6 or IE7 support in their projects (for the sake of the good health of our frontend developers). If the customer wants IE8 renderings to be pixel perfect with the drawings our designers came up with, they have to pay extra also.

Best practice
We’ve been doing this for a while now. And with old IE marketshare dropping more and more, most customers don’t want IE6 or IE7 support. But what if one of those visitors still uses an old IE version… The site might not work, or does not work like it is supposed to. You might loose a customer. Or make them angry… Throwing things at you… What if that visitor is an old grey dude in a big leather chair, in an office with a “CEO of my customers company” sign on the door…

The best thing to do in these situations is to alert a user the site will not work with the piece of old crap software they are using to browse it. Or at least something like that, in more customer friendly terms of course (people using IE generally have an under developed sense of humour). And that is exactly what the guys at Browser-Update.org must have been thinking. They build a script that notifies users if they are using an old browser and provide that user with update information on their nice website.

The Magento solution
So Magento itself supports IE7+. It is wise to notify IE6 users, at least. When developing your own package you might decide to support only IE8+, or better yet IE9+. Users with older browsers need to be educated they might run into a problem and why.

That is why we present to you; this free Magento extension! It allows you to specify which browsers you support. Visitors with older browser versions get notified and educated. You can control versions, languages (multilingual support out of the box) and design of the notification.

Free Magento extension browser update notice

Magento browser update notice

Instructions for installing this extension in 10 easy do-it-yourself steps.
1. Download the zip (DUH!)
2. Extract it’s contents to the root of your Magento installation. You can use FTP to do that. It’s the directory containing index.php [App] [Skin] [Media] among others
3. Log in to your Magento backend
4. Go to System -> Cache Management, select all options, and in the action dropdown select “Refresh”. Then click Submit.
5. Log out/in to your backend
6. Go to System -> Configuration -> Web and drop down the “Browser update notice” selection
7. You can set you options here. If you set auto update, browser-udate.org will decide which browsers need to update. I recommend you to set this to No. This will give you the options to specify which browsers version you support. You can set “Always show this notice” to yes if you want to customize the notice appearance and set it back once you’re done.
8. Set “Enable notice” to “Yes”
9. Click save config.
10. All done!

Gimme! Gimme!
You can download the Magento Browser update Extension here. You can check out the demo here (will always show, regardless of your browser version).

Like this free extension?
Let us know, and like our Facebook page!

Always show shipping costs in Magento

Featured

Sometimes you just need one shipping method, or perhaps 99% of your customers use a specific method. This is often the case for European shops serving just one country. By default, Magento allows customers to get a quote estimate for shipping costs in the cart page.

The customer has to set it’s country and select the appropriate method in order to get a correct quote, including the shipping costs. In the scenario I mentioned earylier, it could be best to just set the country and shipping method by default. This way the customer will always get a price including shipping costs. Never again will they be surprised by a higher then expected price at the end of the checkout process!

A solution
So how to achieve this? Well… One can write a small extension that catches Magento’s sales_quote_collect_totals_before and set a shipping method if none is set. This shipping method then should be configurable from Magento’s backend. Not into writing code? Check the attachment. Download the extension here. I tested it in Magento CE 1.4, 1.5, 1.6. Should work in 1.7 as well.

Magento always show shopping costs

Magento always show shopping costs

Instructions for installing this extension:
1. Download the zip (DUH!)
2. Extract it’s contents to the root of your Magento installation. You can use FTP to do that. It’s the directory containing index.php [App] [Skin] [Media] among others
3. Log in to your Magento backend
4. Go to System -> Cache Management, select all options, and in the action dropdown select “Refresh”. Then click Submit.
5. Log out/in to your backend
6. Go to System -> Configuration -> Shipping Settings and drop down the “Origin” selection
7. This extension adds two new options here; “Apply defaults to empty quote” and “Default shipping method”
8. Set “Apply defaults to empty quote” to “Yes” , set “Default shipping method” to your preferred shipping method. And make sure “Country” is set.
9. Click save config.
10. All done!

When a customer visits your site and starts adding stuff to his shopping cart, all prices will be shown including shipping costs! (If this does not happen the first time you visit your site yourself, clear all your cookies, as you might still have an active quote present, in which case the extension will leave it alone).

How does this work… I mean in code…?
Well… The extension uses a simple observer to check if the shipping address has a country set. If it does not (which is the case for an empty quote) it will set one including the default method. Pretty simple stuff!!

Update 7/9/12: Idev OneStepChecout bug
Stevan from Enigma Webdesign reported an issue with Idev OneStepChecout. As it turns out the Idev OSC extension “assumes” a billing address is present in the quote when a shipping address is found. This causes the OSC to load with no valid billing address, and as a result, it will show the default country with just the default payment method.

One can work around this by using this version of the extension when using Idev OneStepChecout. This update will set a billing address as well as the shipping address, to enable Idev OCS to work. Set the “Apply defaults to billing address” option in “System -> Configuration -> Shipping Settings” to Yes. Download the update here.

Like this free extension?
Let us know, and like our Facebook page!

PHP SOAP extension missing after Zend Server update

Just a heads-up; during the scheduled maintenance to our CenOS/ZS based webservers we noticed an update from the Zend Server repository for the PHP SOAP extension (php-5.3-soap-zend-server). After installing the extension (assuming it is a bug-fix release or something like that), errors started showing up in several systems using the SOAP based services (like the Magento webservice) on those servers.

Turns out /usr/local/zend/etc/conf.d/soap.ini just contains “soap.so”. It should contain “extension=soap.so” in order for Apache (part of Zend Server) to load it. So if after a yum update you’re missing SOAP functionality on your Zend Server (CE) based webservers; check out /usr/local/zend/etc/conf.d/soap.ini!

Remove unused Magento product images

Magento has the nasty habit of leaving unused product image files in it’s var/media directory. If you, like one of our clients, import your catalog at a regular interval using Magento’s Dataflow or similar this will fill up your precious data space. Especially when your catalogue consists of 12.000+ SKUs with one or more product images like was the situation here…

The solution
There is a solution in the form of the Image Clean extension created by Defcon. That extension however cannot be scheduled using cron, and it requires manual interaction. Panticz was probably thinking the same thing, and put together a shell script to clean up the unused Magento product images. However, his script needs a config file containing some variables, also the paths probably need manual adjusting if you want to use it yourself.

A man of little words
Panticz, apparently being a man of little words, didn’t leave an instruction to go with it. So we put together a version of his script that is easier to deploy. It will configure itself if you tell it where your Magento install is located. Just put it somewhere where you can run it, and make sure you change MAGENTO_PATH=”/path/to/your/magento/httpdocs” to the path of your Magento install. It’s suited for use in a cronjob, say once a week.

#!/bin/bash
MAGENTO_PATH="/var/www/path/to/vhost/httpdocs/path/to/magento"
LOG=${MAGENTO_PATH}/var/log/imagecleanup.log
DB_USER=$(sed -n 's|<username><\!\[CDATA\[\(.*\)\]\]></username>|\1|p' ${MAGENTO_PATH}/app/etc/local.xml | tr -d ' ')
DB_PASS=$(sed -n 's|<password><\!\[CDATA\[\(.*\)\]\]></password>|\1|p' ${MAGENTO_PATH}/app/etc/local.xml | tr -d ' ')
DB_NAME=$(sed -n 's|<dbname><\!\[CDATA\[\(.*\)\]\]></dbname>|\1|p' ${MAGENTO_PATH}/app/etc/local.xml | tr -d ' ')
DB_PREFIX=$(sed -n 's|<table_prefix><\!\[CDATA\[\(.*\)\]\]></table_prefix>|\1|p' ${MAGENTO_PATH}/app/etc/local.xml | tr -d ' ')

function search_db() {
	COUNT=$(mysql -u ${DB_USER} -p${DB_PASS} ${DB_NAME} --execute="SELECT count(*) FROM ${DB_PREFIX}catalog_product_entity_media_gallery WHERE value = \"$1\"")
	echo $(echo ${COUNT} | cut -d" " -f2)
}

echo "Starting image cleanup " $(date) | tee -a ${LOG}
IMG_PATH=${MAGENTO_PATH}/media/catalog/product/
for IMG in $(find ${IMG_PATH} -name '*.jpg' ! -path '*cache*' ! -name 'google*'); do
	REL_IMG=/${IMG:${#IMG_PATH}}
	if [ $(search_db ${REL_IMG/'${MAGENTO_PATH}/media/catalog/product'/}) != 1 ]; then
		IMG=${IMG##*/}
		for CACHE_IMG in $(find ${MAGENTO_PATH}/media/catalog/product/ -name "${IMG}"); do
			echo "Found unused image ${CACHE_IMG}"
			if [ "$1" ] && [ $1 == 'cleanup' ]; then
				echo "Removing unused image ${CACHE_IMG}" | tee -a ${LOG}
				rm "${CACHE_IMG}"
			fi
		done
	else 
		echo "Not touching " ${IMG}
	fi
done
echo "Finished image cleanup " $(date) | tee -a ${LOG}

How can I use this?
1. Download the script here. Extract it and put it somewhere in your Magento installation. For example in the shell directory.
2. Edit the script and change the MAGENTO_PATH to the absolute path (starting at /, but not ending with a /) of your Magento installation. If you do not know where that is, leave a comment, or bang your head against a wall, whichever suits you best/
3. Make the file executable. You can do this using your (S)FTP software or on the command line. For example using “chmod +rx imagecleanup.sh”. Again leave if a comment if your having trouble doing that.
4. Run it in test modus (without parameters). It won’t delete anyhing! But if you see does not want to touch some files, but remove others you know its working. If you are happy go to the next step.
4. Run it on the shell with the paramter cleanup. So ‘./imagecleanup.sh cleanup’. Or create a cronjob in your hosting panel calling this script once a week.

Disclaimer
If you lose images you still needed you’re on your own, so test things out (as described) somewhere and always make sure you have a backup. As with all our free code, we are not responsible for the havoc it may cause. It’s tested for Magento 1.4+ in several real life environments. We however are not obligated by any way to provide support if thing go wrong (we however, always do, if you ask us nice… or if you buy us candy), nor are we responsible for anything, in any way ;-) .

Like this free extension?
Let us know, and like our Facebook page! Want more? Leave a comment expressing your wishes in regard to this extension, and we will keep you in mind working on updates.

Magento store pickup

More and more retailers extend their business into the wonderful realm of eCommerce to offer their goods online. Buying online has been on the rise for a few years now. However there are still a lot of customers that want to explore online, and buy offline, so sometimes it’s all about clicks and bricks.

Magento, by default, does not provides us with the means to allow the customer to shop for a product online, but specifying he or she want to buy the product offline. This free Magento extension will allow the customer to “pick up the product” at your store or offline service location. It will also allow the customer to pay for the product offline.

The solution, “ship” to store, pay offline
This free extension provides you with a simple “shipping” method using a flat-rate (or all free) charging method similar to Magentos’ flat-rate method. On top of that, it will provide a simple payment method that is only available when the customer indicates he or she wants to pick up the order at your store. The payment method can also be used in combination with other shipping methods. After the checkout process orders and invoices created with these methods will specify that the customer wants to pick up the product and that he or she will pay offline.

Magento store pickup

Store pickup during checkout

Installing the extension is easy;
1. Download the zip (DUH!).
2. Extract it’s contents to the root of your Magento installation. You can use FTP to do that. It’s the directory containing index.php [App] [Skin] [Media] among others.
3. Log in to your Magento backend.
4. Go to “System -> Cache Management”, select all options, and in the action dropdown select “Refresh”. Then click the [Submit] button.
5. Log out/in to your backend.
6. Go to “System -> Configuration -> Shipping methods” and expand the “Payment on pickup” section. Change the method name, price and title to something that suits your need and set “Enabled” to “Yes”.
7. Click the [Save Config] button.
8. Go to “System -> Configuration -> Payment methods” and expand the “Pay on pickup” section. Change the title to something that suits your needs. Then drop down the “Pickup method” dropdown and select “[payonpickup] The title you chose in step 6.” (be aware that this drop down is scrollable and may contain a lot of options). You can also use this to make this payment method available for other shipping methods.
9. Click the [Save Config] button.
10. All done!

Gimme! Gimme!
You can download this free extension here. You can check out the demo here.

Like this free extension?
Let us know, and like our Facebook page! Want more? Leave a comment expressing your wishes in regard to this extension, and we will keep you in mind working on updates.

Magento product list AJAX scroll v1.1

Last month I posted an article describing our free Magento extension: Magento product list AJAX scroll. It enables your customers to view more products at less effort, hence having a positive influence on conversion. After some positive reactions to this extension we decided to enhance it with a new functionality; a scroll to top button.

More and more customers find us to optimize their Magento hosting infrastructure. This enables them to serve thousands of products in categories at lightning speed (< 100ms serverside response time). And this was what inspired us to apply AJAX scrolling in the first place. It however, does have a downside, in these very large product listings... After five minutes of downwards scrolling, the user might find himself lost from the essential navigational features Magento offers...

So after some time this visitor might decide to actually use one of Magento's navigational features, like the header menu, the layered navigation or the quick search widget. 99% of the Magento design packages out there will place these features at the top of the page. By now your visitor will start panicking, kicking and screaming out of pure frustration. The way to the top seems to long... The visitors' index finger, completely worn out by scrolling down, will now fail. Leaving the visitor with no other option then to sue you...

Hit the button and fly back up
To solve this the problem, a scroll to top button will now magically appear in this all new version. It will do so in the right bottom corner of the screen, after the visitor does some scrolling. Clicking the scroll to top button will return the pages’ focus back on to the start of the page. It will add a nice easing animation effect to the mix, giving your shop a classy look and feel. Check out the demo here. When you’re done, you can download the drop-in extension for Magento here, should work for Magento 1.4, 1.5, 1.6 and 1.7, taking into account the conditions described in the previous article.

Magento Scroll to top

Magento Scroll to top

Reinventing the (scroll)wheel is pointless, so to make this button appear we included the UItoTop jQuery Plugin. This nice little plug-in was created by Matias Varone . Again, like the Ajax Infinite Scroll plugin, this one requires jQuery (which is included in the extension). So the same story described in the previous post applies.

The same 10 step basic installation and upgrade instruction apply. To summarize once more;
1. Download the zip, version 1.1 (DUH!)
2. Extract it’s contents to the root of your Magento installation. You can use FTP to do that. It’s the directory containing index.php [App] [Skin] [Media] among others
3. Log in to your Magento backend
4. Go to System -> Cache Management, select all options, and in the action dropdown select “Refresh”. Then click Submit.
5. Log out/in to your backend
6. Go to System -> Configuration -> Catalog and drop down the “Front-end” selection
7. The extension adds a new option here; “Use jQuery Infinite Ajax Scroll” and this new version adds the option “Use jQuery UItoTop”.
8. Set both “Use jQuery Infinite Ajax Scroll” and “Use jQuery UItoTop” to “Yes”
9. Click save config.
10. All done!

Gimme! Gimme!
Checkout the new version here.

Like this free extension?
Let us know, and like our Facebook page!

IIS7 PHP WSDL issue

If you ever run into a scenario where you need to run a PHP SOAP webservice in an IIS environement, you might encounter the following problem. When generating a client proxy in .NET/WCF this exception is thrown;

The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF

The problem, as it turns out, is that ASP.NET appends the HTTP X-Powered-By header. This header seems to confuse the proxy generation code. To fix the issue you need to remove this IIS header. Head to your IIS Manager > You website > The folder your PHP webservice is located > Click HTTP Response header. Then remove the X-Powered-By header. Now enjoy generating proxies!

Some evil internet voices claim that you should set useUnsafeHeaderParsing to false in your clients’ application configuration to make .NET ignore the inconsistency in your webservice WSDL output. This however is a workaround, not a solution. So if you run the webservice apply the header fix as described above.

Remove IIS headers

Magento LAMP vs WIMP: Running Magento with IIS and WinCache

Let’s get started by getting IIS up and running with WinCache. Getting your IIS up and running with PHP itself is easy. Add the IIS role to your Windows Server setup in the Feature Manager and browse to the PHP IIS website. Once there, hit the big blue “Install PHP” button and let the Microsoft Web Platform Installer do it’s magic.

When you’re done, point your browser to this page. Another “install” button is presented. But for some reason this one does not always work (it didn’t in the Windows 2008 R2 Web edition I was using). So here’s how to get WinCache running Manually;
1. Download WinCache for PHP 5.3 from sourceforce.net.
2. Extract php_wincache.dll to “C:\Program Files (x86)\PHP\v5.3\ext”
3. Edit “C:\Program Files (x86)\PHP\v5.3\php.ini” and at the bottom of the file add the line “extension=php_wincache.dll”.
4. Extract wincache.php to your webroot. By default it’s somewhere like “C:\inetpub\wwwroot”.
5. Edit wincache.php and change the username and password in lines 42 and 43.
6. To be sure, restart IIS using yout IIS Manager.

Now browse to yourdefaultwebsite/wincache.php. If you hit a screen like the one below, your glasses are OK. If not, scream out lout and start asking for help…

WinCache statistics

WinCache statistics

Set up Magento to use WinCache
Back to Magento. The first part of WinCache, the opcode cache, kicks in a few levels below Magento. Magento does not know it’s there and does no need to. The opcode cache will keep a copy of the interpreted PHP opcode (created by the PHP binary when intepreting PHP files) in memory. It will use this copy each time a cached script is executed saving CPU cycles and IO operations (at the cost of a little memory). An opcode cache is vital for decent Magento performance. If your webhost does not implement one, sue them for stupidity (just kidding, don’t reference me in court).

The second part of WinCache we will want to use is the user cache. A user cache can be seen as a kind of dictionary. You can put data in it by attaching a label to it. When you want to extract that data at a later time you can access it by using that label. Magento comes with it’s own caching system. It can cache lots of things (System -> Cache management). It does this by utilizing the cache classes in the Zend Framework on which it is build.

To store all this cache it needs a backend. By default Magento will use the filesystem as its backend. It’s wise to keep it this way as the filesystem is the most likely to have space and is allways available. But it’s also wise to add a second backend that is a hell of lot faster then your filesystem. This is where we will want to use the WinCache data cache. Using these two backends is made possible by the TwoLevel cache. More on that in this great post by Fabrizio Branca.

Enable WinCache as the fast cache backend
The Zend Framework handles the backend itself, Magento just uses the interfaces/classes provided by the Zend Framework. At present the code required to use WinCache as a cache backend in not present in the Zend framework that ships with Magento. It is available in Zend framework 1.11. I’ve extracted the proper files here (download). Just download the zip and extract it’s contents to the root of your Magento installation to add WinCache data cache support to Magento 1.6+.

When that’s done we’ll need to configure Magento to use WinCache as it’s fast cache backend. Edit your app/etc/local.xml file and add these lines in the section;


     Zend_Cache_Backend_WinCache
     file

After saving your local.xml file be sure to flush Magento’s cache; System -> Cache management -> Select all -> Refresh -> Submit. When you check your wincache.php file again entries should show up under both “User cache” and “Opcode cache”.

URL Rewrites
Something else to think about when using Magento with IIS (or any other webserver then Apache) is to handle URL rewrites. IIS 7.5, which ships with Windows Server 2008R2, comes equipped with it’s own Rewrite module. By default the Magento installation contains .htaccess files which, among other things, instruct Apache’s URL Rewrite module how to handle the URL mappings. IIS does not use these .htaccess files. The IIS equivalent is the web.config file. Use a web.config file (which you have to save in your webroot) like the one below in order to use URL Rewrites (which you really should when doing this in production);


   




      
      
        
        
        
      
      
    
    



At this point we’re all done. Magento is up and running with IIS using WinCache.

This series of posts will compare typical, non-tweaked, LAMP and WIMP stacks, in terms of performance, running Magento CE 1.7.
Table of contents (work in progress)
1. Introduction
2. Running Magento with IIS and WinCache
3. Benchmarks (coming soon)
4. Conclusion (coming soon)

Magento LAMP vs WIMP: Introduction

When choosing a webserver stack, used to run PHP applications like Magento, a LAMP (Linux Apache MySQL PHP) stack is favored. Although nginx with php-fpm is on the rise, Apache on Linux is still the most popular choice. When choosing a reactor pattern based webserver like nginx or lightspeed, which some claim perform better under load, Linux is still the most popular choise. In fact here at RapidCommerce, all Magento hosting is done using Linux and a mix of Varnish/Apache/Nginx.

There is a “new” kid in town though, IIS. Obviously IIS does not run under Linux, its THE Microsoft Windows webserver. And it has never been popular to run PHP/MySQL based applications. With good reasons, I might add. IIS6 was a terrible performer when it came to PHP. However for IIS7 things have changed, so they say. Apparently the team behind IIS has been working closely with the PHP guru’s at Zend.

Add to these improvements in IIS7, the availability of a new opcode and user cache; WinCache. I started to wonder… How does this “new” WIMP (Windows IIS MySQL PHP) stack compare to the widely favored LAMP stack? So I decided to put things to the test. This series of posts will compare ZendServer CE (from those same gurus involved in improving IIS/PHP) with IIS7.

Both stacks can be seen as “out-of-the-box” PHP application servers. Both come with their own opcode cacher, Zend Optimizer+ with Zend Datacache SHM versus WinCache. Zend chose to run PHP as mod_php in Apache and in IIS PHP is run with FastCGI. I will acknowledge that adding Nginx/php-fpm and Apache/fast-cgi would be more fair, as they use a more comparable way to integrate PHP with the webserver. But I trust the guys at Zend know what they are doing and had their reasons to use the mod_php. The point being, out-of-the-box vs out-of-the-box. To make thing more comparable we’ll add Zend Server CE under Windows to the mix.

LAMP vs WIMP

This series of posts will compare typical, non-tweaked, LAMP and WIMP stacks, in terms of performance, running Magento CE 1.7.
Table of contents (work in progress)
1. Introduction
2. Running Magento with IIS and WinCache
3. Benchmarks (coming soon)
4. Conclusion (coming soon)

Magento product list AJAX scroll

Category and search result pages revolve around product lists. Magento allows you to control the amount of products that your webshop shows. Magento even lets the customer decide how many products he or she wants to view at any given time.

From a server performance point of view, the more products you show by default, the more load will be put on your server. That is probably the main decision to not always show all possible products in a certain listing. Crawlers like Google bot will add to that load, even when there are no visitors.

As a result your customers, when just browsing products, will have to “click to the next page”. A customer however might not be inclined to keep clicking “Next”. Altough Magento has many nice navigation features, this may have a negative impact on your convergence! Users might just miss that one perfect product they were looking for because he or she never reached the second page.

A few weeks ago I stumbled upon Infinite Ajax Scroll created by Jeroen Fiege. This nice little jQuery plugin controls the “user click for pagination” by detecting when a user hits the bottom of a page. Inspired by a customer that had their “products per page” set to 300, I decided to apply this jQuery plugin to Magento.

Use AJAX to do Magento scrolling!
When applying it to Magento it allows your visitors to keep scrolling trough product listing without clicking, or doing anything else then scrolling. You can download the drop-in extension for Magento here, should work for Magento 1.4, 1.5, 1.6 and 1.7. Or you can check out the demo here It should work for all themes that are not to heavily modified. When no javascript is supported, the traditional Magento toolbar pagination is shown. When javascript is supported, the user just has to scroll to the bottom of the page to see more results.

Magento Ajax Scroll

Magento Ajax Scroll

Instructions for installing this extension in 10 easy do-it-yourself steps.
1. Download the zip (DUH!)
2. Extract it’s contents to the root of your Magento installation. You can use FTP to do that. It’s the directory containing index.php [App] [Skin] [Media] among others
3. Log in to your Magento backend
4. Go to System -> Cache Management, select all options, and in the action dropdown select “Refresh”. Then click Submit.
5. Log out/in to your backend
6. Go to System -> Configuration -> Catalog and drop down the “Front-end” selection
7. This extension adds a new option here; “Use jQuery Infinite Ajax Scroll”
8. Set “Use jQuery Infinite Ajax Scroll” to “Yes”
9. Click save config.
10. All done!

A few thing to note
First of all this extension uses and includes the jQuery library. It needs jQuery to function. Magento ships with Prototype which by default conflicts with jQuery. To solve this a “no conflict” file is included which makes sure jQuery and Prototype don’t start a fight in your browser. jQuery, being the more popular javascript library of the two, is often used in other Magento extensions. In fact you can find Magento extensions just to add jQuery to your Magento setup. If jQuery is allready present somewhere else copy the file app/design/frontend/base/default/layout/rapidcommerce-ias.xml to app/design/frontend/YOUPACKAGE/YOURTHEME/layout/rapidcommerce-ias.xml and remove all the “<action method="addJs"><script>ias/jquery-1.7.2.min.js</script></action>” and “<action method="addJs"><script>ias/jquery-noconflict.js</script></action>” lines. Alternatively use your local.xml layout update file to accomplish the same. It’s not a problem if you don’t, but this will avoid jQuery getting (down)loaded twice.

If you use a custom theme which does not adhere the default Magento “div-layout” or a custom toolbar, then you might want to change the jQuery selector paths used (which default to the way Magento’s base theme is build). You will find these in the app/design/frontend/base/default/templates/ajaxscroll/ias.phtml, so copy that file to app/design/frontend/YOUPACKAGE/YOURTHEME/templates/ajaxscroll/ias.phtml. If you don’t, you’ll find this extension does not work. And if you know what I’m talking about, you’ll know what to change reading the Infinite Ajax Scroll instructions.

Ajax scrolling is added to the catalog pages (anchor and non-anchor), search result pages (both advanced and simple) and the tag list page. If you have other extensions adding controllers that contain a product list you can add these using the layout update XML described above.

Gimme! Gimme!
Checkout the new version here.

Like this free extension?
Let us know, and like our Facebook page!