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

Shop by Price for xcart 4.3.1

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-14-2010, 12:01 PM
  ShishaPipeUK's Avatar 
ShishaPipeUK ShishaPipeUK is offline
 

Senior Member
  
Join Date: Jul 2005
Location: London, England.
Posts: 118
 

Wink Shop by Price for xcart 4.3.1

Below is the code for x-cart 4.3.1 to search for products using there price value.

Place this in xcart/skin1/customer/shop_by_price.tpl

Code:
{* $Id: shop_by_price.tpl,v 1.20 2009/04/23 11:35:03 max Exp $ vim: set ts=2 sw=2 sts=2 et: *} {capture name=price} <table width="101%" border="0"> <tr> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_5"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="0"> <input type="hidden" name="posted_data[price_max]" value="5"> <a class="VertMenuItems" href="javascript:document.productsearch_price_5.submit()" >ё0-ё5</a> </form> </td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_10"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[price_min]" value="5" /> <input type="hidden" name="posted_data[price_max]" value="10" /> <a class="VertMenuItems" href="javascript:document.productsearch_price_10.submit()" >ё5-ё10</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_15"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="10"> <input type="hidden" name="posted_data[price_max]" value="15"> <a class="VertMenuItems" href="javascript:document.productsearch_price_15.submit()" >ё10-ё15</a> </form> </td> </tr> <tr> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_20"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="15"> <input type="hidden" name="posted_data[price_max]" value="20"> <a class="VertMenuItems" href="javascript:document.productsearch_price_20.submit()" >ё15-ё20</a> </form> </td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_25"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[price_min]" value="20" /> <input type="hidden" name="posted_data[price_max]" value="25" /> <a class="VertMenuItems" href="javascript:document.productsearch_price_25.submit()" >ё20-ё25</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_30"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="25"> <input type="hidden" name="posted_data[price_max]" value="30"> <a class="VertMenuItems" href="javascript:document.productsearch_price_30.submit()" >ё25-ё30</a> </form> </td> </tr> <tr> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_35"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="30"> <input type="hidden" name="posted_data[price_max]" value="35"> <a class="VertMenuItems" href="javascript:document.productsearch_price_35.submit()" >ё30-ё35</a> </form> </td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_40"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[price_min]" value="35" /> <input type="hidden" name="posted_data[price_max]" value="40" /> <a class="VertMenuItems" href="javascript:document.productsearch_price_40.submit()" >ё35-ё40</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_45"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="40"> <input type="hidden" name="posted_data[price_max]" value="45"> <a class="VertMenuItems" href="javascript:document.productsearch_price_45.submit()" >ё40-ё45</a> </form> </td> </tr> <tr> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_50"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="45"> <input type="hidden" name="posted_data[price_max]" value="50"> <a class="VertMenuItems" href="javascript:document.productsearch_price_50.submit()" >ё45-ё50</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_55"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[price_min]" value="50" /> <input type="hidden" name="posted_data[price_max]" value="55" /> <a class="VertMenuItems" href="javascript:document.productsearch_price_55.submit()" >ё50-ё55</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_60"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="55"> <input type="hidden" name="posted_data[price_max]" value="60"> <a class="VertMenuItems" href="javascript:document.productsearch_price_60.submit()" >ё55-ё60</a> </form></td> </tr> <tr> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_65"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="60"> <input type="hidden" name="posted_data[price_max]" value="65"> <a class="VertMenuItems" href="javascript:document.productsearch_price_65.submit()" >ё60-ё65</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_70"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[price_min]" value="65" /> <input type="hidden" name="posted_data[price_max]" value="70" /> <a class="VertMenuItems" href="javascript:document.productsearch_price_70.submit()" >ё65-ё70</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_75"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="70"> <input type="hidden" name="posted_data[price_max]" value="75"> <a class="VertMenuItems" href="javascript:document.productsearch_price_75.submit()" >ё70-ё75</a> </form></td> </tr> <tr> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_80"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="75"> <input type="hidden" name="posted_data[price_max]" value="80"> <a class="VertMenuItems" href="javascript:document.productsearch_price_80.submit()" >ё75-ё80</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_85"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[price_min]" value="80" /> <input type="hidden" name="posted_data[price_max]" value="85" /> <a class="VertMenuItems" href="javascript:document.productsearch_price_85.submit()" >ё80-ё85</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_90"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="85"> <input type="hidden" name="posted_data[price_max]" value="90"> <a class="VertMenuItems" href="javascript:document.productsearch_price_90.submit()" >ё85-ё90</a> </form></td> </tr> <tr> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_95"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="90"> <input type="hidden" name="posted_data[price_max]" value="95"> <a class="VertMenuItems" href="javascript:document.productsearch_price_95.submit()" >ё90-ё95</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_100"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[price_min]" value="95" /> <input type="hidden" name="posted_data[price_max]" value="100" /> <a class="VertMenuItems" href="javascript:document.productsearch_price_100.submit()" >ё95-ё100</a> </form></td> <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price"> <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="100000"> <a class="VertMenuItems" href="javascript:document.productsearch_price.submit()" >ё100 +</a> </form></td> </tr> </table> {/capture} {include file="customer/menu_dialog.tpl" title=$lng.lbl_Shop_by_Price content=$smarty.capture.price additional_class="menu-bestsellers"}

