X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   How to add a price range related search link in side menu? (https://forum.x-cart.com/showthread.php?t=15108)

shirley2005 07-09-2005 10:34 PM

How to add a price range related search link in side menu?
 
I want to add a Price Range menu in side bar, for example:

$1-$500
$500-$1000
$1000-$2000

when customer click these links, it will display relative products according to the price range.

TelaFirma 07-10-2005 04:12 AM

Create a file named shop_by_price.tpl in the /skin1/customer/ directory. In this file put this code:

Code:

{capture name=menu}

<form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearchform1">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="posted_data[price_min]" value="1">
<input type="hidden" name="posted_data[price_max]" value="100">
$1-$100
</form>

<form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearchform2">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="posted_data[price_min]" value="100">
<input type="hidden" name="posted_data[price_max]" value="250">
$100-$250
</form>

<form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearchform3">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="posted_data[price_min]" value="250">
<input type="hidden" name="posted_data[price_max]" value="500">
$250-$500
</form>

<form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearchform4">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="posted_data[price_min]" value="500">
<input type="hidden" name="posted_data[price_max]" value="1000">
$500-$1000
</form>

<form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearchform5">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="posted_data[price_min]" value="1000">
<input type="hidden" name="posted_data[price_max]" value="10000">
$1000-$10000
</form>

{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Shop by Price" menu_content=$smarty.capture.menu }


Then just where you want this menu, call it with:

Code:

{ include file="customer/shop_by_price.tpl" }

shirley2005 07-10-2005 01:02 PM

Thanks! It works. 8)

Online Michael 07-14-2005 10:10 AM

Just wanted to say thanks. This was just what I was looking for. :D

jkirkpatrick 08-30-2005 06:21 AM

Would it be possible to make this a subcategory?

I'd like to add a category called "Shop by Price" and when they click it they see subcategories as I've defined for the price ranges.

Anyone know how to do this?

Thanks,
Jennifer

Bling 08-30-2005 11:48 AM

Any way to get rid of the line that seperates the title form the price variables?

Gonna try and put in in my "main" screen" with Fashion Mosaic.

Dongan 08-30-2005 08:08 PM

Nice work TeleFirma. cheers :lol:

Raptor 03-07-2006 04:57 AM

I don't know about you guys but once the user is in the searched price range and they try to sort by price or anything it just lists all products...?

pwd88 03-15-2006 09:37 AM

I had the same problem, i.e. once the search returens the products list, if you click on next page icon, the serach result just returns all products, anyone has a solution yet?

bestdata 03-28-2006 07:25 PM

shop by price
 
thanks for the mode. JUst installed it works great for the fist result page but the 2nd page and fter it shows all the products.

Any advise

tks.....

X-cart 4.0.18 ( linux)


All times are GMT -8. The time now is 11:24 AM.

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