A complete overview of what version 4.2 of this contribution does and how it works can be seen in the 'documentation' folder that is included in this package. It was supposed to be in the 4.1 release of March 15, 2005 but in the end it was uploaded separately "(Separate Pricing Per Customer V4.1 (Missing HTML-Overview from package)" on April 27, 2005. Just click on the index.htm file in that directory for a visual tour and complete description of the contribution. It's the easiest way to get a handle on the simplicity and power of Separate Pricing 4.2 and doubles as an instruction manual.
The 4.2 releases differs from the 4.1 release in that new features such as the ability to enable or disable taxes on a per group or individual customer level have been added. This will not be needed by many but sites in certain provinces in Canada selling to companies are an example.
Another scenario might be where a company pays a different amount of tax for a good than a private person. Then you can put both taxes on a product but make retail exempt for the company tax and vice versa. In 4.2.1 a small feature was added: set order_total modules per customer group/customers in the same general way as payment and shipping options could be set.
The company tax id number that was stored in the table address_book in version 4.1 is now moved to the table customers. As before the customer can add this number when creating an account. If not done at that time the customer can add a company tax id later when editing his/her account (account_edit.php) as long as no company tax id has been added. If one has been added it becomes uneditable.
The changes to includes/modules/address_book_details.php and address_book_process.php that were needed in version 4.1 were removed (files back to original state).
The code for making prices and visibility of attributes customer group specific is included now (was uploaded earlier) as well as the code for sending email and newsletter (also uploaded earlier).
In addition several small bug fixes were made to the 4.1 code. Some of those were included in the versions 4.1.2-4.1.6 or uploaded as bugfixes (like those to customers.php and customer_groups.php).
The admin side for the customer group specific attribute prices is provided through a pop-up window (attributes_groups.php) that is reached through an extra button in the product attributes table at the bottom of admin/product_attributes.php. In the pop-up window the retail price and the group price for the attribute can be changed, as well as for which groups this attribute should be hidden. To add a price for a customer group other than retail make the changes and check the box under the heading "Insert" before saving (entering nothing in the input for Value Price will insert 0.0000). When a price for this customer group is already in the database there will be checkbox visible under the heading "Delete". Check that box and save if you want to remove the price for that customer group. After saving changes one or more times the number of saves will be shown in the top of the screen. You can close the window also with the "cancel" button.
Code added to the class shopping_cart will prevent attributes hidden for the group to be added to the cart, for example when a page is saved as HTML locally, attributes edited and then the edited page submitted. Also when an attribute is hidden from a group but not from retail the hidden attributes will be stripped from the product. This might not be a valid product since the attribute(s) is/are removed, not replaced!
This contribution has been written for osCommerce Milestone 2.2 RC1. It is unlikely that it will work with other versions (like 2.1) of osCommerce (the 2.2 August 17, 2006 updated version should give no problems though, using a manual install). If you have a new installation of Milestone 2.2 RC1 then the easiest way to install this contribution is to upload the included files and run the spcc_v42_install.sql file on your MySql machine (most ISP's will offer use of phpMyAdmin). After that modify the catalog/includes/languages/english/login.php file to include your email address. This email address is used for wholesale account notifications. You can find the appropriate section of that file by doing a search for the keyword root. This is the preferred installation method due to ease/speed of installation.
If you have an existing installation of Milestone 2.2 that has been modified extensively with contributions then you will have to install Separate Pricing Per Customer manually. This is a bit of a chore as you will be modifying 47 files in 13 folders and you should allow some time for this. If you only have a few small contribs installed then it may be easier to upload all the included Separate Price files and choose to re-install the smaller contribs.
A much easier way to install the contribution manually is to use a product like Compare & Merge or similar as this greatly decreases the amount of time required to do a manual install and also highlights the exact changes between the contrib and your original files. This is the preffered way to install the contrib manually. (http://www.compareandmerge.com/) Their site offers a trial version that will do 50 files so it will complete this install for you at no cost.
A FOSS tool is KDiff3 (http://kdiff3.sourceforge.net) that I personally haven't used for merging, but it is a nice tool to find and show file differences.
A free as in gratis tool is DiffMerge (available for Windows, Mac OSX, and Linux) from SourceGear.
If you prefer to use an install text instead of the HTML version (new in version 4.2) then you can still use this html file. The html tags were left above and below the code. It was only necessary to change the no-break spaces ( and  ) to   and   respectively going from text to HMTL version. Most of those are found in admin/customers.php.
If you have trouble selecting text from a large text area (the larger one will expand when you click in them by the way), your browser most likely will enable you to do a "select all" (Control-A or equivalent Mac version) of the text in the text area the cursor is in.
If you use Firefox 2.0.6 on the Mac you might experience a JavaScript error using this file (with freezing of the browser window) "Error: too much recursion". I have not been able to find a solution to this. The Windows version (on Vista) does not seem to have the problem. It also worked error-free on Firefox 1.5 (on Windows 98) and Internet Explorer (Win98).
For those who know what to do with it diff files were added to the package. They were created with the command diff -ub old_file new_file > patch_file. The patch file has been given the same name as the old_file/new_file but with the diff extension instead of php (diff or patch appear to be the accepted extensions and because of Windows diff is probably preferred and most used anyway).
To apply the changes using the diff file you likely will want to see if the patch will not throw any errors. Then you first use: patch --dry-run file_to_patch patch_file and if everything seems to work fine you apply the patch. I would say use the command to also create a backup (using patch -b instead of patch) of the original file (with a .orig extension).
So having the diff uploaded to the same directory as the file to change and having changed path to that directory:
patch -b products_attributes.php products_attributes.diff will create the patched file products_attributes.php and the backup products_attributes.php.orig.
Diff and patch are standard command line utilities on Mac's (OS X) and Linux systems.
Support for this contribution can be found in the Separate Price Contribution Support Thread at the osCommerce website (http://forums.oscommerce.com/index.php?showtopic=53436) Please note that support for this contribution is provided on a limited basis. It's not the author(s) responsibility to ensure the contribution works with other's that are installed nor to trouble shoot installation issues.
A great deal of testing time has been spent on the documentation to ensure that it is accurate and reliable so conflicts with other contributions should be the only potential issue that may arise. In that case, if courtesy support is not forthcoming, you might find it worthwhile to consult a dedicated PHP programmer.
While every effort has been made to ensure this contribution is as bug free as possible, as with all osCommerce contributions, they are installed at your own risk.
IMPORTANT: Before beginning the installation you will want to backup both your MySql database and the files on your site so that you can return your site to an unmodified state if you so desire.
IMPORTANT: Not many people have posted about this, so in general this will hardly be a problem, but you cannot have a special product more than once in the list of specials. In standard osC you can leave in an expired special and add another one for the same product. This cannot be done with SPPC! It will generate an error when the code generates a table with prices and special prices for a group (specials_retail_prices for retail customer and products_group_prices_cg# where # is the customer group id for the particular group). These tables are generated and renewed automatically and are used by the code for sorting products on price in the product listing (on index.php). The particular table for specials_retail_prices is also setup when using the sppc_v421_install.sql. It is the last command in the sql file, so if you get an error mentioning the table specials_retail_prices doing the install with the sql file, don't worry, the important stuff is done. Just remove the duplicate specials in the admin and sort a product listing on price after that in the catalog section (when not logged-in or logged-in as a retail customer).
TIP: It's also a very good idea, in general, to check out the discussion thread for ANY contribution BEFORE you install it to see what the common issues are with it and whether it suits your needs.
TIP: BEFORE POSTING about a problem after installing, check the file listed in the web browser's address to ensure YOU didn't forget any edits.
INFO: This contrib works with Cross Sell (X-Sell) Admin as well - provided you make a few changes outlined in http://forums.oscommerce.com/index.php?showtopic=53436&view=findpost&p=558602 A new Cross Sell release has also been posted including the pre-modified file.
NOTE JanZ: I'm not convinced this is true. I couldn't make it work. Probably better to use the original file and change prices the way includes/modules/product_listing.php does that.
As an extra the SPPC modified files for Featured Products (http://www.oscommerce.com/community/contributions,651) [version 1.5.9 by bkellum of July 15, 2007] were added to the package (catalog/includes/modules/featured.php, catalog/includes/boxes/featured.php, and catalog/featured_products.php).
Another popular contribution is Product Listing in Columns. Version 2.2 [http://www.oscommerce.com/community/contributions,112 by adilovetini and djmonkey1, April/June 2007] is pretty complicated and full of features. A version adapted for SPPC with some fixes and the buy now button in a separate table row if you use "Display Buy Now column" is in the package (catalog/includes/modules/product_listing_col.php).
If you don't need all that functionality you could use the more simple version Column Product Listing (for Separate Pricing Per Customer v4.0) [http://addons.oscommerce.com/info/3007].A contribution that adds a tax class to osC 2.2 (backported by Chemo from osC v3) that stores the tax rate and tax description of products greatly reducing the number of queries for that information is the contribution Optimize tep_get_tax_rate() method (http://addons.oscommerce.com/info/2417). To make that work well with SPPC you need to follow the directions on how to change a few small things in your installation (add a few lines to application_top and change two functions in includes/functions/general.php found in Optimize tep_get_tax_rate() v1.1 of November 24, 2004) and upload the SPPC modified tax.php to catalog/includes/classes/ (See directory: new_installations/catalog/includes/classes/tax.php).
IMPORTANT: If you have an older installation of osC and start adding files from this contribution be aware that some things have been changed. You might get an error about includes/classes/currencies.php missing the function calculate_price (this was added in RC1, see a download of RC2a, folder extras for the instructions on how to update) and the function tep_hide_session that has always been present and only used on the catalog side was also added to the admin side in catalog/admin/includes/functions/html_output.php (RC1 again).
In RC2 a new function was added to includes/classes/payment.php: checkout_initialization_method.
In the "Changes in 4.1 from 4.0" section of changelog_v421.txt (in the package) there are a number of Tips & Tricks given for this contribution. It might be useful to do a search for "SPPC" in the contribution section to see what addons specifically written for SPPC are available.
NOTE: The Quantity Price Breaks contribution has seen some rather large changes in version 1.3. The SPPC version has not been updated yet to reflect the changes in 1.3 as of the date of writing (July 20, 2008).
Before beginning the manual install you need to:
Upload five included image files to your site. They are (and located in):
The first two are used in admin/customers.php (you may already have those if you use for example Quick Price Updates) and the other three are used in admin/attributes.php and admin/attributes_groups.php.
Upload four new .php files:
catalog/admin/includes/languages/english/customers_groups.php, catalog/admin/includes/languages/english/attributes_groups.php, catalog/admin/customers_groups.php, and catalog/admin/attributes_groups.php.
Run the spcc_v421_install.sql database installation file on your MySQL database.
Modify the catalog/includes/languages/english/login.php file to include the Site Administrator's email address. This email address is used for wholesale account notifications. You can find the appropriate section of that file by doing a search for the keyword root.
NOTE: All Line numbers assume an un-modified Milestone 2.2 Release Candidate 2a installation. If you have extensively modified your site then the line numbers will be approximate only and may be off due to your added or removed code.
If you have a release prior to RC2a you will notice that in all files the id tags on line 3 of the file have changed. Most of them now have the number 1739 in them like
$Id: customers.php 1739 2007-12-20 00:52:16Z hpdl $
TIP: If you are using a Text Editor to install this contribution manually then be sure that it removes trailing whitespace characters. Free editors like TextPad and others do this.
IMPORTANT: Don't blindly follow the //BOF & //EOF Line Markers - in some instances extra code is required for simplicity & clarity. Follow the instructions exactly and you won't have any issues.
Line 4
**AFTER**
**ADD**
Lines 23-25
**REPLACE**
**WITH**
Line 4
**AFTER**
**ADD**
Lines 203-208
**REPLACE** (this is in the function tep_draw_products_pull_down)
**WITH**
Line 896 [922 in edited file, this is inside the function tep_remove_product($product_id)]
**AFTER**
**ADD**
This is a custom Separate Pricing Per Customer File so you need to copy it from the included files in this contribution and upload it to catalog/admin/includes/languages/english/
Line 4
**AFTER**
**ADD**
Line 86
**AFTER**
**ADD**
Line 4
**AFTER**
**ADD**
Line 18
**AFTER**
**ADD**
This is a custom Separate Pricing Per Customer File so you need to copy it from the included files in this contribution and upload it to catalog/admin/includes/languages/english/
Line 4
**AFTER**
**ADD**
Line 13
**AFTER**
**ADD**
Line 4
**AFTER**
**ADD**
Line 34
**AFTER**
**ADD**
Line 3
**AFTER**
**ADD**
Line 20
**AFTER**
**ADD**
Line 3
**AFTER**
**ADD**
Line 22 [23]
**AFTER**
**ADD**
Line 83 [87]
**AFTER**
**ADD**
Line 169 [176]
**AFTER**
**ADD**
Line 4
**AFTER**
**ADD**
Line 58
**AFTER**
**ADD**
Line 4
**AFTER**
**ADD**
Line 52 [53]
**AFTER**
**ADD**
This is a custom Separate Pricing Per Customer File so you need to copy it from the included files in this contribution and upload it to catalog/admin/
This is a custom Separate Pricing Per Customer File so you need to copy it from the included files in this contribution and upload it to catalog/admin/
Line 3
**AFTER**
**ADD**
Line 151
**AFTER**
**ADD**
Line 247
**AFTER**
**ADD**
Line 303 [334 in edited file]
**AFTER**
**ADD**
Line 530-532 [572-574 in edited file]
**AFTER**
**ADD**
Line 707 [798 in edited file]
**REPLACE**
**WITH**
Line 4
**AFTER**
**ADD**
Line 29 [31 in edited file]
**AFTER**
**ADD**
Line 159 [220 in edited file]
**REPLACE**
**WITH** (NOTE: ");" replaced with "," in the line to replace!)
Line 206 [276 in edited file]
**AFTER**
**ADD**
Line 224 [294 in edited file, without optional code above]
**REPLACE**
**WITH**
Lines 487-494 [606-610 in edited file]
**AFTER**
**ADD**
Lines 683-688 [832-837 in edited file]
**REPLACE**
**ADD**
Line 342-387 [349-394 in edited file]
**REPLACE** (number of lines left out)
|