Separate Pricing Per Customer 4.2.2 for RC2a

Revised & Re-Written by JanZ & documented by Marvin Miller and JanZ

Released under the GNU General Public License

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!

Installation Scenarios

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

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).

Manual Installation

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.


List of files that need to be changed:

catalog/admin/includes/boxes/customers.php

Line 4
**AFTER**

**ADD**

Lines 23-25
**REPLACE**

**WITH**

Top

catalog/admin/includes/functions/general.php

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**

Top

catalog/admin/includes/languages/english/attributes_groups.php

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/

catalog/admin/includes/languages/english/categories.php

Line 4
**AFTER**

**ADD**

Line 86
**AFTER**

**ADD**

Top

catalog/admin/includes/languages/english/customers.php

Line 4
**AFTER**

**ADD**

Line 18
**AFTER**

**ADD**

Top

catalog/admin/includes/languages/english/customers_groups.php

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/

catalog/admin/includes/languages/english/orders.php

Line 4
**AFTER**

**ADD**

Line 13
**AFTER**

**ADD**

Top

catalog/admin/includes/languages/english/products_attributes.php

Line 4
**AFTER**

**ADD**

Line 34
**AFTER**

**ADD**

Top

catalog/admin/includes/languages/english/specials.php

Line 3
**AFTER**

**ADD**

Line 20
**AFTER**

**ADD**

Top

catalog/admin/includes/languages/english.php

Line 3
**AFTER**

**ADD**

Line 22 [23]
**AFTER**

**ADD**

Line 83 [87]
**AFTER**

**ADD**

Line 169 [176]
**AFTER**

**ADD**

Top

catalog/admin/includes/database_tables.php

Line 4
**AFTER**

**ADD**

Line 58
**AFTER**

**ADD**

Top

catalog/admin/includes/filenames.php

Line 4
**AFTER**

**ADD**

Line 52 [53]
**AFTER**

**ADD**

Top

catalog/admin/attributes_groups.php

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/

catalog/admin/customers_groups.php

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/

Top

catalog/admin/categories.php

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**

Top

catalog/admin/customers.php

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!)

BOF SECTION THAT IS OPTIONAL AND NOT RECOMMENDED TO INSTALL UNLESS YOU REALLY WANT THIS FEATURE

Line 206 [276 in edited file]
**AFTER**

**ADD**

EOF SECTION THAT IS OPTIONAL AND NOT RECOMMENDED TO INSTALL UNLESS YOU REALLY WANT THIS FEATURE

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**

**WITH**

Lines 706-719 [1132-1145 in edited file]
**REPLACE**

**WITH**

Lines 744-786 [1216-1258 in edited file]
**REPLACE**

**WITH**

Top

catalog/admin/includes/classes/order.php

(optional but needed if you add showing customers group name in the order, see next change)

Line 3
**AFTER**

**ADD**

Line 28
**REPLACE**

**WITH**

Line 55 [58 in edited file]
**AFTER**

**ADD**

Top

catalog/admin/orders.php (optional)

Line 4
**AFTER**

**ADD**

Lines 151-153 (you should have added the optional change of admin/includes/classes/order.php above)
**AFTER**

**ADD**

Line 342-387 [349-394 in edited file]
**REPLACE** (number of lines left out)

**WITH**

Top

catalog/admin/product_attributes.php

Line 3
**AFTER**

**ADD**

Line 59 [60]
**REPLACE**

**WITH**

Line 143 [146]
**AFTER**

**ADD**

Line 543 [549]
**REPLACE**

**WITH**

Line 553 [561]
**REPLACE**

**WITH**

Line 561 [569]
**AFTER**

**ADD**

Line 565 [576]
**REPLACE**

**WITH**

Line 568 [579]
**AFTER**

**ADD**

Line 571 [589]
**REPLACE**

**WITH**

Line 618 [637]
**AFTER**

**ADD**

Line 661 [683]
**AFTER**

**ADD**

Line 672 [697]
**REPLACE**

**WITH**

Line 685 [713]
**REPLACE**

**WITH**

Line 714 [742]
**AFTER**

**ADD**

Line 746 [777]
**REPLACE**

**WITH**

Line 760 [791] (last line)
**AFTER**

**ADD**

Top

catalog/admin/specials.php

Line 4
**AFTER**

**ADD**

Line 16 [17]
**AFTER**

**ADD**

