Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] PDF Datasheet


kymation

Recommended Posts

I have a (I guess) porly written bm_categories.php that gives me the error:

Undefined offset: 0

 

I have no clue how to fix it, and I really want to use that categories box.

An easy workaround is to change the level of error reporting in pdf_datasheet.php from E_all to 0.

What are the disadvantages of making that change of error reporting?

 

It renders the PDF-files with perfect results.

Link to comment
Share on other sites

I don't get any errors on my test site, so it's likely that error is coming from something else. That error message is useless so I can't tell what is really causing the problem. Blocking it won't cause any harm anyway.

 

You should always have error reporting set to 0 for any live site, so hackers won't get useful information when they deliberately break something. You can leave error reporting on for your test site.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim,

 

Thanks for your reply, The link is passing the language as a parameter and shows correct.

I guess it's something else, for some reason the PDF-sheet won't show the correct language, also not in the header (Additional text).

 

Could this have anything to do with sessions?

 

It has worked before, so I'm not sure what the problem is.

As it probably isn't directly related to the PDF-sheet, I don't want to bother you with it but any suggestions are welcome.

 

Thanks a lot.

 

Regards,

Gerhard

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

You'll have to find the source of that error and fix it. The error message is useless. If you think the problem is in bm_categories.php, replace that with the stock file and see if that fixes the problem. If it does, you know which file the bug is in. Then you just need to debug that file.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim,

 

Thanks for your help, I really appreciate it and it puts me in the right direction.

 

I've installed the pdf-datasheet on a clean osc commerce installation to rule out conflicts with other addons.

So in this case the PDF-Datasheet is the only addon to the site. and a non-modified installation of the PDF-sheet addon.

 

For some reason it only shows the default language. the only difference I see in the URL is:

 

- a language change on the site give an url like:

 

 

 

- on the pdf-sheet this shows as:

 

 

 

 

 

 

Can this be the source of the problem (en versus english)?

 

Thanks for your help.

 

Kind regards,

 

Gerhard.

Edited by srirahandcraft

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

Hi Jim,

 

I just verified that this is the problem by changing "english" to "en", or "german" to "de",

 

but how do I change this to appear as language id and not languange name?

 

I'm glad, I found the problem, so I can ask you a direct question. I don't want to take up your time.

 

Thanks for your help

Edited by srirahandcraft

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

The correct way to generate the link is using this code in product_info.php:

 

   // Start PDF Datasheet
   echo '<a href="' . tep_href_link( 'pdf_datasheet.php', 'products_id=' . ( int )$_GET['products_id'] . '&language=' . $language ) . '" alt="' . TEXT_DOWNLOAD_PDF . '" title="' . TEXT_DOWNLOAD_PDF . '">' . tep_image( DIR_WS_ICONS . 'pdf_small.png', TEXT_DOWNLOAD_PDF ) . ' ' . addslashes( $product_info['products_name'] ) . TEXT_PDF_DATASHEET . '</a>';

 

The variable $language is set in includes/application_top.php to the correct value: english, german, etc. osCommerce does not use the two-letter abbreviation that you are seeing, so I don't know where that is coming from. If you have something that is changing the value of that variable, you need to find that and fix it.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim,

 

thanks for your reply.

 

This is a little strange because that way the problem could only be in the dutch language file as I installed the addon on a clean Oscommerce shop.

 

The following link is from my current live shop:

 

 

And this one is from a shop I looked up through Oscommerce:

 

 

Both use the language id's, not the names,

 

I'll have a look at it later aswell, but could you make sure oscommerce is not using the language id's (abbreviations).

 

Thanks a lot.

 

Kind regards,

 

Gerhard

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

The variable $language in osCommerce is set to the name of the directory containing the language files. This is normally english, german, spanish, etc. The variable $languages_id is a numeric index to the languages table in the database. These are the only two variables used to determine the language. Neither of these produces a two-letter abbreviation. There is no normal osC variable that is set to a two-letter abbreviation of a language name.

 

Your live shop indicates that it is a 2.2x version of osCommerce. This PDF Addon is designed to work with osC 2.3.0 and later. I recommend that you find the PDF addon that is designed for your version of osCommerce.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim,

 

Thanks for your answer.

 

I'm sorry for the confusion.

My current live shop is indeed an osc 2.2, but the shop I'm working on is an osc 2.3.3 shop. The addon has been installed in the latter one.

 

This was just meant to show you the language abbreviation.

I think the other shop is also an osc 2.2 shop.

So that was a bit a bad comparison, sorry about that.

 

Could you tell me if osc 2.2 has been/is using the abbreviations?

 

I had a look at the file: application_top.php and from there it seems you're right so I'll look further.

but then I'm still wondering why this also happens on a brandnew shop with only the PDF-datasheet installed.

 

Thanks for your help

 

Kind regards,

 

Gerhard

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

As far as I know, no version of osCommerce has ever used the abbreviation for the language. I don't know why it's happening on your shop. I can't duplicate the error so I have no way of debugging it.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim,

 

