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 41 to 60 of 326
This thread is locked. New replies are disabled.
20 Oct 2004, 4:09 AM
#41
ghostcorps avatar

ghostcorps

Zen Follower

Join Date:
Aug 2004
Posts:
398
Plugin Contributions:
0

Pricelist For Printing

Probably should mention i found the control for the background, and have my static image set in stone. just liek the rest of my site :) Yay for this price list... :)

Sometimes the best advice is to tell me I'm not thinking about the problem enough.
FleshMetal.com.au

21 Oct 2004, 4:46 AM
#42
ghostcorps avatar

ghostcorps

Zen Follower

Join Date:
Aug 2004
Posts:
398
Plugin Contributions:
0

Re: Pricelist For Printing

.. like i said.. im a bit useless this week. far too many thing to juggle.

Thanks paul.. its all fixed... I forgot to refresh. ::tup

Sometimes the best advice is to tell me I'm not thinking about the problem enough.
FleshMetal.com.au

2 Nov 2004, 6:21 PM
#43
paulm avatar

paulm

Totally Zenned

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

Re: Pricelist For Printing

Hi Ian,

IanEtche:

if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
$content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>';
}

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

> 
> I think that has fixed my problem - I might put the config in the database if that would be of any help.
memory loss can be funny sometimes. I was reading your post and thought "put the config in the database :huh: wat is he talking about?". It took a while but suddenly I remembered again ```
define('SHOW_CATEGORIES_BOX_PRICELIST', 'true');
``` indeed was a temporay line, to be removed after adding a setting for it into the pricelist.sql/database. But I never got to the "adding to the database" part, and forgot all about it :)
2 Nov 2004, 8:28 PM
#44
ianetche avatar

ianetche

Zen Follower

Join Date:
Aug 2004
Posts:
138
Plugin Contributions:
0

Re: Pricelist For Printing

Hi Paul

Sorry wasn't meant to be cryptic - just a thought as I was writing the note. I haven't had a moment to work out which way up to hold my beer this last week or so (and those that know me would consider that knowledge to be genetically stabislised ;-) I will post the sql as soon as I can get to it if no one else has done it earlier.

Thanks again for a really useful mod.

Best regards, Ian

13 Nov 2004, 3:34 AM
#45
duwane avatar

duwane

Zen Follower

Join Date:
Aug 2004
Location:
Auckland, New Zealand
Posts:
120
Plugin Contributions:
0

Re: Pricelist For Printing

Awesome contribution. ::tup Thanks. I have got the pricelist working with attributes, but it will probably need some more modification to be used with attributes in the standard way. I use attributes to display different models of the same product on my site and had to do a lot of code changes to core code to change the way attributes work for my purposes.

Has anyone got this working with register globals off yet? I have noticed that the pricelist does not display if register globals is off.

Could someone that knows the code for this intimately let me know which variables I need to declare as global to get the pricelist to work with globals off.

Thanks.

13 Nov 2004, 1:36 PM
#46
pixxi avatar

pixxi

Totally Zenned

Join Date:
Jan 2004
Location:
UK
Posts:
1,065
Plugin Contributions:
1

Re: Pricelist For Printing

Only a small point (it still works fine :) ) but noticed from 'Latest Visitors' stats in cpanel that visitors are getting a double forward-slash in the path:

.... /catalog/includes/templates/custom/pricelist//profile-a4-portrait.css

and also

.... /catalog/includes/templates/custom/pricelist//stylesheet.css

Don't know yet where it's being generated, but as I said, if you click the link in 'Latest Visitors' the path still works :)

13 Nov 2004, 4:44 PM
#47
paulm avatar

paulm

Totally Zenned

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

Re: Pricelist For Printing

Hi duwane,

duwane:

Has anyone got this working with register globals off yet? I have noticed that the pricelist does not display if register globals is off.I didn't have any plans to update, but for the "globals off" I think I will update after all.

hope to get back in a couple of days

@pixxi while I'm at it I will into the // too :)

