Community Add-Ons
Quantity Price Breaks Per Product
for osCommerce Online Merchant v2.2
This Quantity Price Break module will allow for:
1) Quantity pricing per product (unlimited number of price break levels as of version 1.3.x)
This is useful if you need to give your customers different prices based on the quantity they order. (volume discounts)
The product information page will display a table of the price break prices if a product has been configured to use price breaks.
2) Ability to force products to be sold in lots of # quantity. (The shopping cart will enforce this).
This is useful if you only want to sell say, cases of a product, but do not want to price the product by the case. (For example, if I sell a product in lots of 12 units, the shopping cart will only allow the customer to specify multiples of 12)
-------------------------------------------
1.0 is the initial version. Please direct any feedback and code modifications to me. I will see that they are integrated in. Feedback is welcome. Thank you.
Two more bugfixes, these two in includes/classes/shopping_cart.php. Discount category related.
More bugfixes:
- Bugfix in includes/classes/PriceFormatter where two variables needed conversion when information was retrieved from PriceFormatterStore (regarding qtyBlocks and special price)
Two more bugfixes in case there are no price breaks. sunrise99/David was right when he said $this->price_break can be empty. It *can* happen when the product is already in the cart in two places (one when dealing with special prices)
Upload the new file in case of upgrading from 1.3.2b
- Bugfix in admin/categories.php where a warning is echo'ed multiple times in the price break part because $price_breaks is not an array:
around line 715:
if(array_key_exists($count, $price_breaks_array)) {
is changed to
if(is_array($price_breaks_array) && array_key_exists($count, $price_breaks_array)) {
- Bugfix in includes/modules/product_listing.php where with MySQL4 you get an error on line 92 about product_id being ambiguous (doesn't happen in MySQL5).
using(products_id) where products_id
was changed to
using(products_id) where p.products_id
Changes in includes/classes/PriceFormatter.php, includes/classes/PriceFormatterStore.php, includes/modules/product_listing, and product_info.php (bugfixes mainly, doing some things differently).
Updated installation instructions including adding back some missing code in the instructions for admin/categories.php (the file itself was not changed).
Change from version 1.3.2 (removed from view): replaced includes/modules/product_listing.php with the new file.
Change from version 1.3.2a (removed from view): bug in includes/classes/shopping_cart.php fixed (thanks Greg/mickeymouse)
Added price break per discount category and added manual installation instructions
In this version i have refactored the contribution to move price-break data out of the products table and into a seperate (new) price-break table. This solves the limit of 8 price-break levels and also removes the overhead of 16 columns to the products table.
In addition i made some improvements, updated the standard layout of the price-break table (using sources from contribution http://addons.oscommerce.com/info/2269) and fixed the preview screen in admin.
Counterside of this version is that i have not looked into price-breaks per categorie, this addition need to be integrated in again.
Last but not least: this is the first version after quite some changes, although it seems to work there are probably some bugs still in, please use the forum or upload fixes to improve quality further.
No changes in the files. Screenshots and some frequently asked questions (FAQ) were added to the install.html in the hope of avoiding confusion with people not familiar with this contribution.
I'm not a professional PHP coder, but I managed to get the pricebreaks to show on products in the category view of products...
See line 328 through 353 in attached file: /catalog/includes/classes/PriceFormatter.php
- No changes to the functionality, just minor updates to install instructions and included files because of MS2.2 RC2a.
Support thread: http://forums.oscommerce.com/index.php?showtopic=220794&view=getnewpost
No changes - a line was missing in the instructions for adding the link to the discount_categories.php file in the categories box in the admin: catalog/admin/includes/boxes/catalog.php - this was missing in upgrade_to_price_break_per_discount_category.html) Kudos to John Price for catching this error and the missing file discount_categories.php.
- No changes, forgot to add admin/discount_categories.php to the package. Sorry.
No changes, just bugfixes in the two classes for the price break per discount category mod. Two instances of p.products_id = dc.products_id had to be changed to p.products_id = ptdc.products_id.
- No changes to the basic version, updated included files by using the RC1 files. Left out the files and instructions to use the base products_id for calculating the price break.
- Added instructions and files to calculate a price break based on the number of products that are in the same discount category (see upgrade_to_price_break_per_discount_category.html for details and instructions).
Support thread: http://forums.oscommerce.com/index.php?showtopic=220794&view=getnewpost
Bugfix as pointed out by signsnsuch added to contribution.
Go to: http://forums.oscommerce.com/index.php?s=&showtopic=246615&view=findpost&p=1018115
Change in PriceFormatterStore. Some osC installations reported an sql error in this class. It appears that the first item in the shopping_cart can be an empty value when using: $product_id_list = $cart->get_product_id_list();
Added some code to check for that.
No changes, only additional instructions and modified files for a price break that ignores attributes added.
No changes, just forgot to add product_info.php to the changed files. Corrected now.
No real new functionality added but updated for speed (less mysql queries). The preview of price breaks [like in the catalog] to admin/categories.php (Com2, June 2, 2005) was added and the manual instructions (renamed to install.html) by Yakky (August 19, 2005). For the install instructions and the modified files the osC update of August 17, 2006 was used.
See the readme.txt for more details. Upgrade instructions provided too.
What it does is only show price breaks with quantities that admin specifies. If no price breaks, it does not show.
I noticed some people were having trouble with this and I did this for a clients site. Screenshot available.
Only 1 file to modify.
http://forums.oscommerce.com/index.php?showtopic=220794
This is just a very easy to use tool that will make adding/updating price breaks very easy. Only a few variables to configure, and it's ready. 1 file.
Read the file and you will see how to configure it.
Makes the Quantity Price Breaks Per Product contribution MySQL5 compatible.
Installation instructions included in the zipfile.
Please note: I did not test it with MySQL4.
The quantity pricebreaks are not calcullated correctly if you use price breaks with 3 decimals (e.g 1.125).
See attached files for directions.
These are all the updates needed to OS Commerce 2.2 for the discount package. It is based off the full package of May 6, 2005.
This is for manual edits only! You may need to do manual edits if you have previously made changes to the files that the package updates.
This is a small fix so that getting special prices gets the right price when used with the SaleMaker contribution (and any other contributions that changes the special price when calling tep_get_products_special_price).
Find this line
$this->specialPrice=$prices['specials_new_products_price'];
Replace it with
$this->specialPrice=tep_get_products_special_price($prices['products_id']);
Just a quick hack that displays the quantity-price table in the admin's product preview, that appears just after editing a product. This allows you to do a final check before hitting the update button.
This is a description of the changes I made.
The previous file is missing the readme, and example txt files..this one is complete.
In my previous zip, I did not include the dbase query for the additional columns, theyre in this one. along with the manual install instructions. this contribution only adds a modified set of files that you can copy directly over. review the list of modifies files and if any of them have been modified by previous contributions, you will want to edit those manually. These files will just save you some time if you don't have a heavily modified cart...Remember to back Up!
Here is a zip of the modified files required for this mod., simply replace existing files with these...if your site has a modified CSS, do that manually, database query, still required.
I want to add 144 articles but in cart only are added 12 pce (=quantity block) So I need to change this manually in the cart..
does anyone have a solution for this?
Please find ONLY-DUTCH language files attached
As Erich correctly pointed out, a subdirectory was misspelled. The zip file included here is identical to the 1.11.2 version, but that correction has been made.
Also, to echo Erich's warning, this contribution changes how product prices are calculated and displayed, so as osCommerce contributions go, this one will take greater than normal effort. Back up your files and make the changes carefully.
In submitting the 1.11.2 patch, I missed one last-minute set of corrections to the PriceFormatter.php file. Now all the changes are in. Use this download, not the one from earlier today.
This version of the price break contribution builds on Lui Gee's version 1.11.1 of 15 July 2004, fixing bugs and completing the implementation. It is a complete replacement for the contribution; that is, it's meant to be installed over a stock osCommerce 2.2 MS 2 distribution.
The patch instructions in version 1.11.1 contained numerous bugs, mostly affecting the fifth through eighth price breaks. This new version fixes all of those bugs, to the best of our knowledge.
Also, this version incorporates the bug fixes submitted by Nathan Arendt on 10 August 2004, so there is no need to apply those patches after installation. Also, it fixes bugs that remained even after that patch.
Finally, we discovered in our own testing that products were not being listed in search results correctly; only the base price was listed, not the range given by the price breaks. This behavior conflicted with product listings in the regular browse hierarchy. We corrected the problem, and now all product listings should reflect price breaks correctly.
We were a bit confused about the version numbering on this contribution. How did we get from Andrew Baucom's version 1.1 to Lui Gee's version 1.11.1? In any case, we followed Lui Gee's lead and simply incremented the least-significant version number by one step.
New method "loadprice" added in priceformatter.php class that will load from DB only the fields related to the price, so ligher DB query.
I use it in product_info.php and other places where I display the prices (featured products, ...).
Method LoadProduct is still existing, so 100% compatible with older versions having 8 price breaks.
The package contains only the priceformatter.php file
This version of PriceFormatter.php supports specials. If any price break level has a price greater than the special price it is lowered to the special price.
I also completed supported for 8 price break levels. I don't know if version 1.11.1 just had an old file or if the person who added the extra price break levels never botherd to test it because the extra 4 price levels in version 1.11.1 do not work.
Simply replace your PriceFormatter.php with this new one (be sure to back up first).
Wenn im Shop nicht die englische Sprache verwendet wird, wird die Zwischensumme im Warenkorb nicht mehr berechnet.
Lösung (Price_Formatter.php Zeile 139):
function loadProduct($product_id, $language_id=1)
ersetzen durch:
function loadProduct($product_id, $language_id=2)
Mit dieser Änderung funktioniert der Shop für deutsche Sprache.
Diese Contrib basert auf price-break V1.11.
Funktionen:
Diese Contribution ermöglich es Staffelpreise (derzeit bis zu 6) zu nutzen.
Es wird sowohl in der Produktliste (product_listing.php) als auch auf der Produkt-Detailseite (product_info.php)
statt dem normalen Preis ein Box mit den Staffelpreisen angezeigt.
Im Admin-Bereich kann man wahlweise Netto- und/oder Bruttopreise eingeben.
Die Contib ist komplett in DEUTSCH!
Now it's possible to use 8 price-breaks. This documentation howto change the php files incl. the bugfix.txt for other languages.
For english user simple change the language files.
Read the readme.txt befor getting started!
Price-break is a good contribution, i tested it my self.
Patch to fix the shopping cart error when using a language id other than English.
I take no credit (good or bad) for the Price Break contribution.
This set of instructions is something I assembled by comparing the complete MS2 code provided by Andrew Baucom to the official stock MS2 release.
I am a novice with PHP and I make no pretense of understanding every piece of this code. I just compared the code and documented the differences.
This version is to replace my previous awb_pb version. The features are basically the same but it has been cleaned up and made more modular.
THIS IS NOT A FIX TO THE OLD ONE. IT IS A REWRITE!
You should not install this version with the old awb_pb_1.0 version.
This was built around the MS2 version of oscommerce.
Modified price calculation to use 'special' price if active.
Replace 'catalog/include/functions/awb_pb.php' with this file.
(This does not update the product info, I'm still working on that)
-Andrew
Modified .../catalog/include/classes/order.php to correct final price during checkout.
D'OH!
New snapshot of price break module.
- Product price listing now lists as 'x.xx - y.yy' if price break is in use
- moved to combined catalog/admin patch file created via diff with clean tep snapshot
(check README)
This Quantity Price Break module will allow for:
1) Quantity pricing per product (currently 8 price break levels)
This is useful if you need to give your customers different prices based on the quantity they order. (volume discounts)
The product information page will display a table of the price break prices if a product has been configured to use price breaks.
2) Ability to force products to be sold in lots of # quantity. (The shopping cart will enforce this).
This is useful if you only want to sell say, cases of a product, but do not want to price the product by the case. (For example, if I sell a product in lots of 12 units, the shopping cart will only allow the customer to specify multiples of 12)
-------------------------------------------
1.0 is the initial version. Please direct any feedback and code modifications to me. I will see that they are integrated in. Feedback is welcome. Thank you.