Line 33 [41 in edited file]
**AFTER**

**ADD**

Line 50 [74 in edited file]
**REPLACE**

**WITH**

Line 131-132 [157-158 in edited file]
**REPLACE**

**WITH**

Line 140 [174]
**REPLACE**

**WITH**

Line 144 [179]
**AFTER**

**ADD**

Line 151 [199]
**AFTER**

**ADD**

Line 185 [247 in edited file]
**REPLACE**

**WITH**

Line 188 [263]
**REPLACE**

**WITH**

Line 203 [286]
**REPLACE**

**WITH**

Line 258 [343 in edited file]
**REPLACE**

**WITH**

Top

catalog/includes/database_tables.php

Line 4
**AFTER**

**ADD**

Line 59 [60]
**AFTER**

**ADD**

Top

catalog/includes/boxes/specials.php

Line 4
**AFTER**

**ADD**

Line 13 [14]
**REPLACE**

**WITH**

Top

catalog/includes/boxes/whats_new.php

Line 4
**AFTER**

**ADD**

Lines 13-20 [14-21]
**REPLACE**

**WITH**

Top

catalog/includes/classes/order.php

Line 4
**AFTER**

**ADD**

Line 282 [283]
**AFTER**

**ADD**

Line 299 [307 in edited file]
**AFTER**

**ADD**

Line 317 [334]
**REPLACE**

**WITH**

Line 336 [353]
**REPLACE**

**WITH**

Top

catalog/includes/classes/order_total.php

Line 4
**AFTER**

**ADD**

Line 21 [22]
**REPLACE**

**WITH**

// BOF Separate Pricing Per Customer, next line original code // $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED); global $customer_id; if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } $customer_ot_query = tep_db_query("select IF(c.customers_order_total_allowed <> '', c.customers_order_total_allowed, cg.group_order_total_allowed) as order_total_allowed from " . TABLE_CUSTOMERS . " c, customers_groups cg where c.customers_id = '" . $customer_id . "' and cg.customers_group_id = '" . $customer_group_id . "'"); if ($customer_ot = tep_db_fetch_array($customer_ot_query) ) { if (tep_not_null($customer_ot['order_total_allowed']) ) { $temp_ot_array = explode(';', $customer_ot['order_total_allowed']); $installed_modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED); for ($n = 0; $n < sizeof($installed_modules) ; $n++) { // check to see if a order total module is not de-installed if ( in_array($installed_modules[$n], $temp_ot_array ) ) { $ot_array[] = $installed_modules[$n]; } } // end for loop $this->modules = $ot_array; } else { $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED); } } else { // default $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED); } // EOF Separate Pricing Per Customer

Top

catalog/includes/classes/payment.php

Line 4
**AFTER**

**ADD**

Line 21 [22]
**REPLACE**

**WITH**

Top

catalog/includes/classes/shipping.php

Line 4
**AFTER**

**ADD**

Line 21 [22]
**REPLACE**

**WITH**

// BOF Separate Pricing Per Customer, next line original code // $this->modules = explode(';', MODULE_SHIPPING_INSTALLED); global $customer_id; if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } $customer_shipment_query = tep_db_query("select IF(c.customers_shipment_allowed <> '', c.customers_shipment_allowed, cg.group_shipment_allowed) as shipment_allowed from " . TABLE_CUSTOMERS . " c, customers_groups cg where c.customers_id = '" . $customer_id . "' and cg.customers_group_id = '" . $customer_group_id . "'"); if ($customer_shipment = tep_db_fetch_array($customer_shipment_query) ) { if (tep_not_null($customer_shipment['shipment_allowed']) ) { $temp_shipment_array = explode(';', $customer_shipment['shipment_allowed']); $installed_modules = explode(';', MODULE_SHIPPING_INSTALLED); for ($n = 0; $n < sizeof($installed_modules) ; $n++) { // check to see if a shipping module is not de-installed if ( in_array($installed_modules[$n], $temp_shipment_array ) ) { $shipment_array[] = $installed_modules[$n]; } } // end for loop $this->modules = $shipment_array; } else { $this->modules = explode(';', MODULE_SHIPPING_INSTALLED); } } else { // default $this->modules = explode(';', MODULE_SHIPPING_INSTALLED); } // EOF Separate Pricing Per Customer

Top

catalog/includes/classes/shopping_cart.php

Line 4
**AFTER**

