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)
-   -   Product Category/Price Filter/Search Block (https://forum.x-cart.com/showthread.php?t=34237)

baronmunchowsen 09-28-2007 09:57 AM

Product Category/Price Filter/Search Block
 
Hi,

I am looking to create a block for the left-hand-side column of my website.

I want the user to be able to specify the category and price range that they'relooking for and upon submit, the result set is displayed.

I have been looking at adapting the advanced search functionality for this, but this requires that you specify a search string. I want to provide a drop-down menu of the categories, the price range fields and a search button only.

Can anybody suggest how this could be achieved, or let me know if/where this has been done before?

Many thanks in advance for your help and suggestions,

baronmunchowsen 09-28-2007 01:19 PM

Re: Product Category/Price Filter/Search Block
 
Hi - My Solution is as follows. Perhaps this will help others:

I created a template file in my skin (theme) directory and included it where I wanted it. The file contents are:

Quote:

{capture name=menu}
<form name="llsearchform" action="search.php" method="post">
<input type="hidden" name="mode" value="search" />
<input type="hidden" name="posted_data[substring]" value="" />
<input type="hidden" id="including_any" name="posted_data[including]" value="any" />
<input type="hidden" id="posted_data_by_title" name="posted_data[by_title]" value="1" />
<input type="hidden" id="posted_data_by_shortdescr" name="posted_data[by_shortdescr]" value="1" />
<input type="hidden" id="posted_data_by_fulldescr" name="posted_data[by_fulldescr]" value="1" />

<div class="ll-form-item">
<p class="ll-form-label">Choose from: </p>
<select name="posted_data[categoryid]" style="width: 100%">
<option value="0" >All Categories</option>
<option value="0" >----------------</option>
{foreach from=$categories item=c}
<option value="{$c.categoryid}" >{$c.category}</option>
{/foreach}
</select>
</div>

<input type="hidden" id="category_main" name="posted_data[category_main]" value="1" />
<input type="hidden" id="category_extra" name="posted_data[category_extra]" value="1" />
<input type="hidden" id="search_in_subcategories" name="posted_data[search_in_subcategories]" value="1" />

<div class="ll-form-item">
<p class="ll-form-label">Price Range: </p>
from <input type="text" size="6" maxlength="15" name="posted_data[price_min]" value="0" />
to <input type="text" size="6" maxlength="15" name="posted_data[price_max]" value="100" />
</div>

<div class="ll-form-item right">
{include file="buttons/button.tpl" style="button" button_title='Search' href="javascript: document.llsearchform.submit();"}
</div>
</form>
{/capture}
{ include file="menu.tpl" menu_title='Gift Finder' menu_content=$smarty.capture.menu }


I adapted the advanced search and made some of the fields hidden to simplify it basically.

adriant 10-08-2007 02:18 AM

Re: Product Category/Price Filter/Search Block
 
A vote of thanks to the 'baron'. Have been looking for this a while now but wasn't sure how to code it. Saved me a lot of head scratching. As I wasn't sure on where to put the file I did the following.
Saved it as gift-finder.tpl directly in the skin1 folder.
Modded the home.tpl in the skin1/customer folder to put it under the categories with.

{include file="customer/categories.tpl" }
<br />
{/if}
{include file="gift-finder.tpl" }
<br />

And it worked right out of the box.

Many thanks


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

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