Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How do you edit the search result page layout?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-23-2010, 05:26 AM
 
retrtrtrytrutru retrtrtrytrutru is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 101
 

Default How do you edit the search result page layout?

Hi everyone,

I want to edit the layout of the search result page. Right now, it shows the same layout for the found products as I am using on the category pages but this is not wanted. Any idea how to edit this behaviour or how to build a custom layout for just the search result page?

I know skin1/customer/main/search_result.tpl controls the page in question but there is no way to edit its layout. All the relevant code I see is:

Code:
<table cellpadding="0" cellspacing="0" width="100%"> {if $sort_fields} <tr> <td>{include file="main/search_sort_by.tpl" sort_fields=$sort_fields selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction url="`$navigation_script`&"} <br /><br /><br /> </td> </tr> {/if} <tr> <td> {include file="customer/main/navigation.tpl"} {include file="customer/main/products.tpl" products=$products} <-- this needs custom code, I think.. <br />{include file="customer/main/navigation.tpl"} </td> </tr> </table>
The bold part is what controls the current layout, I think. Anyone knows how to edit this part and make it show the relevant results in a way I want to? Thanks for any input.
__________________
www.qualitylamps.eu
X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9

www.vervangjelamp.nl
X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2

Sorry for the weird user name, I registered it by mistake
Reply With Quote
  #2  
Old 09-23-2010, 05:28 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: How do you edit the search result page layout?

The easiest way is to create a custom products template. So do this, replace this:

{include file="customer/main/products.tpl" products=$products}

with this:

{include file="customer/main/products-search.tpl" products=$products}

Then create a copy of products.tpl, rename it products-search.tpl and edit however you want.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote

The following user thanks balinor for this useful post:
retrtrtrytrutru (09-23-2010)
  #3  
Old 09-23-2010, 05:30 AM
 
retrtrtrytrutru retrtrtrytrutru is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 101
 

Default Re: How do you edit the search result page layout?

That's a good suggestion, why didn't I think of that myself. Will work on it, thanks balinor
__________________
www.qualitylamps.eu
X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9

www.vervangjelamp.nl
X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2

Sorry for the weird user name, I registered it by mistake
Reply With Quote
  #4  
Old 09-23-2010, 11:46 PM
 
retrtrtrytrutru retrtrtrytrutru is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 101
 

Default Re: How do you edit the search result page layout?

Does anyone know how to link to the product's main category from the search result page? It seems impossible to do but nothing is impossible, right? I tried:

Code:
<a href="home.php?cat={$current_category.parentid}">test1</a> <a href="{$location[1][1]}">{$location[1][0]}</a> <a href="home.php?cat={$subcat.categoryid}">test3</a> <a href="home.php?cat={$category.categoryid}">test4</a> <a href="home.php?cat={$c.categoryid}">test5</a> <a href="home.php?cat={$products[product].categoryid}">testA</a> <a href="home.php?cat={$product.categoryid}">testB</a> <a href="home.php?cat={$products.categoryid}">testC</a>
Every product has a main category ID link, I can see it when I check an item in the backend of our store. I want customers to be able to access the main category from the search result page since we have no actual product pages (we use category pages where people can buy the products). Thanks in advance!
__________________
www.qualitylamps.eu
X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9

www.vervangjelamp.nl
X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2

Sorry for the weird user name, I registered it by mistake
Reply With Quote
  #5  
Old 09-28-2010, 12:39 AM
 
retrtrtrytrutru retrtrtrytrutru is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 101
 

Default Re: How do you edit the search result page layout?

Nobody knows?
__________________
www.qualitylamps.eu
X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9

www.vervangjelamp.nl
X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2

Sorry for the weird user name, I registered it by mistake
Reply With Quote
  #6  
Old 09-28-2010, 11:13 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

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

Default Re: How do you edit the search result page layout?

You can use webmaster mode to see what smarty variables are available to you on that page load. If there is no variable for the data you seek, then php has to be updated to provide it. This post gives more detail about using webmaster mode to find available variables.
__________________
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
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:02 AM.

   

 
X-Cart forums © 2001-2020