**ADD**

Lines 25-27 [26-28]
**AFTER** (this is in the function restore_contents)

**ADD**

Line 79 [127 in edited file] (this is in the function add_cart)
**AFTER**

**ADD**

Line 101-104 [151-155] (this piece of code was added in the August 17, 2006 update)
**REPLACE**

**WITH**

Line 252 [330] (in function calculate)
**AFTER**

**ADD**

Line 266-270 [348-352]
**REPLACE**

**WITH**

Lines 276-290 [364-378 in edited file]
**REPLACE**

**WITH**

Lines 292-309 [418-435]
**REPLACE** (replacement of the whole function)

**WITH**

Line 311-312 [479-480]
**AFTER**

**ADD**

Line 324-328 [500-504]
**REPLACE**

**WITH**

At the bottom of the file, after the function unserialize, just before the last brace "}" (which marks the end of the class) which is followed by "?>" add a new function:

Top

catalog/includes/functions/database.php

Line 4
**AFTER**

**ADD**

Lines 147-151
**AFTER**

**ADD**

Top

catalog/includes/functions/general.php

Line 4
**AFTER**

**ADD**

Line 99 [100]

**REPLACE**

**WITH**

Line 314 [322] (this is in the function tep_get_tax_rate)
**AFTER**

**ADD**

Line 325 [352]
**REPLACE**

**WITH**

Lines 341 [370] (in function tep_get_tax_description)
**REPLACE**

**WITH**

Line 358 [395] (in function tep_add_tax)
**REPLACE**

**WITH**

Line 1028-1037 [1079-1088]
**REPLACE**

**WITH**

Top

catalog/includes/languages/english/login.php

Line 4
**AFTER**

**ADD**

Line 27
**AFTER**

**ADD**

**TIP:** The above root@localhost entry should be replaced with the site Admin's email address. This enables him to log-in as a member of each group for testing purposes. This email address must be defined in the osC Admin section called Configuration.

Top

catalog/includes/languages/english.php

Line 4
**AFTER**

**ADD**

Line 164 [165]
**AFTER**

**ADD**

Top

catalog/includes/modules/new_products.php

Line 4
**AFTER**

**ADD**

Lines 21-41 [22-42]
**REPLACE**

**WITH**

Top

catalog/includes/modules/product_listing.php

Line 4
**AFTER**

**ADD**

Lines 73-77 [74-78]
**REPLACE**

**WITH**

Lines 93-133 [159-200 in edited file]
**REPLACE**

**WITH**

Top

catalog/advanced_search_result.php

Line 4
**AFTER**

**ADD**

Line 181-183 [182-184]
**AFTER**

**ADD**

Lines 207-213 [215-221]
**REPLACE**

**WITH**

Lines 291-297 [342-348]
**REPLACE**

**WITH**

Top

catalog/create_account.php

Line 4
**AFTER**

**ADD**

Line 33 [34]
**REPLACE**

**WITH**

Line 180 [186]
**AFTER**

**ADD**

Line 215-217 [232-234]
**AFTER**

**ADD**

Line 227 [258]
**AFTER**

**ADD**

Line 246 [283]
**AFTER**

**ADD**

Lines 370-371 [417-418]
**AFTER**

**ADD**

Top

catalog/account_edit.php

Line 4
**AFTER**

**ADD**

Line 88 [89 in edited file]
**AFTER**

**ADD**

Line 96 [103]
**AFTER**

**ADD**

Line 116 [130]
**REPLACE**

**WITH**

Line 227-228 [243-244]
**AFTER**

**ADD**

Top

catalog/checkout_process.php

Line 3
**AFTER**

**ADD**

Line 193 [194]
**AFTER**

**ADD**

Top

catalog/index.php

Line 4
**AFTER**

**ADD**

Line 13 [14]
**AFTER**

**ADD**

Line 142-144 [150-152]
**AFTER**

**ADD**

Lines 175-187 [211-223]
**REPLACE**

**WITH**

Top

catalog/login.php

Line 4
**AFTER**

**ADD**

Line 28 [29]
**REPLACE**

**WITH**

Line 37-39 [40-42]
**AFTER**

**ADD**

Line 46 [81]
**AFTER**

**ADD**

Line 50-51 [107-108]
**AFTER**

**ADD**

Top

catalog/logoff.php

Line 4
**AFTER**

**ADD**

Line 21 [22]
**AFTER**

