2007/12/27
Printable Price List 1.5.0 readme by Paul Mathot
Released under the GPL licence version 2 (see included LICENSE.TXT)

/****************************************************************************/
// Introduction
/****************************************************************************/
Please make a note of the version number at install. The version numbers and dates of most files are outdated (sorry no time to fix this). 

Also when you think this contribution conflicts with other contributions (which is *very* unlikely BTW), do post the download url of the other contribution together with the description of the issue you experience. Also a link where we can view the issue often is very helpfull. Without this information support takes way too much time.

The original purpose of this contribution was to make it easy to create printable price lists (nicely fitting the paper, without using PDF, pure HTML/CSS based).

Donations: http://www.beterelektro.nl/zen-cart/index.php?page=donations
(It really helps me to continue and improve support :-) )

Currently it (optionally) prints a lot more than prices only (weight, stock, modelnr etc. etc.).

/****************************************************************************/
// Support
/****************************************************************************/

Archived zen-cart support thread: http://www.zen-cart.com/forum/showthread.php?t=4014

New support thread: http://www.zen-cart.com/forum/showthread.php?t=49126

/****************************************************************************/
// installation
/****************************************************************************/

!BACKUP*BACKUP*BACKUP*BACKUP*BACKUP*BACKUP*BACKUP*BACKUP*BACKUP*BACKUP*BACKUP!

1) Backup your database & files.

2) load pricelist-3.sql (includes three profiles) to your zen-cart database
(to uninstall use pricelist_remove.sql)

Use the zen sql tool (admin=> Tools :: Install SQL Patches) to load the sql (copy and paste into the text area, do NOT use the file upload feature!).
In rare cases the tool does not work, use phpMyAdmin in those cases (think about adding the table prefix if needed).

3) Copy all files in the included zen-cart directory to your zencart directory.

4) Optionally create a link to the price list
(if the price list is only for your own usage there is no need for a link, the price list will be available then at index.php?main_page=pricelist)

Two ways to add a link to the price list:

a) Use EZ-pages

 Open New Window: yes (recommended? since the price list usually is not really integrated)
 Internal Link URL: index.php?main_page=pricelist

Or (skip this, and go to step 5 now if using the EZ-pages link):

b)
Define CATEGORIES_BOX_HEADING_PRICELIST to define the text for the link:

Add:

define('CATEGORIES_BOX_HEADING_PRICELIST', 'Price list');

to your language file(s) (i.e. english.php)

And:

    echo '<br /><a href="' . zen_href_link(FILENAME_PRICELIST) . '">' . CATEGORIES_BOX_HEADING_PRICELIST . '</a>';

to one of the the template files (depending on where you want the link to show up).


5) You're ready!

You might also want to read the "what's new" section below.

/****************************************************************************/
// Usage and Configuration
/****************************************************************************/

The pricelist settings should be available at the bottom of your "admin::configuration" screen now.
There is a main Price-list setting and there are several Price-list profile settings.
(If the admin DHTML menu does not show all the profiles, click on "configuration" at the top to use the alternative menu.)

The price-list shows up after you click the link you created (see installation 3b) or by browsing:
http://www.yourdomain.we/zen-cart/index.php?main_page=pricelist

The alternative pricelists (profiles) are displayed by clicking the links (for profiles enabled through admin)
or by adding profile="x" to the url (for enabled an disabled profiles), i.e.:
http://www.yourdomain.we/zen-cart/index.php?main_page=pricelist&profile=3

/****************************************************************************/
// credits
/****************************************************************************/

To:
*) Rinalds Uzkalns (a small part of the code is still based on his osc list)
*) Developement: Carine Bruyndoncx (osC) & Paul Mathot (osC&zen)
*) Hubert and Vartan Kat for the "add to cart" buttons code

/****************************************************************************/
// What's new
/****************************************************************************/
######################################
# price-list v1.5.0 2007/12/20       #
######################################
1) Added "Printable page height setting" setting to admin
(Removed height setting from stylesheet file, added as in document style now depending on admin setting)
If every second page printed is blank this usually means you need to lower this value (depends on your paper size and margins etc).

