X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How do you edit the search result page layout? (https://forum.x-cart.com/showthread.php?t=55670)

retrtrtrytrutru 09-23-2010 05:26 AM

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.

balinor 09-23-2010 05:28 AM

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.

retrtrtrytrutru 09-23-2010 05:30 AM

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 :D/

retrtrtrytrutru 09-23-2010 11:46 PM

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!

retrtrtrytrutru 09-28-2010 12:39 AM

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

gb2world 09-28-2010 11:13 AM

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.


All times are GMT -8. The time now is 05:42 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.