Products - displaying all products from selected categories

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
lollol
Forum Members
Forum Members
Posts: 35
Joined: Wed Oct 15, 2008 11:38 pm

Products - displaying all products from selected categories

Post by lollol »

I have a single Product-A in three different categories: Bold 9000, Bold 9700, Curve 8900.

This

Code: Select all

{Products category="Bold 9000,Bold 9700,Curve 8900,Curve 8520,Storm 9520"}
... displays Product-A three times...


Question:
Can I make it skip douplicate products in the list?
Thanks!
lollol
Forum Members
Forum Members
Posts: 35
Joined: Wed Oct 15, 2008 11:38 pm

Re: Products - displaying all products from selected categories

Post by lollol »

No one out there who can help with an idea?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Products - displaying all products from selected categories

Post by jmcgin51 »

there must be a way within Smarty to check for duplicate product IDs in a result set, and only show the product ID once...  don't know right off how it would be done.
lollol
Forum Members
Forum Members
Posts: 35
Joined: Wed Oct 15, 2008 11:38 pm

Re: Products - displaying all products from selected categories

Post by lollol »

I have been thinking about the same thing... not  a smarty guru tho :)
Here is the template code for the summary template, in case some wizz comes by ;)
Thanks!

Code: Select all

<div class="ProductListWrap">
	{if isset($catformstart)}
	{$catformstart}
	{$catdropdown}{$catbutton}
	{$catformend}
	{/if}

	{if isset($pagecount) && $pagecount gt 1}
	{$firstlink} {$prevlink}  {$pagetext} {$curpage} {$oftext} {$pagecount}  {$nextlink} {$lastlink}
	{/if}

	{assign var='counter' value=0}
	
	

		{foreach from=$items item=entry}
		  <div class="ProductRow">

			{foreach from=$entry->fields item=prod}
				{if $prod->id == 2}
					<div class="productImgholder"><img alt="{$entry->product_name}" src="{$entry->file_location}/{$prod->thumbnail}" /></div>
				{/if}
			{/foreach}

			<div class="productDescWrap">
				<div class="productTitle"><a href="{$entry->detail_url}&productName={$entry->product_name}">{$entry->product_name}</a></div>
				<div class="productSummary">{$entry->details|substr:0:200}</div>
				<div class="productButton"><a href="{$entry->detail_url}&productName={$entry->product_name}"><img alt="More info" src="uploads/images/btn-moreinfo.jpg"/></a></div>
			</div>
		  <div class="devider"> </div>
		</div>
		  <!-- {$counter++} -->
		  {if $counter >= 2}
			{assign var='counter' value=0}
			<div class="rowDevider"> </div>
		  {/if}
		{/foreach}
	
	
</div>
Post Reply

Return to “Modules/Add-Ons”