2) Added "Category tree main cats only" feature setting
Depending on this setting the category dropdown will show main the cats only, or the whole category tree.
So now you can print all products in a main category + its subcats (like in older versions of the pricelist) OR all products in a subcategory.  

3) Added "Specials" switch to admin
Now it's possible to switch of the Specials display. This will reduce the amount of queries dramaticly (4 queries per product less)

4) Added "Specials expiry" switch to admin

5) Added "Truncate descriptions" feature + admin config

+Lots of other changes

######################################
# price-list v1.43 2007/12/12        #
######################################
1) Several code changes in header_php.php file (optimized a bit)
2) Moved some pricelist template files from YOUR_TEMPLATE/ to template_default/ (should make fresh installs even easer than before)
3) Added imgPL class to products images
4) Added code to optionally use the master_categories_id (i.s.o. the linked cats). New admin setting: "Use master cats only" (PL_USE_MASTER_CATS_ONLY)
5) Added option to switch on/off price display New admin setting: "Price" (PL_SHOW_PRICE)
6) Improvement of the specials display if no valid date is found (also added a TEXT_PL_SPECIAL definition to the language file for specials without valid expiry date)
7) Modified sql install file to work around sql patch tool oddities (this change should prevent false duplicate key errors)
8) Added some basic debug stuff into the main_page file (only shown when debug is enabled, and even then it will not be printed on paper)
 
######################################
# price-list v1.42 2007/10/04        #
######################################

Added missing file:
/includes/init_includes/init_zen_group.php
(adding this file should fix the group feature)

Minor change to /includes/extra_functions/group_functions.php which may fix the group function issue with older (1.2.x) Zen Cart versions.

Another minor change to header_php.php to fix a TABLE_HEADING_ADDTOCART bug

######################################
# price-list v1.41 2007/07/19        #
######################################

Minor fix in pricelist-3.sql patch file (to prevent install error on some MySQL versions/configurations when using the Zen SQL patch tool).

######################################
# price-list v1.4 2007/07/18         #
######################################
1) Made a small change to the sql (which might fix a possible column count error message at install when using the Zen SQL patch tool)

2) Fixed a minor bug (in tpl_main_page.php), now the selected profile should always be remembered when switching categories

3) Added random images floats (left/right) logic for nicer catalogue prints

Also added css to profile-3.css (edit it to control the image floats):

.imgDescrRndPL_3 img, .imgDescrRndPL_4 img {
float: left;
}
.imgDescrRndPL_1 img, .imgDescrRndPL_2 img{
float: right;
}

4) Added code for add to cart buttons (commented: //Added by Vartan Kat on july 2007 for Add to cart button), credits for this should go to Hubert and Vartan Kat

######################################
# price-list v1.3.6 2007/06/04       #
######################################
Several changes, some of which are:

1) Added basic functionality to print descriptions and images (height and width setting in pricelist admin profile settings)
2) Added group functionality. Uses zen the groups (group names) to allow disallow access to the pricelist. Set in pricelist admin profile settings.


######################################
# price-list v1.2 2006/10/20         #
######################################
Made several code changes (trying to clean up some mess ;-) ).

Removed the need to overwrite or edit the currencies class.

Merged several files into one. For easier layout edits (I hope).
Header, footer and body all moved to tpl_main_page.php

Some small changes to the stylesheet

######################################
# price-list v1.1.1 2006/09/19:      #
######################################

Updated the readme: a.o. added EZ-pages note.

######################################
# price-list v1.1 2006/06/16:        #
######################################

1) Solved issue i.c.w. phpBB integration on Zen cart 1.3.x

changed:

mysql_query($query)

to:

mysql_query($query, $db->link)
(and made $db global where needed)

This is just a quickfix, actually several parts of the code should be rewritten.

2) Made a small modification to the included currencies.php file (which makes it 1.3.0.1 compatible).

######################################
# price-list v1.09 2006/03/22:       #
######################################

