Jump to content
Sign in to follow this  
meltus

[Contribution] shop by price

Recommended Posts

Hi,

 

sorry I forgot to ask this ask in my earlier post.

 

I also would like the box to show selections in euro's if that is the currencie the customers select. Is this possible and what do I need to change (please explain this to me stap-by-stap, I'm not a expert in php)

Share this post


Link to post
Share on other sites

Hi.

Any way how to make this excellent contrib compatible with the "Special Price"contrib?

 

Most of the products in my shop have a "Special Price".

Does anyone know how to modify the "Shop by Price" contrib so that it sorts according to the Special prices instead of the Retail prices?

 

Thanks!

C?cile

Share this post


Link to post
Share on other sites
Hi.

Any way how to make this excellent contrib compatible with the "Special Price"contrib?

 

Most of the products in my shop have a "Special Price".

Does anyone know how to modify the "Shop by Price" contrib so that it sorts according to the Special prices instead of the Retail prices?

 

Thanks!

C?cile

 

C?cile,

 

I needed that too, and also support of additional currencies/languages, so I modded it a bit ...

http://www.noahsark4kids.com/test/shop_by_price.php?range=0

 

If you'd like the code give me a holler!

 

:-)

Monika


:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Share this post


Link to post
Share on other sites

Hi all

 

Just installed 2.2.1 Shop By Price and it looks great. However, when I click on any of the price range options on the shopping pages, I get the full product list, beginning with the cheapest items onwards.

 

Any suggestions?

 

Thanks

M?che?l

Share this post


Link to post
Share on other sites

hello guys

 

i m goint to release if your are ok a version , where the the price could me easily modified in admin + better multilanguage implementation

 

but i got 5 question :

 

1.the price we enter in seems to be the price without taxe , i wanna for exemple show prodcut under 200 ? , and it show one porduct at 235? that is in fact 175? taxe excluded, but my customer wanna shop by price including Taxes

 

2. don't u think we could add one line to the navigation ?

 

3. i don't understand why , but my weight colum is empty , i cheded in admin listing , and it is set to be shown .. any idea ?

 

4. does the listing product found by shop by price follow the rule of osc lsiting configureed in admin , like other all products contrib use ?

 

