View Single Post
  #10  
Old 07-02-2009, 09:53 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Extra Field Search From product.tpl

Are you sure you used the code as I wrote it? I'll have to make a test case and try it when I have time, because looking at it, I can't see how you would have a comma after the last array element. If you want to debug it, just try printing out the variable I am using in the if statement: {$smarty.section.star_name.index} - it should only be equal to 0 the first time through the loop, then increment. And, I intend for it to print every time through the loop except the first time.

If the list does not begin with a comma, then it should have worked. The only reason I can think of where a comma would end the list is if there was a blank element at the end of the array. When you entered the extra field, did you end the list with a comma? If you want to test for stuff like that - I would do it in the php and pass the array to smarty after it is cleaned up.

You can always see the category id in the database. An easier way might be to bring up the category in the administration. There are no clean urls in the admin, so you can look at the URL there and see the cat id.

One other issue I just thought of - your star names have a blank space in between the first and last name - so the link I gave you won't work as the search URL. You need to replace the blank with a "+" - this should do it:

Code:
{if $smarty.section.star_name.index ne 0}, {/if}<a href="search.php?mode=search&by_title=on&by_shortdescr=on&by_fulldescr=on&by_sku=on&category_main=on &category_extra=on&search_in_subcategories=on&substring={$explode_stars[star_name]}">{$explode_stars[star_name]|replace:' ':'+'}</a>
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote