Sorted Products/Sections/Search: Grey out out-of-stock items

Miscellaneous Actinic / SellerDeck patches and anything not covered above.
Post Reply
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Sorted Products/Sections/Search: Grey out out-of-stock items

Post by norman »

This is for Sorter V3 onwards.

To grey out out-of-stock items on the Section pages, do the following:

Go to Design / Library / Layouts / Product List / Bare Product List.
Look for:

Code: Select all

	<div id="sortline_<actinic:variable name="ListIndex"/>"
Immediately below it add the line:

Code: Select all

		<actinic:block if="%3cactinic%3avariable%20name%3d%22StockLevel%22%20%2f%3e%20%3c%3d%200">class="sortgrayedout"</actinic:block>
Repeat for layouts Product List With Horizontal Dividers and Standard Product List.

Edit file (in your Site folder) sortedproductssupport.js.
Look for the line:

Code: Select all

	bSortInitialised = true;
Immediately below it add the line:

Code: Select all

	$('.sortgrayedout').fadeTo(0, 0.5);	
That's it. Out of stock items should now appear greyed out to 50% visibility.

You can tweak the (0, 0.5) to change the appearance. The 0 is the number of milliseconds to fade down in. Zero means instantaneous. A longer number like 500 will give a live fade effect. The 0.5 is the final opacity (between 0 and 1).

You can also try using this to hide items. It will probably only work best when you have a single column of products and no horizontal divider. Try changing the line (in sortedproductssupport.js) from:

Code: Select all

	$('.sortgrayedout').fadeTo(0, 0.5);	
To:

Code: Select all

	$('.sortgrayedout').hide();	
Norman
Post Reply