Once uploaded you can change your xcart/skin1/customer/home.tpl by adding the code below.


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

You can see this at www.nightscene.co.uk/shop/home.php
__________________
Apache/2.0.55 (Red Hat) & MYSQL Server: 5.0.24
PERL: 5.008005 / PHP: 4.4.4 - 4.3.1 X-CART

Shop carts at
http://www.nightscene.co.uk/shop/home.php
http://www.theshisha.net/shopcart/home.php
http://www.system-maintenance.com/maint/home.php
http://www.tabac4u.com
Reply With Quote

The following 2 users thank ShishaPipeUK for this useful post:
am2003 (03-14-2010), mekon (08-10-2012)
  #2  
Old 03-14-2010, 12:10 PM
 
Pyro Pyro is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 506
 

Default Re: Shop by Price for xcart 4.3.1

Thanks for sharing!

This may be able to put this to good use.
__________________
Best Wishes,
James

4.5.2 Gold (work in progress)
Reply With Quote
  #3  
Old 03-14-2010, 02:50 PM
 
Pyro Pyro is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 506
 

Default Re: Shop by Price for xcart 4.3.1

Just a question, is there a way to make this so that it works per category?

For example, if I visit a category, I would like the "shop by price" to only take that category into consideration. Can this mod be made to do that? By the look of it, if you click a price when your in a category of your demo price, it shows the everything within that price range of all categories.


Thanks in advance
__________________
Best Wishes,
James

4.5.2 Gold (work in progress)
Reply With Quote
  #4  
Old 03-14-2010, 03:09 PM
  ShishaPipeUK's Avatar 
ShishaPipeUK ShishaPipeUK is offline
 

Senior Member
  
Join Date: Jul 2005
Location: London, England.
Posts: 118
 

Default Re: Shop by Price for xcart 4.3.1

The default search engine does this, you can see this at http://www.nightscene.co.uk/shop/search.php

This mod is for all products and so that customers have a easy click with regard to price.
__________________
Apache/2.0.55 (Red Hat) & MYSQL Server: 5.0.24
PERL: 5.008005 / PHP: 4.4.4 - 4.3.1 X-CART

Shop carts at
http://www.nightscene.co.uk/shop/home.php
http://www.theshisha.net/shopcart/home.php
http://www.system-maintenance.com/maint/home.php
http://www.tabac4u.com
Reply With Quote
  #5  
Old 07-24-2010, 06:16 PM
 
mudebate mudebate is offline
 