Removed the last error (I know I have said this before ;-) ), from the installation sql file.
(MySQL 5 compatibility)

In no_prefix_pricelist-3.sql changed:
# Profile 3

INSERT INTO `configuration_group` VALUES ('', 'Price-list Profile-3', 'Settings for printable price-list profile-3.', @sortorder+4, 1);

to:
# Profile 3

INSERT INTO `configuration_group` VALUES (NULL, 'Price-list Profile-3', 'Settings for printable price-list profile-3.', @sortorder+4, 1);



######################################
# price-list v1.07 2006/03/02:       #
######################################

Updated the included sql files to better follow the (un)documented Zen sql syntax.

And added a small fix by pixxi (inludes/modules/pages/pricelist/header_php.php)
To hide disabled categories in the drop down menu

http://www.zen-cart.com/modules/ipb/index.php?showtopic=5405&st=255

######################################
# price-list v1.05 2005/09/08:       #
######################################

Cleaned up templates directory and renamed template dir to YOUR_TEMPLATE to hopefully better follow the zen-cart template structure.
Changed this readme accordingly.

######################################
# price-list v1.04 2005/09/06:       #
######################################

1) fixed sort desc bug (before only sorting ascending worked)
2) updated currencies.php file from zen v1.2.5 to v1.2.6
3) Thanks to hareslade:

modded the code in function show_products to go get the correct product type (e.g. document... )
handler so the price list product links show the correct
style/ layout for the product in the cart when a price-list link is used

4) some other small changes (mainly preps for next version)


######################################
# price-list v1.03 2004/11/22:       #
######################################

Fixed register globals currencies bug.

Thanks to duwane

######################################
# price-list v1.02 2004/11/19:       #
######################################

1) IanEtche provided the SQL to  add a switch to the admin, to enable/disable the price-list link in the categories box.

This is the code for the link itself, you can add it to your tpl_categories.php file, or to another file depending on where you want the link to show up.
An example tpl_categories.php file is included, only use it if you like it, else create your own link to the price-list somehow.
[code]

  if (SHOW_CATEGORIES_BOX_PRICELIST == 'true') {
    $content .= '<br /><a href="' . zen_href_link(FILENAME_PRICELIST) . '">' . CATEGORIES_BOX_HEADING_PRICELIST . '</a>';
  }
[/code]

2) This version should be compatible with both regiter globals on and register globals off
If your are updating, the required code changes are in "includes/modules/pages/pricelist/header_php.php".
You can replace the file, or read the support thread there are two simple fixes for register globels posted at the support thread.

3) Added Stock On Hand

bmoroney mailed me instructions needed to add the stock, and since I was updating anyway I decided to add it.
Thanks bmoroney! Great additon!

######################################
# price-list v1.01 2004/08/20:       #
######################################

1) made some changes to make the price-list work with v1.2 as described in the support thread

2) replaced the top header text by the logo, changed header "Price-list for printing" text from <h1> to <h3> and removed the link.

3) enabled the active/inactive categories for zen v1.2 jippieee!

for older zen versions you might try this:
search the files for:
  define('PL_ENABLE_CAT_FILTER', TRUE);
 and change it to:
  define('PL_ENABLE_CAT_FILTER', FALSE);

3) updated this readme

######################################
# price-list v1.00                   #
######################################

Nothing new, since it's the first public z.c. version :D

/****************************************************************************/
// notes
/****************************************************************************/

-Some special pricing features are not supported well

-Prices are shown the same to all customers (Customer Authorization does not work on the price list)

-The price list is build on very old rusty code

-If your database contains a lot of products (how many??) you might encounter PHP memory or timeout problems
setting "All Categories Default" to false in admin might help then.

/****************************************************************************/
// removal
/****************************************************************************/

Just in case you don't like or need this script after all:

1) remove all added files
2) put back the original currencies.php file
3) run the pricelist_remove.sql (i.e. using phpMyAdmin) see sql-files dir

/****************************************************************************/
// end
/****************************************************************************/

I hope you find this mod usefull!