13 Nov 2004, 4:47 PM
#48
pixxi avatar

pixxi

Totally Zenned

Join Date:
Jan 2004
Location:
UK
Posts:
1,065
Plugin Contributions:
1

Re: Pricelist For Printing

Ok. Thanks :)

13 Nov 2004, 5:42 PM
#49
ianetche avatar

ianetche

Zen Follower

Join Date:
Aug 2004
Posts:
138
Plugin Contributions:
0

Re: Pricelist For Printing

Hi Paul

If you are updating, I did get round to including the enable disable in the SQL - in tpl_categories.php I commented out the line starting define( "SHOW..... as below:

 	//ie091104 define('SHOW_CATEGORIES_BOX_PRICELIST', 'true');
 	if (SHOW_CATEGORIES_BOX_PRICELIST == 'true') {
   $content .= '<br /><a href="' . zen_href_link(FILENAME_PRICELIST) . '">' . CATEGORIES_BOX_HEADING_PRICELIST . '</a>';
  }

and ran the following SQL query to update an existing installation

(for anybody using for the first time simply add the lines above starting INSERT INTO zen_configuration( configuration ..... to the top section in Paul's SQL distribution files after the line

select @pricelistid;

and before

Profiles

Paul had already done the work - this just allows the Price List option to be switched on and off in the Printable Price List config menu)

SELECT @pricelistid:=configuration_group_id from zen_configuration_group WHERE configuration_group_title='Printable Price-list';
select @pricelistid;
INSERT INTO zen_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 Option Will show in Categories', @pricelistid , 20, NULL , 'zen_cfg_select_option(array(\'true\', \'false\'),' );

Best regards, Ian

15 Nov 2004, 11:44 AM
#50
paulm avatar

paulm

Totally Zenned

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

Re: Pricelist For Printing

Thanks Ian,

I certainly would have forgotten about that if you hadn't mentioned it.

B.t.w. if anyone else want's to update the pricelist I wouldn't mind at all (notify by PM please). I've got a lot on my mind currently, so it might take a week or more before I will get to it (unless I decide to skip a night sleep for it :) ).

18 Nov 2004, 5:48 PM
#51
paulm avatar

paulm

Totally Zenned

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

Re: Pricelist For Printing

The register globals problem had something to do with the language setting.
(this small code change also replaces an ugly fix I added before, hopefully this one wil last longer :) )

In "includes/modules/pages/pricelist/header_php.php"
change (approx line 28/29)

if (!(isset($language))) $language = $lng->language['directory'];
if (!(isset($languages_id))) $languages_id = $lng->language['id'];

to:

$language = $_SESSION['language'];
$languages_id = (int)$_SESSION['languages_id'];

The above change should enable you to use the price-list with both register globals enabled, and register globals disabled.

@pixxi: sorry, but I don't understand where the double slash comes from, so I've no fix for either.

Note: I don't feel like updating yet, but if anyone else wants to update he price-list please do!

19 Nov 2004, 1:11 AM
#52
duwane avatar

duwane

Zen Follower

Join Date:
Aug 2004
Location:
Auckland, New Zealand
Posts:
120
Plugin Contributions:
0

Re: Pricelist For Printing

Thanks Paul. I have tried the code changes you suggested but it still does not work with globals off.

If it was working on your installation maybe you changed something else during your testing which may be the actual problem?

I dont have much time right now as I am trying to get my site up and running, but may have another look after that is all over.

19 Nov 2004, 8:29 AM
#53
paulm avatar

paulm

Totally Zenned

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

Re: Pricelist For Printing

duwane:

I have tried the code changes you suggested but it still does not work with globals off.
Strange, it seems to work at my test site (using .htaccess to switch of the register globals).

  1. What PHP version do you use?
  2. What exactly do you see, nothing, or a price-list without products?
  3. If it's an empty list, does it help if you switch language?
  4. It would help if others could tell if it works with globals off for them (maybe it only works on mine for some reason).
19 Nov 2004, 10:31 AM
#54
duwane avatar

duwane

Zen Follower

Join Date:
Aug 2004
Location:
Auckland, New Zealand
Posts:
120
Plugin Contributions:
0

Re: Pricelist For Printing

I am not displaying the languages sidebox. perhaps that has something to do with it. I will test. I am setting globals off in php.ini and not in htaccess file.

Answers to your questions:

  1. (As per Admin->Tools->Server Info)
    Server OS: Linux 2.4.22-1.2115.nptl
    PHP Version: 4.3.4 (Zend: 1.3.0)
    HTTP Server: Apache/2.0.48 (Fedora)

  2. Everything looks normal (i.e. no errors). Categories all displayed as normal but when selecting a category all it displays is the "No products or categories....." no matter what category is selected.

  3. As I said before I will have to enable the languages sideox as I have not configured other languages

  4. I have tested on a Windows system and my ISP (Linux as listed above) and get the same result with both.

Rather strange. I did notice when looking at the code earlier there is reference to some variables (like $current_category_id) that are never declared or assigned any values. May or may not be related??

19 Nov 2004, 11:51 AM
#55
paulm avatar

paulm

Totally Zenned

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

Re: Pricelist For Printing

duwane:

Rather strange. I did notice when looking at the code earlier there is reference to some variables (like $current_category_id)
looks like you've found (one of) the problem(s) :)

At my testsite al categories are shown by default, but when I set it to false, I also get the "No products.. message

19 Nov 2004, 12:30 PM
#56
paulm avatar

paulm

Totally Zenned

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

Re: Pricelist For Printing

Next fix,

in "includes/modules/pages/pricelist/header_php.php"
find (approx line 236):

  if ((($line['categories_id'] == $category) || ($line['parent_id'] != 0)) || (($category == 0) && (PL_DEFAULT_SHOW_ALL_CATS == 'true'))) {

and replace by:

  if ((($line['categories_id'] == (int)$_GET[category]) || ($line['parent_id'] != 0)) || (((int)$_GET[category] == 0) && (PL_DEFAULT_SHOW_ALL_CATS == 'true'))) {
19 Nov 2004, 1:08 PM
#57
duwane avatar

duwane

Zen Follower

Join Date:
Aug 2004
Location:
Auckland, New Zealand
Posts:
120
Plugin Contributions:
0

Re: Pricelist For Printing

Looks like you have hit the nail on the head this time! All seems to be working now. I have applied both of your code changes. It requires both changes to work properly otherwose the problem still occurs.

Thanks for the help Paul. Now I can start testing my site with globals off..... see if I can break anything else.... ;)

19 Nov 2004, 1:33 PM
#58
paulm avatar

paulm

Totally Zenned

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

Re: Pricelist For Printing

duwane:

Looks like you have hit the nail on the head this time! All seems to be working now.
Ok, great :)
If we don't get any other error reports, the price-list seems to be register globals on and off compatible now B) .

You talked about selecting categories, that set me on the right track. It's a bit difficult sometimes because the script is made by several people (and this last error wasn't in my code :P ).

19 Nov 2004, 4:35 PM
#59
paulm avatar

paulm

Totally Zenned

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

Re: Pricelist For Printing

I will upload a new version (1.02) very soon. It includes the several posted fixes (mainly for register globals off compatibility). And also a display "Stock On Hand" feature is added, thanks to bmoroney.

Paul

19 Nov 2004, 6:13 PM
#60
ianetche avatar

ianetche

Zen Follower

Join Date:
Aug 2004
Posts:
138
Plugin Contributions:
0

Re: Pricelist For Printing

Hi

Paul - would you or anyone else be interested in a mod for showing descriptions in the listing? I'd be happy to help integrate code I have working on 1.2.1 for your release if it would be of interest.

You can get an idea of how it works on http://www.premier-proms.com/ it takes a configured number of characters from the front of the description string.

I appreciate it might delay the release and/or also may not be of interest to others so please just let me know if I can help.

Regards, Ian