Advanced Member
  
Join Date: Jan 2009
Posts: 62
 

Default Re: Shop by Price for xcart 4.3.1

Hi,

I know this is a persistent question related to shop by price modifications, but has anyone gotten this to work for the category the shopper is currenlty vieweing?

For example, if I am looking at category "Widgets" I would like my shop my price to drill down only within the category I am currenlty in, not all products.

I'm thinking there must be a way to may the search execute for only the category the user is currenlty in, but cannot figur eout ho wto make it work. Anyone have any luck with this?

I'm looking to do this for a site build on 4.3 that I have not taken live yet

Thanks!
__________________
mudebate


X-cart 4.11 - One page checkout, category meta tags, manufacturer meta tags, a few others


X-cart 4.2, tabbed products menu



Reply With Quote
  #6  
Old 09-24-2010, 10:00 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Shop by Price for xcart 4.3.1

I'm trying to use this in 4.3.2 A side from needing to change the Monetary symbol.

I can't figure out how to get "Shop by Price" To appear in the title. I added the Label lbl_Shop_by_Price, but it's not picking it up.

Any help on this?

http://www.mikeinfinger.com/demos/xcart/home.php
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #7  
Old 08-10-2012, 02:39 AM
 
mekon mekon is offline
 

Senior Member
  
Join Date: Jan 2011
Posts: 180
 

Default Re: Shop by Price for xcart 4.3.1

Can confirm this works in 4.5.2

Also, I didn't want tables so here's a css version:

Code:
{* $Id: shop_by_price.tpl,v 1.20 2009/04/23 11:35:03 max Exp $ vim: set ts=2 sw=2 sts=2 et: *} {capture name=price} <div class="shopbyprice_link"> <form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_5"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="0"> <input type="hidden" name="posted_data[price_max]" value="40"> <a class="VertMenuItems" href="javascript:document.productsearch_price_5.submit()" >ё0-ё40</a> </form> </div> <div class="shopbyprice_link"> <form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_10"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[price_min]" value="40" /> <input type="hidden" name="posted_data[price_max]" value="80" /> <a class="VertMenuItems" href="javascript:document.productsearch_price_10.submit()" >ё40-ё80</a> </form> </div> <div class="shopbyprice_link"> <form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_15"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="80"> <input type="hidden" name="posted_data[price_max]" value="120"> <a class="VertMenuItems" href="javascript:document.productsearch_price_15.submit()" >ё80-ё120</a> </form> </div> <div class="shopbyprice_link"> <form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_20"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="120"> <input type="hidden" name="posted_data[price_max]" value="160"> <a class="VertMenuItems" href="javascript:document.productsearch_price_20.submit()" >ё120-ё160</a> </form> </div> <div class="shopbyprice_link"> <form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_25"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[price_min]" value="160" /> <input type="hidden" name="posted_data[price_max]" value="220" /> <a class="VertMenuItems" href="javascript:document.productsearch_price_25.submit()" >ё160-ё220</a> </form> </div> <div class="shopbyprice_link"> <form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_price_30"> <input type="hidden" name="mode" value="search"> <input type="hidden" name="posted_data[price_min]" value="220"> <input type="hidden" name="posted_data[price_max]" value="500"> <a class="VertMenuItems" href="javascript:document.productsearch_price_30.submit()" >ё220-ё500</a> </form> </div> {/capture} {include file="customer/menu_dialog.tpl" title=$lng.lbl_Shop_by_Price content=$smarty.capture.price additional_class="menu-shopbyprice"}

And the CSS I used:

Code:
.shopbyprice_link { width: 60px; height: 20px; float: left; margin-right: 30px; padding-top: 10px; } .shopbyprice_link a:link, .shopbyprice_link a:visited { text-decoration: none; font-weight: bold; color: #000; }
__________________
------------------------------------------------

Darren
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:32 AM.

   

 
X-Cart forums © 2001-2020