If this is your first visit, check our documentation. To post, register or login.
Forums / All Other Contributions/Addons / Pricelist For Printing

Pricelist For Printing

Locked

Started by paulm on 8 Jun 2004, 10:44 PM · Views: 48,373

Results 121 to 140 of 326
This thread is locked. New replies are disabled.
16 Mar 2005, 2:29 PM
#121
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Pricelist For Printing

Danny_:

Is there a way to prohibit access to the pricelist for not-logged in users?Should not be difficult to implement

Originally posted by Danny_@Mar 16 2005, 12:30 PM
**Or not show the link to not-logged in users?**Should be very easy to implement (but will be very insecure of course)

Danny_:

I realize my question has actually nothing to do with this contrib.No problem, and if the feature to hide the prices is a standard zen-cart feature (which I assume it is) it really should be integrated into the price-list too.

The main problem is that I still don't use zen-cart myself ::bsh but I will take a look.

16 Mar 2005, 2:39 PM
#122
danny avatar

danny

New Zenner

Join Date:
Nov 2010
Posts:
3
Plugin Contributions:
0

Re: Pricelist For Printing

Thanks for the fast response.

If I can do anything to help (except coding :blink: )
let me know

Danny

16 Mar 2005, 4:33 PM
#123
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Pricelist For Printing

Just found the definition:

CUSTOMERS_AUTHORIZATION_PRICES_OFF array(\'true\', \'false\')
```this is controlled through the admin, if 'true' prices are hidden for not registered (=> not logged in) users I suppose
16 Mar 2005, 8:58 PM
#124
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Pricelist For Printing

Hi Danny,

to hide the prices you can try this:

edit includes/classes/currencies.php, change (line 126 to 130):

  function display_price_nosymbol($products_price, $products_tax, $quantity = 1) {
     if (CUSTOMERS_AUTHORIZATION_PRICES_OFF == 'true')   
    if ($products_price == 0) return TEXT_PL_PRODUCT_HAS_NO_PRICE; // to not show 0, but replacement text (can still put 0.00 in defined text for backwards compatibility)
   return $this->format((zen_add_tax($products_price, $products_tax) * $quantity), true, '','',false);
  }

to:

  function display_price_nosymbol($products_price, $products_tax, $quantity = 1) {
     if (CUSTOMERS_AUTHORIZATION_PRICES_OFF == 'true') return TEXT_PL_CUSTOMERS_AUTHORIZATION_PRICES_OFF; // hide prices for unauthorized users  
    if ($products_price == 0) return TEXT_PL_PRODUCT_HAS_NO_PRICE; // to not show 0, but replacement text (can still put 0.00 in defined text for backwards compatibility)
   return $this->format((zen_add_tax($products_price, $products_tax) * $quantity), true, '','',false);
  }
```(adding: if (CUSTOMERS_AUTHORIZATION_PRICES_OFF == 'true') return  TEXT_PL_CUSTOMERS_AUTHORIZATION_PRICES_OFF; // hide prices for unauthorized users )

If it works like it should TEXT_PL_CUSTOMERS_AUTHORIZATION_PRICES_OFF should also be defined in languages/your_language/pricelist.php
16 Mar 2005, 10:07 PM
#125
danny avatar

danny

New Zenner

Join Date:
Nov 2010
Posts:
3
Plugin Contributions:
0

Re: Pricelist For Printing

Hi Paul,

I tested your code rightaway, and I'm sorry but its not working properly. I first pasted the code as you wrote it and I was still able to view the prices logged out and logged in.
after that I changed True to False and now it displayed the text I defined. logged out but also logged in.

I was thinking - this has nothing to do with the default currency set to Euro's right?

Thanks again for looking in to this

Danny

16 Mar 2005, 10:11 PM
#126
jeff_fwd avatar

jeff_fwd

Totally Zenned

Join Date:
Jun 2003
Location:
CA
Posts:
212
Plugin Contributions:
0

Re: Pricelist For Printing

this is just a guess, but someone can run with it and try it...

if you are using authrorization for customers to see prices, then you would want to check the value of authrorization and construct an IF statement for the display of the price list link in the side box

if authorization is true, then display the link in the sidebox

if authorization is false, then do not display the link in the sidebox

16 Mar 2005, 10:53 PM
#127
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Pricelist For Printing

You are both right of course, I mixed up the setting and the registered check :rolleyes:

So it should be like this i think: if CUSTOMERS_AUTHORIZATION_PRICES_OFF is 'true' (or would that be false? :) ) check if the customer is not logged in and if so, return the TEXT

Maybe a bit confusing because the negative logic, but it seems the easyest hack to make it work right now.

It's also posible to hide the whole list of course, but I think it's better for SE's not to hide it. On the other hand, if you have thousands of products you might want to hide it after all to reduce server load.

16 Mar 2005, 11:56 PM
#128
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Pricelist For Printing

It becomes a bit confusing. Besides CUSTOMERS_AUTHORIZATION_PRICES_OFF (some admin setting) I do also see a CUSTOMERS_APPROVAL . I'm not sure what to check on at the moment.

It would be nice if someone could help me out on which variable and/or definition I should check before the price is shown or hidden.

A team member maybe? It would save me a lot of time :)

