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

Product Category/Price Filter/Search Block

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-28-2007, 09:57 AM
 
baronmunchowsen baronmunchowsen is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 31
 

Default 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,
__________________
----------------------------------------
Looking for helpful pointers with his x-cart installation
X-Cart version 4.1.8
Reply With Quote
  #2  
Old 09-28-2007, 01:19 PM
 
baronmunchowsen baronmunchowsen is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 31
 

Default 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.
__________________
----------------------------------------
Looking for helpful pointers with his x-cart installation
X-Cart version 4.1.8
Reply With Quote
  #3  
Old 10-08-2007, 02:18 AM
 
adriant adriant is offline
 

Senior Member
  
Join Date: May 2006
Posts: 190
 

Default 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
__________________
Xcart gold Plus V4.7.12
REBoot(REdux)

https://www.serpro.co.uk
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 04:57 AM.

   

 
X-Cart forums © 2001-2020