<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>kerrinhardy.com &#187; zen cart centerboxes</title>
	<atom:link href="http://www.kerrinhardy.com/tag/zen-cart-centerboxes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerrinhardy.com</link>
	<description>The Ultimate Reference for Customising Zen Cart</description>
	<lastBuildDate>Sun, 25 Sep 2011 04:49:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Set a sort order for the Featured Products Centerbox on Zen Cart Home Page</title>
		<link>http://www.kerrinhardy.com/2010/03/28/set-a-sort-order-for-the-featured-products-centerbox-on-zen-cart-home-page/</link>
		<comments>http://www.kerrinhardy.com/2010/03/28/set-a-sort-order-for-the-featured-products-centerbox-on-zen-cart-home-page/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 06:10:25 +0000</pubDate>
		<dc:creator>kerrin hardy</dc:creator>
				<category><![CDATA[Zen Cart Tips]]></category>
		<category><![CDATA[featured products]]></category>
		<category><![CDATA[zen cart centerboxes]]></category>

		<guid isPermaLink="false">http://www.kerrinhardy.com/?p=1772</guid>
		<description><![CDATA[There may be times when you need to remove the random function that is the default behaviour of the Featured Centerbox in Zen Cart and set a different sort order. For example, I am currently developing a Zen Cart store for a client that has a total of four items for sale.  And, as these [...]<h4>More Zen Cart:</h4>
<ol>
		<li><a href="http://www.kerrinhardy.com/2011/04/17/change-the-number-of-products-displayed-in-the-featured-products-centerbox-in-zen-cart/" rel="bookmark">Change the number of products displayed in the Featured Products centerbox in Zen Cart</a><!-- (19.7)--></li>
		<li><a href="http://www.kerrinhardy.com/2010/08/10/display-featured-products-on-page-not-found-page-in-zen-cart/" rel="bookmark">Display Featured Products on &lsquo;Page Not Found&rsquo; page in Zen Cart</a><!-- (13.3)--></li>
		<li><a href="http://www.kerrinhardy.com/faq/zen-cart-general-faq/wherehow-to-update-the-menu-that-has-the-options-home-pagenew-productsspecialsall-productsreviewscontact-usfaq/" rel="bookmark">Where/how to update the menu that has the options: &#8220;Home Page/New Products/Specials/All Products/Reviews/Contact Us/FAQ&#8221;?</a><!-- (12)--></li>
		<li><a href="http://www.kerrinhardy.com/2010/06/26/how-do-i-exclude-free-products-from-the-bestsellers-sidebox-in-zen-cart/" rel="bookmark">How do I exclude Free Products from the Bestsellers Sidebox in Zen Cart?</a><!-- (11.2)--></li>
		<li><a href="http://www.kerrinhardy.com/2010/04/29/reset-the-order-id-number-in-zen-cart/" rel="bookmark">Reset the Order ID number in Zen Cart</a><!-- (9.4)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p>There may be times when you need to remove the random function that is the default behaviour of the Featured Centerbox in Zen Cart and set a different sort order.</p>
<p>For example, I am currently developing a Zen Cart store for a client that has a total of four items for sale.  And, as these items form a series, it makes sense to have all four items featured and appear in the correct order.</p>
<p>Follow the steps below for the Featured Products Centerbox to follow the sort order as set in Zen Cart Admin for each Product.</p>
<p><img style="display: inline; border: 0px;" title="Zen Cart Admin - Product Sort Order" src="http://www.kerrinhardy.com/wp-content/uploads/2010/03/image31.png" border="0" alt="Zen Cart Admin - Product Sort Order" width="488" height="258" /></p>
<ol>
<li>Open the featured_products.php file located in the <em><strong>/includes/modules/</strong></em> directory.</li>
<li>Find this section of code:
<pre class="brush: php; title: ; notranslate"> $featured_products = $db-&amp;gt;ExecuteRandomMulti($featured_products_query, MAX_DISPLAY_SEARCH_RESULTS_FEATURED);</pre>
</li>
<li>and change to:
<pre class="brush: php; title: ; notranslate">$featured_products = $db-&amp;gt;Execute($featured_products_query, MAX_DISPLAY_SEARCH_RESULTS_FEATURED); </pre>
</li>
<li>Next, find this section of code:
<pre class="brush: php; title: ; notranslate">$featured_products-&amp;gt;MoveNextRandom();&amp;#160; </pre>
</li>
<li>and change to:
<pre class="brush: php; title: ; notranslate">$featured_products-&amp;gt;MoveNext();&amp;#160; </pre>
</li>
<li>Now that we have removed the Random function, we will need to set the required sort order.  In this instance, we are going to use the sort order that is set in Zen Cart Admin when adding each product.There are two ‘select’ statements towards the top of the featured_products.php file.  You will need to modify both of these statements.At around line 22, find this section of code:
<pre class="brush: php; title: ; notranslate">$featured_products_query = &quot;select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
                           from (&quot; . TABLE_PRODUCTS . &quot; p
                           left join &quot; . TABLE_FEATURED . &quot; f on p.products_id = f.products_id
                           left join &quot; . TABLE_PRODUCTS_DESCRIPTION . &quot; pd on p.products_id = pd.products_id )
                           where p.products_id = f.products_id
                           and p.products_id = pd.products_id
                           and p.products_status = 1 and f.status = 1
                           and pd.language_id = '&quot; . (int)$_SESSION['languages_id'] . &quot;'&quot;;</pre>
</li>
<li>and change to:
<pre class="brush: php; title: ; notranslate">$featured_products_query = &quot;select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
                           from (&quot; . TABLE_PRODUCTS . &quot; p
                           left join &quot; . TABLE_FEATURED . &quot; f on p.products_id = f.products_id
                           left join &quot; . TABLE_PRODUCTS_DESCRIPTION . &quot; pd on p.products_id = pd.products_id )
                           where p.products_id = f.products_id
                           and p.products_id = pd.products_id
                           and p.products_status = 1 and f.status = 1
                           and pd.language_id = '&quot; . (int)$_SESSION['languages_id'] . &quot;'
                           order by products_sort_order&quot;;</pre>
</li>
<li>Then locate the second ‘select’ statement (it’s around line 41):
<pre class="brush: php; title: ; notranslate">$featured_products_query = &quot;select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
                                from (&quot; . TABLE_PRODUCTS . &quot; p
                                left join &quot; . TABLE_FEATURED . &quot; f on p.products_id = f.products_id
                                left join &quot; . TABLE_PRODUCTS_DESCRIPTION . &quot; pd on p.products_id = pd.products_id)
                                where p.products_id = f.products_id
                                and p.products_id = pd.products_id
                                and p.products_status = 1 and f.status = 1
                                and pd.language_id = '&quot; . (int)$_SESSION['languages_id'] . &quot;'
                                and p.products_id in (&quot; . $list_of_products . &quot;)&quot;;</pre>
</li>
<li>and change to:
<pre class="brush: php; title: ; notranslate">$featured_products_query = &quot;select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
                                from (&quot; . TABLE_PRODUCTS . &quot; p
                                left join &quot; . TABLE_FEATURED . &quot; f on p.products_id = f.products_id
                                left join &quot; . TABLE_PRODUCTS_DESCRIPTION . &quot; pd on p.products_id = pd.products_id)
                                where p.products_id = f.products_id
                                and p.products_id = pd.products_id
                                and p.products_status = 1 and f.status = 1
                                and pd.language_id = '&quot; . (int)$_SESSION['languages_id'] . &quot;'
                                and p.products_id in (&quot; . $list_of_products . &quot;)
                                order by products_sort_order&quot;;</pre>
</li>
<li>Save the modified featured_products.php file to your override folder.  This will be <em><strong>/includes/modules/CUSTOM/</strong></em> where <em><strong>CUSTOM</strong></em> represents the name of your current template folder.</li>
</ol>
<h4>More Zen Cart:</h4>
<ol>
		<li><a href="http://www.kerrinhardy.com/2011/04/17/change-the-number-of-products-displayed-in-the-featured-products-centerbox-in-zen-cart/" rel="bookmark">Change the number of products displayed in the Featured Products centerbox in Zen Cart</a><!-- (19.7)--></li>
		<li><a href="http://www.kerrinhardy.com/2010/08/10/display-featured-products-on-page-not-found-page-in-zen-cart/" rel="bookmark">Display Featured Products on &lsquo;Page Not Found&rsquo; page in Zen Cart</a><!-- (13.3)--></li>
		<li><a href="http://www.kerrinhardy.com/faq/zen-cart-general-faq/wherehow-to-update-the-menu-that-has-the-options-home-pagenew-productsspecialsall-productsreviewscontact-usfaq/" rel="bookmark">Where/how to update the menu that has the options: &#8220;Home Page/New Products/Specials/All Products/Reviews/Contact Us/FAQ&#8221;?</a><!-- (12)--></li>
		<li><a href="http://www.kerrinhardy.com/2010/06/26/how-do-i-exclude-free-products-from-the-bestsellers-sidebox-in-zen-cart/" rel="bookmark">How do I exclude Free Products from the Bestsellers Sidebox in Zen Cart?</a><!-- (11.2)--></li>
		<li><a href="http://www.kerrinhardy.com/2010/04/29/reset-the-order-id-number-in-zen-cart/" rel="bookmark">Reset the Order ID number in Zen Cart</a><!-- (9.4)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrinhardy.com/2010/03/28/set-a-sort-order-for-the-featured-products-centerbox-on-zen-cart-home-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

