Fix for Hot Deals showing duplicate categories on bottom

The Hot Deals box only checked the the previous category listed to prevent duplicates. If you add products from multiple categories and they aren’t in a row, those categories can be listed multiple times.

This is the fix:



Replace the

with this one in the hot_deals.tpl:


		<div class="updates-wrapper deals-footer cm-deals-categories"><br />
			<a name="0" class="cm-deals-category">{$lang.all_categories}</a>  <br />
			{set var=$catList.item}<br />
			{foreach name="products" from=$items item="product"}<br />
				{if $product.product}<br />
					{foreach from=$product.category_ids key=cat_id item=cat_main}<br />
						{if $cat_main == "M"}<br />
							<script type="text/javascript"><br />
								//<![CDATA[<br />
								items{$block.block_id}[{$smarty.foreach.products.iteration-1}] = {$ldelim}name: ' ', link: '{$index_script}?dispatch=products.view&product_id={$product.product_id}', image: '{$product.main_pair.icon.image_path}', cat_id: {$cat_id}, width: 175, height: 175{$rdelim};<br />
								//]]><br />
							</script><br />
							{ if !in_array($cat_id, $catList) } <br />
								{if $category != $product.category}<br />
									<a name="{$cat_id}" class="cm-deals-category">{$product.category}</a>  <br />
									{assign var="category" value=$product.category}<br />
									{set var=$catList.$cat_id value=$cat_id}<br />
								{/if}<br />
							{ /if }<br />
						{/if}<br />
					{/foreach}<br />
				{/if}<br />
			{/foreach}<br />
		</div><br />

```<br />
<br />
This fix also requires a smarty addon.  The only way to keep proper track is to build an array within the template.  Smarty has no built in functionality to do that.  The plugin needs to be added to the lib/templatar/plugins directory.<br />
It is here:<br />
[url]http://smarty.incutio.com/?page=Set[/url]

Can you please report this as a bug in the Bug Tracker so that it cabn be fixed in a future version?



Bob

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=1775[/url]