Has the PDF-datasheet been tested on Osc 2.3.3?

 

All links thoughout the site have the following function included:

 

tep_get_all_get_params

 

Could this be the source of the problem?

 

Best regards,

 

Gerhard

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

@@srirahandcraft This addon is in use on several osC 2.3.3 shops where it works as intended.

 

tep_get_all_get_params() is safe as long as you haven't introduced any foreign GET parameters into your store. There's something in your install that's passing an invalid language ID. Do you have this installed along with Wordpress or some other application? Are you following a link form some outside application that passes GET parameters?

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@kymation

 

Thanks again, you've put me in the right direction, it seems that wordpress or Joomla is conflickting somehow..

I had no idea that two separate files (sites) on a server could have a conflict.

 

I still have to find out how, as I deleted both Wordpress and Joomla and now the PDF is not showing at all.

 

But as I'm still learning, I'll find that problem as well.

 

I'm sorry to have taken up your time for this.

I really appreciate all your help.

 

Thanks,

 

Best regards,

 

Gerhard

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

The file pd_fonts.php is essential to the correct operation of this addon, so deleting it will break just about everything. Whatever your problem is, that is not the solution. This addon is working in several live stores without any problem, so it's something in your store.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 2 weeks later...

I have manage to install the pdf module and I have installed serveral modules.

 

When I click on the link on the products_info page I get the following errors. I did install the headsent.php file to test for file integrity and received no erros.

 

I am runnung Osc 2.3.3 and 5.4 PHP

 

can you suggest anything i can look at to resolve the errors. I have gone as far as removeing all modules except the one that are "Required" .

 

 

 

any help would be appreciated.

 

Thanks !

post-213634-0-30623700-1360775171_thumb.png

Edited by sandwick
Link to comment
Share on other sites

Those are errors in your categories box and links box. They have nothing to do with this addon. I suggest that you post a request for help in the support thread for each of those addons.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

They may be working, but they're throwing PHP warnings. Turn on error reporting in your application_top.php and you'll see the warning messages. The PDF generator is sensitive to these warnings, so you'll have to fix them even if they don't break the HTML pages.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@kymation

 

Just to be sure, I've installed the latest version of xampp and a fresh version of oscommerce 2.3.3.

I also downloaded the pdf-datasheet addon and the tcpdf folder.

 

So, now there are no other databases on the server and also no other sites.

 

With only German and English installed (before installing the pdf-datasheet) the site switches between the languages showing the language code in the link, like this:

 

http://localhost/test_site/catalog/product_info.php?products_id=1&language=en

 

This is the same after installing the pdf-datasheet, however following the link to the pdf-datasheet, this one shows the link as it is supposed to do according to you.

 

http://localhost/test_site/catalog/pdf_datasheet.php?products_id=1&language=english

 

I know, you've told me that this addon is running on several sites but if there is something wrong with the coding, this would mean there is something wrong in the original oscommerce version which sound strange to me.

 

Maybe you could have a look at it as I've run the addon on a 100% clean and fresh installation of xampp (database and php), oscommerce and the addon itself.

 

Thanks,

 

Gerhard

Edited by srirahandcraft

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

Here's the code in application_top.php that determines the language:

 

// set the language
 if (!tep_session_is_registered('language') || $_SESSION['language'] == '' || isset($_GET['language'])) {
   if (!tep_session_is_registered('language')) {
  tep_session_register('language');
  tep_session_register('languages_id');
   }

   include_once(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($_GET['language']) && tep_not_null($_GET['language'])) {
  $lng->set_language($_GET['language']);
   } else {
  $lng->get_browser_language();
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

 

Add the following just after that code:

 

print 'Language: ' . $language . '<br />';

 

That will show the contents of the language variable at the top of every page. It should always show 'english' and not 'en'. If it doesn't, there is something seriously wrong somewhere.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@kymation

 

Hi Jim,

 

I've executed your suggestion and that looks fine.

 

The forum wouldn't accept the screenshot, anyway

 

It shows the language perfectly as "german" on top of the page, but it doesn't pass this on to the link, the link still shows the language code eg: "de".

 

I read the following in another post:

 

the $language and $language_id variables are basically sessions. You do not want to pass them through links. Consider them globals and so to change them you could set a different post or get var say 'lid' and then update the sessions according its value. It's in the includes\application_top.php

 

I don't know if this might have anything to do with the problem.

 

best regards,

 

Gerhard

Edited by srirahandcraft

Addons installed on my website:

 

- Addons Installed

- Advanced Special Offer Discounts

- AJAX-Attribute Manager for osc 2.3.1

- Banner box v1.1.1

- Dutch Language Pack

- Extra Pages-info box with admin for OSC2.3

- German Language Pack

- Login Box

- Multi-language Support for Configuration

- Multiple products manager

- Order Editor

- OSC PDF Catalogue 2.1

- PDF-Datasheet

- product Field Groups

- Quickly Update Product Stock

- Unit of weight

- YAG (Yet another Guestbook)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...