**ADD**

Top

catalog/product_info.php

Line 4
**AFTER**

**ADD**

Line 19
**AFTER**

**ADD**

Lines 78-79 [86-87 in edited file]
**REPLACE**

**WITH**

Line 122 [147]
**REPLACE**

**WITH**

Line 131 [157]
**REPLACE**

**WITH**

Lines 134-140 [160-166]
**REPLACE**

**WITH**

Top

catalog/product_reviews.php

Line 4
**AFTER**

**ADD**

Line 19 [20]
**AFTER**

**ADD**

Top

catalog/product_reviews_info.php

Line 4
**AFTER**

**ADD**

Line 13 [14]
**AFTER**

**ADD**

Line 28-29 [36-37]
**AFTER**

**ADD**

Top

catalog/product_reviews_write.php

Line 4
**AFTER**

**ADD**

Lines 53-55 [54-56]
**AFTER**

**ADD**

Top

catalog/products_new.php

Line 4
**AFTER**

**ADD**

Lines 79-97 [80-98]
**REPLACE**

**WITH**

Top

catalog/specials.php

Line 4
**AFTER**

**ADD**

Lines 54 [55]
**REPLACE**

**WITH**

Lines 77-82 [88-93]
**REPLACE**

**WITH**

Top

The next section deals with code in the admin section that enables you to send notifications and newsletters to specific customer groups. It was added to version 4.2 of SPPC for the first time (although the same instructions were uploaded to the contributions section of the osC site as "Mail functions for SPPC 4.2.0 rev1" on July 1, 2007). Since it is not essential to the operation of the shop you can install this later (or not at all if you do not have a need for it).

BOF SECTION OPTIONAL TO INSTALL (OR DONE LATER)

catalog/admin/includes/languages/english/mail.php

Line 3
**AFTER**

**ADD**

Line 23
**AFTER**

**ADD**

Top

catalog/admin/includes/languages/english/newsletters.php

Line 3
**AFTER**

**ADD**

Line 38 [39]
**AFTER**

**ADD**

Top

catalog/admin/mail.php

Line 3
**AFTER**

**ADD**

Line 13 [14]
**AFTER**

**ADD**

Line 19-25 [27-33 in edited file]
**REPLACE**

**WITH**

Line 94-98 [116-120]
**REPLACE**

**WITH**

Line 166 [200]
**REPLACE**

**WITH**

Top

catalog/admin/newsletters.php

Line 3
**AFTER**

**ADD**

Line 13 [14]
**AFTER**

**ADD**

Line 18 [28]
**AFTER**

**ADD**

Line 41 [68]
**REPLACE**

**WITH**

Line 135-137 [162-164]
**REPLACE**

**WITH**

Line 146 [176]
**REPLACE**

**WITH**

Line 229 [243] (this is a few lines after " } elseif ($action == 'preview') {")
**REPLACE**

**WITH**

Line 211 [262] (this is a few lines after " } elseif ($action == 'send') { ")
**REPLACE**

**WITH**

Line 237 [273]
**REPLACE**

**WITH**

Line 246 [284] (this is a few lines after " } elseif ($action == 'confirm') { ")
**REPLACE**

**WITH**

Line 254 [294]
**REPLACE**

**WITH**

Line 263 [305]
**REPLACE** (this is a few lines after " } elseif ($action == 'confirm_send') { ")

**WITH**

Line 271 [315]
**REPLACE**

**WITH**

Line 284 [330]
**REPLACE**

**WITH**

Line 314 [362]
**REPLACE**

**WITH**

Line 363-365 [413-415]
**AFTER**

**ADD**

Line 372-373 [444-445]
**AFTER**

**ADD**

Top

catalog/admin/includes/modules/newsletters/newsletter.php

Line 4
**AFTER**

**ADD**

Lines 16-20 [17-21]
**REPLACE**

**WITH**

Line 29 [33]
**REPLACE**

**WITH**

Line 59-60 [69-70]
**REPLACE**

**WITH**

Top

catalog/admin/includes/modules/newsletters/product_notification.php

Line 4
**AFTER**

**ADD**

Line 164-195 [165-196]
**REPLACE**

**WITH**

Top

EOF SECTION OPTIONAL TO INSTALL (OR DONE LATER)

@@!@@!@@!@@!@@ Congrats!! - You Made it to the End @@!@@!@@!@@!@@