5. why the $price_ranges = Array( and $price_ranges_sql are done in the language file instead of in the module ?

Edited by azer

MS2

Share this post


Link to post
Share on other sites

Hi,

 

I installed this contribution. It shows up on my webpage, but the filters do not work properly. I did not change the ranges. Can somebody please help or give me advice?

 

Thanks in advance!

Share this post


Link to post
Share on other sites

My limit variables are not defined. If you click on all of the price ranges, they all show products 0-20. Please help!

Share this post


Link to post
Share on other sites

After some more troubleshooting, no matter what ranges I click on, I get "Products under $20" to be displayed. In the shop_by_price.php file in the languages folder, I noticed that the header variable is defined as 'Shop By Price -' followed by the price ranges. My problem is that these ranges are not defined. When I click on a range, the only thing displayed is "Shop By Price -" and the right side is empty. This would probably explain why I get the same products displayed, regardless of what I click on. I noticed this same file does not have quotes in the ranges. "20" seems to have quotes around it, but 50 and 100 do not have quotes around it (the first of three arrays near the bottom). Ugghh...this contribution seemed so easy, yet I still get problems. If anybody has any ideas, please let me know. Thanks for your help!

Share this post


Link to post
Share on other sites
Well, I thought I had this working as a form within my header, but I discovered the action is blank so nothing happens. If I use the modified drop down code in an info box, it works. Here's my code, if anyone can help:

$price_range_list = '';

$price_range_list[] = array('id' => '0', 'text' => 'Shop by price' );
for ($range=0; $range<sizeof($price_ranges); $range++) {

$price_range_list[] = array('id' => $range, 'text' => $price_ranges[$range] );

? ? ? ?}

? ? ?

<form class="form" method="get" action="<?php tep_href_link(FILENAME_SHOP_BY_PRICE); ?>"><?php echo ?tep_draw_pull_down_menu('range', $price_range_list, $range, 'onchange="this.form.submit();"'); ?></form></td>

 

Hi, I also wonder about this. I want to add a shop by price pulldown meny and I don't want it in its own box, but in my search box.

 

Have tried the tips in this thread, but cannot make it work.

I run sts, but I'm not sure if this has any significance to this matter.

 

Can somebody help me?

 

Thanks

Kjolebutikken


Best regards

Kjolebutikken

Share this post


Link to post
Share on other sites

does anyone have a solution for this with ultimate seo urls and as to what I need to do to get it to display.

 

Thanks,

Eric


Eric

 

Keep up on osCommerce changes and updates at

Github | Understand osCommerce a little further at OsCommerce Documentation | Copy and paste your error message in Google add "in osCommerce" at the end to get relevant answers to most issues.

Share this post


Link to post
Share on other sites
Hi, I also wonder about this. I want to add a shop by price pulldown meny and I don't want it in its own box, but in my search box.

 

Have tried the tips in this thread, but cannot make it work.

I run sts, but I'm not sure if this has any significance to this matter.

 

Can somebody help me?

 

Thanks

Kjolebutikken

 

Hi there, still have not been able to get this to work. Basically what I need is to place the dropdownmenu for shop by price at the end in the search box. I do not want it in its own box like now. Can this be done???

 

Here is a link to my page to let you see how it looks at the moment:

 

http://www.kjolebutikken.com/oscdemo1/index.php

 

All help is very appreciated.

 

Thanks

Kjolebutikken


Best regards

Kjolebutikken

Share this post


Link to post
Share on other sites

I sorted out the shop by price infobox not showing the proper ranges when search-engine friendly URLs were turned on in admin

 

simply add the following to your /includes/languages/english/shop_by_price.php file

 

switch ($HTTP_GET_VARS['range']) {

case '0':

$get_range='0';

break;

case '1':

$get_range='1';

break;

case '2':

$get_range='2';

break;

case '3':

$get_range='3';

break;

}

 

so that it looks like this:-

 

<?php
/*
 $Id: shop_by_price.php,v 2.2 2005/12/10  $

 Contribution by Meltus
 http://www.highbarn-consulting.com

 Adapted for OsCommerce MS2 by:
 Sylvio Ruiz
 suporte@leilodata.com

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// Modified by Sylvio Ruiz in 10/12/2005 to format the currency string and to
// locate the price of the products based in the value of each currency.

// It only must return one. The value of $currency must be only.
$sel_currency = array();
$sel_currency_query = tep_db_query("select symbol_left, symbol_right, value from " . TABLE_CURRENCIES . " where code = '" . $currency . "' limit 1");
$sel_currency = tep_db_fetch_array($sel_currency_query);

$price_ranges = Array( 	"?Under " . $sel_currency['symbol_left'] . "20" . $sel_currency['symbol_right'],
					"?From " . $sel_currency['symbol_left'] . "20" . $sel_currency['symbol_right'] . " to " . $sel_currency['symbol_left'] . 50 . $sel_currency['symbol_right'],
					"?From " . $sel_currency['symbol_left'] . "50" . $sel_currency['symbol_right'] . " to " . $sel_currency['symbol_left'] . 100 . $sel_currency['symbol_right'],
					"?Above " . $sel_currency['symbol_left'] . "100" . $sel_currency['symbol_right']);

$price_range = Array( 	"under " . $sel_currency['symbol_left'] . "20" . $sel_currency['symbol_right'],
					"from " . $sel_currency['symbol_left'] . "20" . $sel_currency['symbol_right'] . " to " . $sel_currency['symbol_left'] . "50" . $sel_currency['symbol_right'],
					"from " . $sel_currency['symbol_left'] . "50" . $sel_currency['symbol_right'] . " to " . $sel_currency['symbol_left'] . "100" . $sel_currency['symbol_right'],
					"above " . $sel_currency['symbol_left'] . "100" . $sel_currency['symbol_right'] );

$price_ranges_sql = Array( 	//"p.products_price < 20",
						"p.products_price < " . 20 / $sel_currency['value'],
						//"(p.products_price <= 50.00 and p.products_price >= 20.00)",
						"(p.products_price <= " . 50 / $sel_currency['value'] . " and p.products_price >= " . 20 / $sel_currency['value'] . ")",
						//"(p.products_price <= 100.00 and p.products_price >= 50.00)",
						"(p.products_price <= " . 100 / $sel_currency['value'] . " and p.products_price >= " . 50 / $sel_currency['value'] . ")",
						// "p.products_price > 100.00");
						"p.products_price > " . 100 / $sel_currency['value']);

define('NAVBAR_TITLE', 'Shop by Price');
define('HEADING_TITLE', 'Shop by Price - ' . $price_ranges[$range]);
define('BOX_HEADING_SHOP_BY_PRICE', 'Shop By Price');
define('TABLE_HEADING_BUY_NOW', 'Buy Now!');
define('TABLE_HEADING_IMAGE', '');
define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
define('TABLE_HEADING_MODEL', 'Model');
define('TABLE_HEADING_PRICE', 'Price');
define('TABLE_HEADING_PRODUCTS', 'Product Name');
define('TABLE_HEADING_QUANTITY', 'Quantity');
define('TABLE_HEADING_WEIGHT', 'Weight');
define('TEXT_NO_PRODUCTS', '<p align="center"><br>Any product found ' . $price_range[$range] . '.<br>Try other option!<br><br></p>');

switch ($HTTP_GET_VARS['range']) {
 case '0':
$get_range='0';
 break;
 case '1':
$get_range='1';
 break;
 case '2':
$get_range='2';
 break;
 case '3':
$get_range='3';
 break;
 }

?>

 

then go into your /shop_by_price.php file and comment out the following line:-

 

//$get_range = ( (isset($_GET['range']) AND isset($price_ranges_sql[$_GET['range']])) ? $_GET['range'] : 0 );

 

thats it :)

 

see it in action on my store

 

http://www.outdoorbits.com UK Motorhome Accessories :)

Share this post


Link to post
Share on other sites

Is anyone using this with Master Products v1.1.5 ? All of my products show up on the "under $20" list, presumeably because all of my master products are set at $0. Any suggestions how I can exlude the masters?

 

Cheers

Shane

Share this post


Link to post
Share on other sites

I see it's been awhile since anyone has been on this thread, but maybe someone can offer me a solution. I've installed this successfully and it's working great except that the "Shop by Price" infobox has the title "Manufacturers" instead of "Shop by Price". I've tried to change the title to no avail. I do have many contribs installed too. Could something be interferring?

 

Any advice is greatly appreciated. Here's the site http://derbydogma.com


We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Share this post


Link to post
Share on other sites
I see it's been awhile since anyone has been on this thread, but maybe someone can offer me a solution. I've installed this successfully and it's working great except that the "Shop by Price" infobox has the title "Manufacturers" instead of "Shop by Price". I've tried to change the title to no avail. I do have many contribs installed too. Could something be interferring?

 

Any advice is greatly appreciated. Here's the site http://derbydogma.com

 

 

 

you should do some modification to fix this thing..

 

open catalog/includes/languages/english.php and add define('BOX_HEADING_SHOP_BY_PRICE', 'Shop by Price');

 

then open catalog/includes/boxes/search_by_price.php and

 

find:

//$info_box_contents = array();

//$info_box_contents[] = array('text' => BOX_HEADING_SHOP_BY_PRICE);

//new infoBoxHeading($info_box_contents, false, false);

 

then :

delete // from those 3 lines..

 

its done.. hope it can fix your problem.. :thumbsup:

Share this post


Link to post
Share on other sites

Hello,

 

I have installed it but when i select a price range i always receive this error:

Fatal error: Cannot redeclare tep_show_category() in /home/userl/public_html/sport/includes/boxes/categories.php on line 13

 

My install is based on osCommerce 2.2-MS2 . What can i do since i want to make it work ?

Edited by newagetech

Share this post


Link to post
Share on other sites

I want to use the contribution in MS2. But I dont find any thing like

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);

in shop_by_price.php

 

Do I have to manually add it or what?

 

Thank you

Share this post


Link to post
Share on other sites

Hello,

I've just uploaded a new version of Shop By Price.

Main changes :

- Items with special prices should be in the right range selection

- Shop by price should work well with "Display prices with tax" activated

- Title Fix

Shop by price is a bit different now, price under X or above X now also include X, I had to make this change to fix the "Display prices with tax" feature. It would have been too annoying to make it work exactly the same as before.

And few small more things

 

This said, I also have a question, is there a cvs/svn repository for this contribution ?

 

-GuiGui-

Share this post


Link to post
Share on other sites

I have installed version 2.4, everything works fine EXCEPT when I click on the dropdown and select "Above $50.00". When I choose this, I get this error:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

select count(p.products_id) as total from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd

on p.products_id = pd.products_id and pd.language_id = '1' left join specials s on p.products_id = s.products_id where p.products_status = '1' and

 

[TEP STOP]

 

 

Anyone have any ideas?

 

Harmonie

Share this post


Link to post
Share on other sites

Hi, I am having a problem with this mod, I dont know why but on one site (same code) any item under £100 will show twice so each product is side by side, on another site this still happens but under every price range.

 

Anyone know what can cause this?

 

Kind regards

 

Chris

Share this post


Link to post
Share on other sites

for the price range instead of editing them in languages files we could use the systeme from the genius GniDhal that would allows us to put range in admin :

here is the code that he uses in application top.php that we can find in the contribution here : http://www.oscommerce.com/community/contributions,4352

 

// BOF: Search price range
 $sel_currency = array();
 $sel_currency_query = tep_db_query("select symbol_left, symbol_right, value from " . TABLE_CURRENCIES . " where code = '" . $currency . "' limit 1");
 $sel_currency = tep_db_fetch_array($sel_currency_query);
 $price_range_values = array();
 $price_range_array = array();
 $step_range = split('[/,:]',STEP_PRICE_RANGE_VALUES);
 foreach($step_range as $key => $step) {
 $price_range_values[$key]['to'] =  intval($step);
 $price_range_values[$key+1]['from'] =  intval($step);
 $price_range_array[$key] = array('id' => $key, 'text'=> ($price_range_values[$key]['from'] !=0) ? FROM_RANGE_PRICE.$sel_currency['symbol_left'].$price_range_values[$key]['from'].$sel_currency['symbol_right']. TO_RANGE_PRICE .$sel_currency['symbol_left'].$price_range_values[$key]['to'].$sel_currency['symbol_right'] : UPTO_RANGE_PRICE .$price_range_values[$key]['to'].$sel_currency['symbol_right']) ;
 $price_range_array[$key+1] = array('id' => $key+1, 'text'=> ($price_range_values[$key+1]['to'] !=0) ? FROM_RANGE_PRICE.$sel_currency['symbol_left'].$price_range_values[$key+1]['from'].$sel_currency['symbol_right']. TO_RANGE_PRICE .$sel_currency['symbol_left'].$price_range_values[$key+1]['to'].$sel_currency['symbol_right'] : ABOVE_RANGE_PRICE .$sel_currency['symbol_left'] .$price_range_values[$key]['to'].$sel_currency['symbol_right'])  ;
 }
 $price_range_array[0] = array( 'id'=>0, 'text'=> SELECT_RANGE_PRICE);
// EOF: Search price range


MS2

Share this post


Link to post
Share on other sites

is there anybody who achieved to modify the contribution for enable - dsable categories contributions ?


MS2

Share this post


Link to post
Share on other sites

hei can anyone help me with this:?

 

i read all the topics and replies but didn't manged to resolve the problem that i seen that a lot of people had...

 

i want first to print the price range withouth those decimals

second i am in a category and i click a price range... the results must be from that category..

 

 

can you help me with this?

 

thank you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×