30 Mar 2005, 10:42 PM
#129
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Pricelist For Printing

Tested with zen-cart version 1.2.4.1 ::tup

@Danny: sorry I haven't been able to find out which var or condition I need to check to hide the prices, I asked around, but probably my questions weren't clear enough or something :(

If anyone else knows the condition on which prices could (or should) be hidden, I might give it another try.

On the other hand, the more I think about it, I'm more convinced it should be a admin/shopowner only tool (even (re)moved it from my site). And if I would have made it an admin tool right away, the impementation would have been a lot easyer too :rolleyes:

31 Mar 2005, 3:29 AM
#130
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Pricelist For Printing

There will be the new function in v1.2.5 for: zen_run_normal()

When it returns 'true' show prices ... if 'false' don't show prices.

This is a generic run normal test.

I may be adding one more function specific to prices as a few of the settings allow you to see prices, but not shop.

Both will be in the functions_lookup.php file.

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

31 Mar 2005, 9:29 PM
#131
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Pricelist For Printing

Hi Ajeh,

that will probably make it easyer then. Actually I was hoping to find out how it should be done at this moment, but on the other hand, just wait for the v1.2.5 zen_run_normal() function might be best after all.

thanks! (again, now I remember you posted it before, but I couldn't find it anymore :) )

10 Apr 2005, 8:32 PM
#132
vdub avatar

vdub

New Zenner

Join Date:
Jan 2005
Posts:
72
Plugin Contributions:
0

Re: Pricelist For Printing

A big thankyou for this contribution, I had been looking for something to print of a store inventory, and this is ideal.

I had a few problems installing all caused by myself, but I got it up and running in around an hour. ::tup

Now how easy would it to have the TAX rate used on each product next to the inc exc prices

16 Apr 2005, 12:17 PM
#133
vdub avatar

vdub

New Zenner

Join Date:
Jan 2005
Posts:
72
Plugin Contributions:
0

Re: Pricelist For Printing

Ive been playing around with the header_php.php in pages/pricelist
to try and list the TAX rate allocated to each product.

I have managed to set it up to show the addition coloum but seem to only be able to display the Value of the Database tax class id

$products_price_tax = $currencies->display_price_nosymbol($cats[$cat_index][$prod_index]['products_tax_class_id']);

The code above shows the tax_class_id, if i change it to tax_rates or similar the price list page just shows --.--

Can anyone offer any help on this one

16 Apr 2005, 12:45 PM
#134
vdub avatar

vdub

New Zenner

Join Date:
Jan 2005
Posts:
72
Plugin Contributions:
0

Re: Pricelist For Printing

after a little more poking around, i think i need to link the Tax_rate table into the code, maybe in here somewhere

 $query = 'SELECT p.products_id, p.products_quantity, p.products_model, p.products_price, p.products_status, p.products_tax_class_id, p.manufacturers_id, pd.products_name, pc.categories_id, p.products_weight ';
  
  $query .= ' FROM ' . TABLE_PRODUCTS . ' p LEFT JOIN ' . TABLE_PRODUCTS_DESCRIPTION . ' pd USING(products_id) LEFT JOIN ' . TABLE_PRODUCTS_TO_CATEGORIES . ' pc USING(products_id) LEFT JOIN ' . TABLE_CATEGORIES . ' c USING(categories_id) WHERE pd.language_id="' . PL_LANG_ID . '" AND c.categories_id="' . $id . '"' . PL_SHOW_PROD_INACTIVE . PL_SHOW_CAT_INACTIVE;
16 Apr 2005, 2:09 PM
#135
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Pricelist For Printing

Hi vdub,

the easyest way to find out how to add an extra data column to the list would probably be to search the file "zen-cart\includes\modules\pages\pricelist\header_php.php"
for > // stock by bmoroney
A while ago bmoroney mailed me the changes to add the stock to the price-list. I applied those changes, and marked every change with the "// stock by bmoroney" comment. In the same way it must be possible to add other data, like the tax rate for example.

I'm not sure about the best way to fetch tax rate itself, the tax rate data is already available (must be, because the inc-tax prices are). Normally the zen_get_tax_rate() function is being used for this, so I guess you can use it to get the tax rate itself too.

17 Apr 2005, 12:47 PM
#136
vdub avatar

vdub

New Zenner

Join Date:
Jan 2005
Posts:
72
Plugin Contributions:
0

Re: Pricelist For Printing

thanks paulm

I seem to have this sorted now, if anyone else needs to add a column which shows the tax rate used for each item may find this useful.

I have set up zencart to sell products in the UK which have different tax rates. I found it to be a pain checking which products i had applied the different Tax rate to. I installed the price_list mod which is excellent except no column showing which Tax rate was applied to each product.

I first went into phpMyAdmin and added to the end of the CONFIGURATION table a new entry

[CODE]
configuration_title

17 Apr 2005, 1:41 PM
#137
vdub avatar

vdub

New Zenner

Join Date:
Jan 2005
Posts:
72
Plugin Contributions:
0

Re: Pricelist For Printing

...... I carnt see how to edit my above post so I am carrying on here

PLEASE BE AWARE ALTHOUGH THIS WORKED OKAY FOR ME MAKE SURE YOU BACKUP ALL FILES FIRST

in phpMyAdmin

**configuration_id (if you have auto increment this will already be entered else next available number)
configuration_title Vat Rate
configuration_key PL_SHOW_TAX_RATE_1
configuration_value true
configuration_description Shows tax rate used
configuration_group_id (make this the same group id as that used for profile 1)
sort_order 210
last_modified 2005-04-17 14:06:17
date_added 2005-04-17 14:06:17
use_function NULL
set_function zen_cfg_select_option(array('true','false'),
**

In Includes > languages > english > price_list.php
add at around line 28

define('TABLE_HEADING_TAX', 'Tax Rate ');

In Includes > modules > pages > price list > pricelist_php

**find

eval('$pl_profile = PL_SHOW_TAX_FREE_' . PL_PROFILE . ';');
define('PL_SHOW_TAX_FREE', $pl_profile);

//then I added the following 2 lines below
eval('$pl_profile = PL_SHOW_TAX_RATE_' . PL_PROFILE . ';');
define('PL_SHOW_TAX_RATE', $pl_profile);
**
**find

$colspan = 2;
if (PL_SHOW_TAX_FREE == 'true') {
$colspan++;
}
//then I added the following 3 lines below
if (PL_SHOW_TAX_RATE == 'true') {
$colspan++;
}
**
**find

if (PL_SHOW_TAX_FREE == 'true') {
$columnsHeader .= '<td class="prcPL">' . TABLE_HEADING_PRICE_EX . PL_CURR_SYMBOL . '</td>' . "\n";
}
// then I added the 3 lines below
if (PL_SHOW_TAX_RATE == 'true') {
$columnsHeader .= '<td class="prcPL">' . TABLE_HEADING_TAX . '</td>' . "\n";
}
**
**find

/*EoF Customer discount hack 2/2 */

  $products_price_inc = $currencies->display_price_nosymbol($cats[$cat_index][$prod_index]['products_price'], zen_get_tax_rate($cats[$cat_index][$prod_index]['products_tax_class_id']));
  $products_price_ex = $currencies->display_price_nosymbol($cats[$cat_index][$prod_index]['products_price'], 0);

// then added the 1 line below
$products_price_tax = zen_get_tax_rate($cats[$cat_index][$prod_index]['products_tax_class_id']);

**

**find

$prodRow .= '<td class="' . $price_class . '">' . $products_price_inc . '</td>' . "\n";
if (PL_SHOW_TAX_FREE == 'true') {
$prodRow .= '<td class="' . $price_class . '">' . $products_price_ex . '</td>' . "\n";
}
// the I added 3 lines below
if (PL_SHOW_TAX_RATE == 'true') {
$prodRow .= '<td class="prcPL">' . $products_price_tax . '</td>' . "\n";
}
**

**find

if ($special_price_ex > 0) {
$colspan = ((int)PL_COLSPAN - 1);
if (PL_SHOW_TAX_FREE == 'true') {
$colspan--;
}
// then I added 3 lines below
if (PL_SHOW_TAX_RATE == 'true') {
$colspan--;
} **

**find

$pl_options .= 'showTaxFree = ' . PL_SHOW_TAX_FREE . ' :: ';

// then added 1 line below
$pl_options .= 'showTaxRate = ' . PL_SHOW_TAX_RATE . ' :: ';**

17 Apr 2005, 2:13 PM
#138
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Pricelist For Printing

Your modifications sounds interesting but adding the ' find ' word into your quotes might lead Zen Cart users into a mess for mount of quotes.

I'd suggest removing the ' find ' word from each of them snd put it ' outside ' your quotes (right on top for example). ;)

17 Apr 2005, 5:25 PM
#139
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Pricelist For Printing

Hi vdub,

thanks for posting this, it indeed might help others to add tax or whatever other data to the pricelist.

Just one note about this part:```

<td class="prcPL"> ```At a certain moment I had the, not so great, idea to shorten the CSS class names (to safe some bandwith). That's why it probably is not so clear that "prc" in "prcPL" stands for "price", so it's the CSS class for the prices table cells. To assign it's own CSS class to the taxrate cells you could consider naming it "taxratePL" instead for example (and add styles to the stylesheet for "taxratePL" if needed).
25 Apr 2005, 12:41 AM
#140
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Pricelist For Printing

Is there another SQL I am suppose to use or what's the problem with SQL pasted below. I am getting error when I try to install in the database.

#Printable Price-list database settings
# 2004/11/19


SELECT @sortorder:=max(sort_order) from configuration_group;

# Main Price-list settings
INSERT INTO `configuration_group` VALUES ('', 'Printable Price-list', 'The main options for the printable price-list module are stored here.', @sortorder+1, 1);
SELECT @pricelistid:=max(configuration_group_id) from configuration_group;

select @pricelistid;

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Default Profile', 'PL_DEFAULT_PROFILE', '1', 'Choose the default profile to use.', @pricelistid , 10, NULL , 'zen_cfg_select_option(array(\'1\', \'2\', \'3\' ),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function )
VALUES ( '', 'Show Profiles', 'PL_SHOW_PROFILES', 'true', 'If true available enabled profiles are shown', @pricelistid , 20, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

# Profiles

# Profile 1

INSERT INTO `configuration_group` VALUES ('', 'Price-list Profile-1', 'Settings for printable price-list profile-1.', @sortorder+2, 1);
SELECT @pricelistid:=max(configuration_group_id) from configuration_group;

select @pricelistid;

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Enable', 'PL_ENABLE_1', 'true', 'If enabled a link will be shown to this profile', @pricelistid , 10, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Profile Name', 'PL_PROFILE_NAME_1', 'A4 portrait', 'Give this profile a name', @pricelistid , 20, NULL , NULL );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Stylesheet', 'PL_PRINTING_STYLESHEET_1', 'a4-portrait', 'Choose the default printing stylesheet to use. If set to "profile-x", i.e. "profile-2.css" is loaded for profile-2', @pricelistid , 30, NULL , 'zen_cfg_select_option(array(\'a4-portrait\', \'a4-landscape\', \'profile-x\' ),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Main Cats New Page', 'PL_MAINCATS_NEW_PAGE_1', 'true', 'If true main categories always start on a new page (also forces new table)', @pricelistid , 40, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Main Cats New Table', 'PL_MAINCATS_NEW_TABLE_1', 'true', 'If true main categories always start a new table (false is ignored if maincats start new pages)', @pricelistid , 50, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'No Wrap', 'PL_NOWRAP_1', 'false', 'To enable or disable wrapping on screen (nowrap is easyer for debugging)', @pricelistid , 60, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Max Columns', 'PL_MAXCOLUMNS_1', '2', 'Maximum number of columns to show per page', @pricelistid , 70, NULL , NULL );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Max Rows', 'PL_MAXLINES_1', '36', 'Maximum number of rows that can be printed on one page', @pricelistid , 80, NULL , NULL );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Tax Free', 'PL_SHOW_TAX_FREE_1', 'false', 'To show taxfree price in additional column', @pricelistid , 90, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Model', 'PL_SHOW_MODEL_1', 'true', 'To show model in additional column', @pricelistid , 100, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Manufacturer', 'PL_SHOW_MANUFACTURER_1', 'false', 'To show the manufacturer', @pricelistid , 110, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Weight', 'PL_SHOW_WEIGHT_1', 'false', 'Show the weight', @pricelistid , 120, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function )
VALUES ( '', 'Stock On Hand', 'PL_SHOW_SOH_1', 'true', 'Show the Stock on Hand', @pricelistid , 125, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Notes (A)', 'PL_SHOW_NOTES_A_1', 'false', 'Creates an empty comment field, i.e. to make notes on your pricelist.', @pricelistid , 130, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Notes (B)', 'PL_SHOW_NOTES_B_1', 'false', 'Creates another empty comment field, i.e. to make notes on your pricelist.', @pricelistid , 140, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Show Inactive', 'PL_SHOW_INACTIVE_1', 'false', 'To show inactive products and categories', @pricelistid , 150, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Sort By', 'PL_SORT_PRODUCTS_BY_1', 'products_name', 'How products are sorted within a category', @pricelistid , 160, NULL , 'zen_cfg_select_option(array(\'products_name\', \'products_price\', \'products_model\' ),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Asc Desc', 'PL_SORT_ASC_DESC_1', 'asc', 'Sort ascending or descending', @pricelistid , 170, NULL , 'zen_cfg_select_option(array(\'asc\', \'desc\' ),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'All Categories default', 'PL_DEFAULT_SHOW_ALL_CATS_1', 'true', 'If true all catgories are shown by default, for large shops you might want to set this to false (to reduce memory usage).', @pricelistid , 180, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Boxes', 'PL_SHOW_BOXES_1', 'true', 'If true boxes are shown (to switch languages, currencies etc).', @pricelistid , 190, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Debug', 'PL_DEBUG_1', 'false', 'If true debug info is shown', @pricelistid , 200, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

# Profile 2

INSERT INTO `configuration_group` VALUES ('', 'Price-list Profile-2', 'Settings for printable price-list profile-2.', @sortorder+3, 1);
SELECT @pricelistid:=max(configuration_group_id) from configuration_group;

select @pricelistid;

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Enable', 'PL_ENABLE_2', 'true', 'If enabled a link will be shown to this profile', @pricelistid , 10, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Profile Name', 'PL_PROFILE_NAME_2', 'A4 landscape', 'Give this profile a name', @pricelistid , 20, NULL , NULL );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Stylesheet', 'PL_PRINTING_STYLESHEET_2', 'a4-landscape', 'Choose the default printing stylesheet to use. If set to "profile-x", i.e. "profile-2.css" is loaded for profile-2', @pricelistid , 30, NULL , 'zen_cfg_select_option(array(\'a4-portrait\', \'a4-landscape\', \'profile-x\' ),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Main Cats New Page', 'PL_MAINCATS_NEW_PAGE_2', 'true', 'If true main categories always start on a new page (also forces new table)', @pricelistid , 40, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Main Cats New Table', 'PL_MAINCATS_NEW_TABLE_2', 'true', 'If true main categories always start a new table (false is ignored if maincats start new pages)', @pricelistid , 50, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'No Wrap', 'PL_NOWRAP_2', 'false', 'To enable or disable wrapping on screen (nowrap is easyer for debugging)', @pricelistid , 60, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Max Columns', 'PL_MAXCOLUMNS_2', '3', 'Maximum number of columns to show per page', @pricelistid , 70, NULL , NULL );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Max Rows', 'PL_MAXLINES_2', '25', 'Maximum number of rows that can be printed on one page', @pricelistid , 80, NULL , NULL );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Tax Free', 'PL_SHOW_TAX_FREE_2', 'false', 'To show taxfree price in additional column', @pricelistid , 90, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Model', 'PL_SHOW_MODEL_2', 'true', 'To show model in additional column', @pricelistid , 100, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Manufacturer', 'PL_SHOW_MANUFACTURER_2', 'false', 'To show the manufacturer', @pricelistid , 110, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Weight', 'PL_SHOW_WEIGHT_2', 'false', 'Show the weight', @pricelistid , 120, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function )
VALUES ( '', 'Stock On Hand', 'PL_SHOW_SOH_2', 'true', 'Show the Stock on Hand', @pricelistid , 125, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Notes (A)', 'PL_SHOW_NOTES_A_2', 'false', 'Creates an empty comment field, i.e. to make notes on your pricelist.', @pricelistid , 130, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Notes (B)', 'PL_SHOW_NOTES_B_2', 'false', 'Creates another empty comment field, i.e. to make notes on your pricelist.', @pricelistid , 140, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Show Inactive', 'PL_SHOW_INACTIVE_2', 'false', 'To show inactive products and categories', @pricelistid , 150, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Sort By', 'PL_SORT_PRODUCTS_BY_2', 'products_name', 'How products are sorted within a category', @pricelistid , 160, NULL , 'zen_cfg_select_option(array(\'products_name\', \'products_price\', \'products_model\' ),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Asc Desc', 'PL_SORT_ASC_DESC_2', 'asc', 'Sort ascending or descending', @pricelistid , 170, NULL , 'zen_cfg_select_option(array(\'asc\', \'desc\' ),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'All Categories default', 'PL_DEFAULT_SHOW_ALL_CATS_2', 'true', 'If true all catgories are shown by default, for large shops you might want to set this to false (to reduce memory usage).', @pricelistid , 180, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Boxes', 'PL_SHOW_BOXES_2', 'false', 'If true boxes are shown (to switch languages, currencies etc).', @pricelistid , 190, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Debug', 'PL_DEBUG_2', 'false', 'If true debug info is shown', @pricelistid , 200, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

# Profile 3

INSERT INTO `configuration_group` VALUES ('', 'Price-list Profile-3', 'Settings for printable price-list profile-3.', @sortorder+4, 1);
SELECT @pricelistid:=max(configuration_group_id) from configuration_group;

select @pricelistid;

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Enable', 'PL_ENABLE_3', 'false', 'If enabled a link will be shown to this profile', @pricelistid , 10, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Profile Name', 'PL_PROFILE_NAME_3', 'Testing', 'Give this profile a name', @pricelistid , 20, NULL , NULL );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Stylesheet', 'PL_PRINTING_STYLESHEET_3', 'profile-x', 'Choose the default printing stylesheet to use. If set to "profile-x", i.e. "profile-3.css" is loaded for profile-3', @pricelistid , 30, NULL , 'zen_cfg_select_option(array(\'a4-portrait\', \'a4-landscape\', \'profile-x\' ),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Main Cats New Page', 'PL_MAINCATS_NEW_PAGE_3', 'true', 'If true main categories always start on a new page (also forces new table)', @pricelistid , 40, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Main Cats New Table', 'PL_MAINCATS_NEW_TABLE_3', 'true', 'If true main categories always start a new table (false is ignored if maincats start new pages)', @pricelistid , 50, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'No Wrap', 'PL_NOWRAP_3', 'true', 'To enable or disable wrapping on screen (nowrap is easyer for debugging)', @pricelistid , 60, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Max Columns', 'PL_MAXCOLUMNS_3', '2', 'Maximum number of columns to show per page', @pricelistid , 70, NULL , NULL );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Max Rows', 'PL_MAXLINES_3', '20', 'Maximum number of rows that can be printed on one page', @pricelistid , 80, NULL , NULL );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Tax Free', 'PL_SHOW_TAX_FREE_3', 'true', 'To show taxfree price in additional column', @pricelistid , 90, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Model', 'PL_SHOW_MODEL_3', 'true', 'To show model in additional column', @pricelistid , 100, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Manufacturer', 'PL_SHOW_MANUFACTURER_3', 'true', 'To show the manufacturer', @pricelistid , 110, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Weight', 'PL_SHOW_WEIGHT_3', 'true', 'Show the weight', @pricelistid , 120, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function )
VALUES ( '', 'Stock On Hand', 'PL_SHOW_SOH_3', 'true', 'Show the Stock on Hand', @pricelistid , 125, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Notes (A)', 'PL_SHOW_NOTES_A_3', 'true', 'Creates an empty comment field, i.e. to make notes on your pricelist.', @pricelistid , 130, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Notes (B)', 'PL_SHOW_NOTES_B_3', 'true', 'Creates another empty comment field, i.e. to make notes on your pricelist.', @pricelistid , 140, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Show Inactive', 'PL_SHOW_INACTIVE_3', 'true', 'To show inactive products and categories', @pricelistid , 150, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Sort By', 'PL_SORT_PRODUCTS_BY_3', 'products_name', 'How products are sorted within a category', @pricelistid , 160, NULL , 'zen_cfg_select_option(array(\'products_name\', \'products_price\', \'products_model\' ),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Asc Desc', 'PL_SORT_ASC_DESC_3', 'asc', 'Sort ascending or descending', @pricelistid , 170, NULL , 'zen_cfg_select_option(array(\'asc\', \'desc\' ),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'All Categories default', 'PL_DEFAULT_SHOW_ALL_CATS_3', 'false', 'If true all catgories are shown by default, for large shops you might want to set this to false (to reduce memory usage).', @pricelistid , 180, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Boxes', 'PL_SHOW_BOXES_3', 'true', 'If true boxes are shown (to switch languages, currencies etc).', @pricelistid , 190, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) 
VALUES ( '', 'Debug', 'PL_DEBUG_3', 'true', 'If true debug info is shown', @pricelistid , 200, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

ALSO this is not working for adding the link...

SELECT @pricelistid:=configuration_group_id from configuration_group WHERE configuration_group_title='Printable Price-list';
select @pricelistid;
INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function )
VALUES ( '', 'Show Price List', 'SHOW_CATEGORIES_BOX_PRICELIST', 'true', 'If true Price-List link will show in Categories box', @pricelistid , 20, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );