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)
-   -   shop by price mod? (https://forum.x-cart.com/showthread.php?t=50386)

ARW VISIONS 10-26-2009 12:28 PM

shop by price mod?
 
is there a shop by price mod? left hand menu like this?

Shop by Price:
$0-$50
$51-$150
$151-$500
$500 - Up

cflsystems 10-26-2009 05:33 PM

Re: shop by price mod?
 
You probably know this but how about hard coded like this

search.php?mode=search&including=all&price_min=50& price_max=100

ARW VISIONS 10-27-2009 04:06 AM

Re: shop by price mod?
 
Steve,

I wasn't sure of the exact syntax. thanks

Ash

flyclothing 11-18-2009 11:14 PM

Re: shop by price mod?
 
Ashley,

I just did this one for 4.2.3

{capture name=menu}
<ul>
<li><strong><a href="search.php?mode=search&including=all&price_m in=1& price_max=25&sort=price&sort_direction=0">
$1-$25</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=26& price_max=50&sort=price&sort_direction=0">$26-$50</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=51& price_max=75&sort=price&sort_direction=0">$51-$75</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=76& price_max=100&sort=price&sort_direction=0">$76-100</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=100& price_max=500&sort=price&sort_direction=0">$100+</a></strong></li>
</ul>
{assign var="additional_class" value="menu-categories-list"}
{/capture}
{include file="customer/menu_dialog.tpl" title="Shop By Price" content=$smarty.capture.menu}

Regs 11-19-2009 01:39 PM

Re: shop by price mod?
 
Quote:

Originally Posted by flyclothing
Ashley,

I just did this one for 4.2.3

{capture name=menu}
<ul>
<li><strong><a href="search.php?mode=search&including=all&price_m in=1& price_max=25&sort=price&sort_direction=0">
$1-$25</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=26& price_max=50&sort=price&sort_direction=0">$26-$50</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=51& price_max=75&sort=price&sort_direction=0">$51-$75</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=76& price_max=100&sort=price&sort_direction=0">$76-100</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=100& price_max=500&sort=price&sort_direction=0">$100+</a></strong></li>
</ul>
{assign var="additional_class" value="menu-categories-list"}
{/capture}
{include file="customer/menu_dialog.tpl" title="Shop By Price" content=$smarty.capture.menu}

Excellent!

Had to modify it to make work for me though. There are a couple of spaces in your various links that need to be removed. Additionally, I found that the "&sort=price&sort_direction=0" made the links only search one category? Weird - removal of that bit of code in the links makes it all well for me (also working with 4.2.3)

Cheers,

Regs.

flyclothing 11-19-2009 02:57 PM

Re: shop by price mod?
 
Yeah, I set it up to fit with my store so I figured it might need a bit of modification to fit elsewhere, i.e. bullets and formatting. I added the code at the end because the results didn't seem to show the lowest price item first.

GEMaffair.com 12-08-2009 01:58 PM

Re: shop by price mod?
 
Is there anyway to make this work with the existing category? I mean if you are in a category 3 levels down on a site with 2000 products, you don't want it to show you shop by price for any product on the site, but only the cat they are in, right?

Michael

dwpers 12-18-2009 06:50 AM

Re: shop by price mod?
 
Where exactly would this go in the skin files?

Quote:

{capture name=menu}
<ul>
<li><strong><a href="search.php?mode=search&including=all&price_m in=1& price_max=25&sort=price&sort_direction=0">
$1-$25</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=26& price_max=50&sort=price&sort_direction=0">$26-$50</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=51& price_max=75&sort=price&sort_direction=0">$51-$75</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=76& price_max=100&sort=price&sort_direction=0">$76-100</a></strong></li>
<li><strong>
<a href="search.php?mode=search&including=all&price_m in=100& price_max=500&sort=price&sort_direction=0">$100+</a></strong></li>
</ul>
{assign var="additional_class" value="menu-categories-list"}
{/capture}
{include file="customer/menu_dialog.tpl" title="Shop By Price" content=$smarty.capture.menu}

cflsystems 12-18-2009 06:52 AM

Re: shop by price mod?
 
skin1/customer/home.tpl in left or right column

dwpers 12-18-2009 07:31 AM

Re: shop by price mod?
 
Thanks again :)

Mr. G 12-07-2012 10:06 PM

Re: shop by price mod?
 
Two issues.
1. The problem, at least for 4.4.5, with flyclothing's code is that it will only show results for top categories, and ignore subcats. Here is the correct code:
PHP Code:

{capture name=menu}
&
nbsp;&nbsp; &raquo; &nbsp;<a href="/search.php?mode=search&including=all&by_title=on&by_descr=on&by_sku=on&search_in_subcategories=on&price_min=0&price_max=25&by_fulldescr=on&by_shortdescr=on">$- $25</a><br />
&
nbsp;&nbsp; &raquo; &nbsp;<a href="/search.php?mode=search&including=all&by_title=on&by_descr=on&by_sku=on&search_in_subcategories=on&price_min=25&price_max=50&by_fulldescr=on&by_shortdescr=on">$25 - $50</a><br />
&
nbsp;&nbsp; &raquo; &nbsp;<a href="/search.php?mode=search&including=all&by_title=on&by_descr=on&by_sku=on&search_in_subcategories=on&price_min=50&price_max=100&by_fulldescr=on&by_shortdescr=on">$50 - $100</a><br />
&
nbsp;&nbsp; &raquo; &nbsp;<a href="/search.php?mode=search&including=all&by_title=on&by_descr=on&by_sku=on&search_in_subcategories=on&price_min=100&price_max=200&by_fulldescr=on&by_shortdescr=on">$100 - $200</a><br />
&
nbsp;&nbsp; &raquo; &nbsp;<a href="/search.php?mode=search&including=all&by_title=on&by_descr=on&by_sku=on&search_in_subcategories=on&price_min=200&by_fulldescr=on&by_shortdescr=on">$200+</a>
{
assign var="additional_class" value="menu-categories-list"}
{/
capture}
{include 
file="customer/menu_dialog.tpl" title="Shop By Price" content=$smarty.capture.menu

I removed the <li> so that you can add whichever bullet characters you like. Yes, the increments overlap. For my store, I'll never have items that sell for those round numbers.

2. I use X-Cart Mod's Smart Template. If you want to put this in the right or left panel, paste in /skin/smart_template/custom/home_2col_left.tpl or home_3col.tpl or home_2col_right.tpl depending on your chosen layout.

Mr. G 12-10-2012 10:24 PM

Re: shop by price mod?
 
Update: The search does not work under certain (most) circumstances. On our home page, we display a selection of featured products according to the settings here: /admin/categories.php#featured (Admin -> Catalog -> Categories -> Featured Products). If I click on the home page, then one of the Search by Price links as shown in the code above, then only the featured products within that search's price range are displayed. However, if I run a search using /search.php, then later click on one of the price search links in the code above, then the search displays all products properly. So, I am still without a working Search by Price solution. :(


All times are GMT -8. The time now is 06:25 AM.

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