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)
-   -   Showing products by price range (https://forum.x-cart.com/showthread.php?t=17570)

chrisinoz 10-27-2005 05:22 PM

Showing products by price range
 
My client has seen a site (not xcart) where you can click on $0-$200 etc and it shows all products in that range.

He would like that.

I know I can do an advanced search for that but that gives me no distinct url I can paste into a new menu.

An easy mod?

Thanks for any help here.

Cheers
Chris

4.016

TelaFirma 10-27-2005 08:49 PM

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" }

chrisinoz 10-28-2005 12:35 AM

Thank You very much TelaFirma

Works a treat.

Cheers

Chris

ecommerce 07-31-2006 12:38 PM

tela,

i se this working on ur peral shop but somehow ur results are formated differntly. theres no


[view all] 1 2 NEXT б╩

or

5results found
Displaying: 1 - 10 results

Search results
Search again
Sort by: SKU Product Price Default

ecommerce 07-31-2006 12:40 PM

tela,

what does this do:
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Shop by Price" menu_content=$smarty.capture.menu }

and how do u do it so that is language compatible and not hard coded language?

Shop by Price is hard coded?

How bout when we want it in a different language?

jstafford 06-12-2007 04:34 PM

Re: Showing products by price range
 
This is a great tool. I have followed the instructions and it does indeed put the menu where I wanted it. Just one problem - when you mouse over the price range items, there is no hyperlink, it is just text. Could it be that this doesn't work with the latest branch 4.0.7? Our store is at www.swisswatchstyles.com/shop .

Regards,
Jay

Quote:

Originally Posted by TelaFirma
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" }


balinor 06-12-2007 06:57 PM

Re: Showing products by price range
 
Jay, this thread is almost 2 years old...it probably doesn't work with the 4.1 branch of X-Cart.

Also, if you could add your version to your X-Cart signature per the forum guidelines that would be great. Thanks! :)

digiemp 11-10-2007 12:45 PM

Re: Showing products by price range
 
Is there a similar mod/patch that does work with the 4.1 branch of X-Cart? This is something I am very interested in implamenting on my site.

Thanks

digiemp 11-10-2007 03:13 PM

Re: Showing products by price range
 
Okay, I just tried this with version 4.1.8 and it works, sort of.
It added a nice box under my main category box titled 'Shop by Price' as expected.
The price values are there and they are clickable and everything so at first glace it appears to work. When I click any of the price values I get taken to a page full of items in that price range, so again, it appears to work...
Until I click on any of the 'sort by' options.
If I sort by price, no matter which price range I'm supposed to be browsing, it displays ALL of my products and sorts them by price.
If I sort by product, it does the same thing only sorting by product name, but it includes ALL of the products on my site not just the ones specific to the price range I requested.

Anyone know a way to make the 'sort by' feature stay within the price range that was just clicked?

Thanks,

Lingerieblowout 11-13-2007 03:14 PM

Re: Showing products by price range
 
Look at your PMs

16hands 12-01-2007 06:03 AM

Re: Showing products by price range
 
Hmmmm

When I tried this, I got the "shop by price" area, but still no hyperlinks. Any ideas?

Thank you

shan 12-01-2007 06:10 AM

Re: Showing products by price range
 
Heres a simple way to do this for 4.1.x

make a new template called shop_by_price.tpl and upload it to skin1 directory

open skin1/customer/home.tpl and add this where you want the menu to show up. maybe after the include for categories.tpl etc

use this to include the template to your page

Code:

{ include file="shop_by_price.tpl" }

Heres the code for shop_by_price.tpl

Code:

{* $Id: shop_by_price.tpl *}

{capture name=menu}
<a href="search.php?mode=search&sort=price&sort_direction=0&including=all&price_max=50">ё0 - ё50</a><BR>
<a href="search.php?mode=search&sort=price&sort_direction=0&including=all&price_min=50&price_max=100">ё50 - ё100</a><BR>
<a href="search.php?mode=search&sort=price&sort_direction=0&including=all&price_min=100&price_max=200">ё100 - ё200</a><BR>
<a href="search.php?mode=search&sort=price&sort_direction=0&including=all&price_min=200&price_max=300">ё200 - ё300</a><BR>
<a href="search.php?mode=search&sort=price&sort_direction=0&including=all&price_min=300">ё300 +</a>
{/capture}
{ include file="menu.tpl" dingbats="dingbats_help.gif" menu_title="Shop By Price" menu_content=$smarty.capture.menu }


adjust to suit

16hands 12-01-2007 01:13 PM

Re: Showing products by price range
 
Ah! thank you.

It does work with hyperlinks now, and looks great on the first page of the results. The only problem seems to be that (for example) there might be 4 pages show up for the results for 25-50, but when I go to the next page, it lengthens to 16 pages and starts with the $10 items. Any ideas as to why? I think I'll leave it up this way for now. The first page of the search looks great - after that it seems to default to all products below the range.

Thank you again.

Learner 08-02-2012 12:20 AM

Re: Showing products by price range
 
Quote:

Originally Posted by shan
Heres a simple way to do this for 4.1.x

make a new template called shop_by_price.tpl and upload it to skin1 directory

open skin1/customer/home.tpl and add this where you want the menu to show up. maybe after the include for categories.tpl etc

use this to include the template to your page

Code:

{ include file="shop_by_price.tpl" }

Heres the code for shop_by_price.tpl

Code:

{* $Id: shop_by_price.tpl *}

{capture name=menu}
<a href="search.php?mode=search&sort=price&sort_direction=0&including=all&price_max=50">ё0 - ё50</a><BR>
<a href="search.php?mode=search&sort=price&sort_direction=0&including=all&price_min=50&price_max=100">ё50 - ё100</a><BR>
<a href="search.php?mode=search&sort=price&sort_direction=0&including=all&price_min=100&price_max=200">ё100 - ё200</a><BR>
<a href="search.php?mode=search&sort=price&sort_direction=0&including=all&price_min=200&price_max=300">ё200 - ё300</a><BR>
<a href="search.php?mode=search&sort=price&sort_direction=0&including=all&price_min=300">ё300 +</a>
{/capture}
{ include file="menu.tpl" dingbats="dingbats_help.gif" menu_title="Shop By Price" menu_content=$smarty.capture.menu }


adjust to suit


But if I goes into the particular category then it is not working.How to work in category level?

sandyg 08-06-2012 08:41 PM

Re: Showing products by price range
 
code is not working in 4.5.0 version

elipsoid_cz 02-26-2013 12:57 PM

Re: Showing products by price range
 
Hi, did anybody find a solution how to get this to work in 4.5.2? Thanks.

ADDISON 02-26-2013 01:05 PM

Re: Showing products by price range
 
Why you don't use Advanced search, entering min and max price, and look at the URL? Then copy this URL into shan's customization, and change it according.

elipsoid_cz 02-27-2013 01:45 AM

Re: Showing products by price range
 
Well, because the URL does not change, it looks like this all the time: http://wearewhisky.com/search.php?mode=search&page=1

Maybe it has something to do with htaccess neat urls?

ADDISON 02-27-2013 02:12 AM

Re: Showing products by price range
 
You are right. I don't think it is a .htaccess issue. They changed the way these variables are sent inside the script (GET to POST). See here in action: http://demo.x-cart.com/demo/search.php

QT should offer some clues on this why they changed this behavior.

As a tip, using a filtering solution you don't need anymore this customization, and it is much more professional than clicking on links.


All times are GMT -8. The time now is 07:23 PM.

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