Community Add-Ons
Shop by price infobox
for osCommerce Online Merchant v2.2
This infobox lets the shopper select from a price range in an infobox. Its ideal for a gift shop type application.
At present it has only English language files.
It is built on MS1.
Greek Language file, tested and in use as of 29th October 2009
Alteration to version 2.5a:
The language array code needs to appear in english.php file - so that box shows correctly on pages other than the Shop by Price page itself.
While i was integrating this contribution i thought why making it so complicated while the functionality is allready in the advanced_search?
I rewrote what i needed and it appears to be limited to a few extra lines in the search box (which is already there). I attached the resulting search.php box, language items you will have to do yourselves.
This is what i added:
$price_ranges = array(
array('max' => 10),
array('min' => 10, 'max' => 20),
array('min' => 20));
<...>
$info_box_contents[] = array(
'align' => 'center',
'text' => '<b>' . BOX_SEARCH_TEXT2 . '</b>');
$info_box_contents[] = array('text' => tep_draw_separator('pixel_trans.gif', '100%', '5'));
for ($index=0; $index<sizeof($price_ranges); $index++) {
if(isset($price_ranges[$index]['min']) && isset($price_ranges[$index]['max'])) {
$info_box_contents[] = array(
'align' => 'center',
'text' => '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'pfrom=' . $price_ranges[$index]['min'] . '&pto=' . $price_ranges[$index]['max'], 'NONSSL') . '">' . '€' . number_format($price_ranges[$index]['min'], 0) . ' ' . BOX_SEARCH_TO . ' €' . number_format($price_ranges[$index]['max'], 0) . '</a><br>');
} else if(isset($price_ranges[$index]['min']) && !isset($price_ranges[$index]['max'])) {
$info_box_contents[] = array(
'align' => 'center',
'text' => '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'pfrom=' . $price_ranges[$index]['min'], 'NONSSL') . '">' . BOX_SEARCH_FROM2 . ' €' . number_format($price_ranges[$index]['min'], 0) . '</a><br>');
} else if(!isset($price_ranges[$index]['min']) && isset($price_ranges[$index]['max'])) {
$info_box_contents[] = array(
'align' => 'center',
'text' => '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'pto=' . $price_ranges[$index]['max'], 'NONSSL') . '">' . BOX_SEARCH_TO2 . ' €' . number_format($price_ranges[$index]['max'], 0) . '</a><br>');
}
}
and that's it....!
new instruction for adding this box to use if you are using STS:
1. Unpack in your root directory;
2. Edit "/includes/filenames.php" adding:
define('FILENAME_SHOP_BY_PRICE','shop_by_price.php');
3. Edit "/includes/modules/sts_inc/sts.column_left" adding:
find:"
include(DIR_WS_BOXES . 'specials.php');
$sts->restart_capture ('specialbox', 'box'); // Get special box
$sts->template['specialfriendbox']=$sts->template['specialbox']; // Shows specials or tell a friend
"
add after:"
include(DIR_WS_BOXES . 'shop_by_price.php');
$sts->restart_capture ('shopbypricebox', 'box');
$sts->template['shopbypricebox']=$sts->template['shopbypricebox'];
"
4. call $shopbypricebox anywhere in your sts pages. enjoy!
-incluso lingua italiana
-not included fix below.
-Full package
I was having an issue where anything in the lowest price range was duplicated, so you see 2 of the same products side by side, I have a heavily modified store and think the cause of this issue is to do with a "inc VAT and EX Vat" mod i added, Only change this if you are also having this issue.
Find:
$select_str = "select distinct " . $select_column_list . " p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";
if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
$select_str .= ", SUM(tr.tax_rate) as tax_rate ";
}
Change to:
$select_str = "select distinct " . $select_column_list . " p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";
if ( (DISPLAY_PRICE_WITH_TAX == 'false') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
$select_str .= ", SUM(tr.tax_rate) as tax_rate ";
}
//////Done!
changed a lot of code for this version, so be careful when installing it and don't forget to backup.
Changed: the main file to look more like the "advanced_search_result.php" file (code point of view).
Changed: As a result, the background image used (top right corner) is the same as advanced search, this was not necessary but I found it more logical than the one used for new products. So I left it.
Added: As a result, shop by price now take into account the special prices
Added: Also as a result, if you are using the "display prices with tax" feature of osCommerce, this should also work well now.
Added: Support to make it work with the contribution: "Product Listing in Columns" (this can be removed)
Fix: The prices chosen should display correctly in the title (some people had problems with that).
Changed: As a result price ranges does not work exactly the same but this was necessary to fix the "display prices with tax" feature.
more details in the package
- Added French Translation : the one done by someone else before was in fact in english in the pack
- Changed : to be more coherent, the position of
define('FILENAME_SHOP_BY_PRICE','shop_by_price.php');
has been changed.
- Optional : easy way to display the Box Heading (this was already possible in the glassraven's package, just not explained).
This is a complete package
Edit two files:-
catalog/includes/boxes/shop_by_price.php
catalog/includes/languages/english.php
Note: the download file is not a zip file but a text file renamed to zip!
Voici la traduciton française du fichier shop_by_price.php
(A copier dans le répertoire : /catalog/includes/languages/french/)
-----------------------------------------------------------
Here is the french translation of the file shop_by_price.php
(to install in : catalog/includes/languages/french/)
http://www.alyseeinformatique.com
Sébastien MONACO
Version 2.4 allows you to select from a dropdown list format or text list style format.
Installation document updated to be easier to follow.
Full Package included.
Modified the query in order to have the sort by weight and product model being displayed when activated in teh product listing options.
This is a full package
The price ranges were not displayed in the selected currency, only the symbol was. This has been fixed in this version: a customer select Yens will now see the price ranges in yens, and not the 20, 50, 100 ranges. Creating new ranges is also easier, using less code.
This is a
solution.
Search for this and follow the rules:
/*
Warning by Sylvio Ruiz in 02/02/2006
You need define what fields will show in page result using // to hide a
field.
Don't forget what the last field can't have "," at the end.
Edit the number to modifiy a display order.
All possible fields are listed below:
*/
$define_list = array(
'PRODUCT_LIST_IMAGE' => 0,
'PRODUCT_LIST_MODEL' => 1,
'PRODUCT_LIST_NAME' => 2,
'PRODUCT_LIST_MANUFACTURER' => 3,
'PRODUCT_LIST_PRICE' => 4,
'PRODUCT_LIST_QUANTITY' => 5,
'PRODUCT_LIST_WEIGHT' => 6,
'PRODUCT_LIST_BUY_NOW' => 7
);
Best Regards;
Sylvio Ruiz
To view witch column you want. Tks Sylvio !
spanish (es_ES) translation of this info fox.
translation done by me.
---spanish---
traducción al español (es_ES) de este infobox.
Release: Shop By Price v2.2.1
This is a small modification for this wonderful contribution to work with osCommerce MS2.
All credit goes to the original developer: Matt Davies.
New Feautures in Shop By Price v2.2.1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Fixed: Update Translation for Germany;
New Feautures in Shop By Price v2.2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
New Feautures in Shop By Price v2.1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Fixed: Problem with "breadcrumb";
Fixed: Problem with of table header;
Added: Text for empty queries with information;
Added: Capacity for new ordinance of registers through click in the top of the columns;
Added: Translation for Portuguese of Brazil;
New Feautures in Shop By Price v2.2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Added: Translation for Germany (Thanks to Kornie);
Added: Prices are displayed in infobox with the respective currency,
using "symbol_left" and "symbol_rigth" of TABLE_CURRENCIES (Thanks to Kornie for idea);
Added: PageHeading with information of range value;
Added: Conversion of values before the query,
what it allows to show correct result independent of the currency standard.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-> HowTo in zip file.
Translations for others languages will be coming well, specially to spanish.
Please send translations unpacked to: sylvioruiz@ibest.com.br
Thanks for all contributors, specially to Brian Gallagher for your "Simple Template System - STS",
OsCommerce Team and Kornie.
Sylvio Ruiz
sylvioruiz@ibest.com.br
Salvador - Brazil
10/12/2005
Release: Shop By Price v2.2
This is a small modification for this wonderful contribution to work with osCommerce MS2.
All credit goes to the original developer: Matt Davies.
New Feautures in Shop By Price v2.1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Fixed: Problem with "breadcrumb";
Fixed: Problem with of table header;
Added: Text for empty queries with information;
Added: Capacity for new ordinance of registers through click in the top of the columns;
Added: Translation for Portuguese of Brazil;
New Feautures in Shop By Price v2.2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Added: Translation for Germany (Thanks to Kornie);
Added: Prices are displayed in infobox with the respective currency,
using "symbol_left" and "symbol_rigth" of TABLE_CURRENCIES (Thanks to Kornie for idea);
Added: PageHeading with information of range value;
Added: Conversion of values before the query,
what it allows to show correct result independent of the currency standard.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Translations for others languages will be coming well, specially to spanish.
Please send translations unpacked to: sylvioruiz@ibest.com.br
Thanks for all contributors, specially to Brian Gallagher for your "Simple Template System - STS",
OsCommerce Team and Kornie.
Sylvio Ruiz
sylvioruiz@ibest.com.br
Salvador - Brazil
10/12/2005
Small modification: Prices are displayed with the respective currency. Added german language file.
This is a small modification for this wonderful contribution to work with osCommerce MS2.
All credit goes to the original developer: Matt Davies.
New Feautures xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Fixed: Problem with "breadcrumb";
Fixed: Problem with of table header;
Added: Text for empty queries with information;
Added: Capacity for new ordinance of registers through click in the heading of the columns;
Added: Tanslation for Portuguese of Brazil.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Translations for others languages will be coming well, specially to spanish and deutch.
Please send unpacked to: sylvioruiz@ibest.com.br
Thanks for all contributors, specially to Brian Gallagher for your "Simple Template System - STS" and OsCommerce Team.
Sylvio Ruiz
Salvador - Brazil
08/12/2005
Hi All, just another minor change to the /catalog/shop_by_price.php to include query for WEIGHT and QUANTITY.
Well done to Matt Davies and everyone else who have contributed to this great little infobox!
Best Regards,
AA
www.mrgadget.com.au
- Same as previous, but with a $breadcrumb fix.
This is a bugfix release for shop_by_price.php. SQL error that you get when you click on the shop _by_price.php
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(*) 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 = '4' left join specials s on p.products_id = s.products_id where p.products_status = '1' and
All credit goes to the original Author: Matt Davies
This revision will address the SQL error that you get when you click on the little arrow "more" link in the infobox header. Also, it will fix the table headers on the shop_by_price page.
******************
*****************
****************
All credit goes to the original Author: Matt Davies for this great contribution. Thanks.
Regards,
Ray Chinoy
This didn't install smoothly on MS1 at first - I forgot I had altered some of my files.
This fixes this install problem
This infobox lets the shopper select from a price range in an infobox. Its ideal for a gift shop type application.
At present it has only English language files.
It is built on MS1.
