Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] PDF Datasheet


kymation

Recommended Posts

The first eight errors are unrelated to the PDF Datasheet. Fix those first and then see if that also fixes your PDF bugs. If not, post the remaining bugs here and I'll do what I can to help you fix them.

 

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,

 

This is what I've been looking for!

 

I have not installed yet, but want your opinion on two things:

1. My product page just have a short introduction, the majority of technical things should be in the pdf file (user's guide). I am thinking to create a column in Products table in sql to hold that info (it's going to be long). Could you suggest on how to pull that info into the pdf? (I can duplicate the intro information already on the product page so I can skip the web conversion part, if this will make things easier).

 

2. One person was asking to right-justify the store name and address etc. , meaning to the opposite side of the store logo in the header section. You mentioned it would need some research into TCPDF, I am wondering if there is any solution for that. Like many other company letters, most contact info are in the header on the right.

 

Since I need the pdf part so much, please help me with the first one, skip the second if there is no easy solution (having a printable info page is a lot more important than appearance after all:).

 

Thank you,

chao

Link to comment
Share on other sites

1. If you already have a PDF of the information that you want to give your customer, you should probably use the Document Manager Addon (or something similar) to link that PDF to the product page. Otherwise, you would need to modify this Addon to include the additional information. I would create a new module based on the description module.

 

2. If you have a RTL language, set the language direction in the TCPDF config file. If not, the heading etc. will normally be on the left, so you would have to modify the modules to change that.

 

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,

Thank you for getting back to me.

 

For each of the product I have, customers need to download a product information sheet which will be more than the description displayed. If I create the pdf and provide a link, it will be a lot of work to create the files and manage the links, plus, updating pdf files would be a huge pain. That's where I of thinking of put an extra column in the Products table to hold all that information, and the customers click on a link to generate the pdf on the fly. Although I am not sure how complicated to do that, I don't know much about coding to modify the addon.

 

To put the address/contact to the right, that's not essential but make it better.

 

Thank you and please let me know if you'd have some directions on achieving the first one.

 

Thank you,

chao

Link to comment
Share on other sites

You will need to create a new field in the products_description table, similar to the existing description field. You would then need to create a new module to read that field and insert the data. Since the PDF modules are so similar to the box modules, the instructions for creating a new box will make this easy. Then you just need to change the SQL to call your new field in place of the description field.

 

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,

 

Thank you and I am sure the new box information should be very useful. But i am a layman in coding. Do you mean creating a new Box, like the box holding the Search field, and use that to hold the pull the information from the sql Product Description field holding the extra information, then use the pdf addon for printing purposes? It maybe beyond my capabilities.

 

One thing is that the current pdf addon will only create pdf of whatever is displayed on the product description page, am I right?

 

Thanks,

chao

Link to comment
Share on other sites

The modules that make up the parts of the PDF page are very similar to the modules that make up the boxes, so the instructions for cloning a box can be used to clone a PDF module. I suggest that you start with the description module, as it is the most similar in purpose to what you want.

 

The current PDF page can contain some things that do not show on the stock osCommerce product info page, like the manufacturer's name. It all depends on which modules you install.

 

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 a problem with the add-on.

I'm trying to figure out what is wrong but have no idea. :angry:

 

When I run it a link to the PDF Datasheet get this one comment:

 

Fatal error: Call to undefined function tep_session_save_path() in /home/bejsi/public_html/trgovina_test/includes/languages/slovenian.php on line 259

 

Server Information:

 

osCommerce Online Merchant v2.3.1

PHP Version: 5.3.8 (Zend: 2.3.0)

session.save_path /home/bejsi/public_html/trgovina_test/includes/work

 

My test page:

 

http://www.bej.si/trgovina_test/product_info.php?products_id=5120

 

I have installed many add-on and I do not have any problems except with this.

 

 

Thanks for the help

Link to comment
Share on other sites

tep_session_save_path() is a part of stock osCommerce 2.3.1. It's found in includes/functions/sessions.php on both the catalog and admin sides. Did you replace that file with an older version?

 

Regards

Jim

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

Link to comment
Share on other sites

I've uploaded a new version to the Addons area. This package adds a missing file (catalog/ext/tcpdf/fonts/font_list.txt) and fixes some errors in the instructions. The package is complete enough to install, but it's missing all of the Extras and examples. This was done to make it fit in the limited Addons upload.

 

Regards

Jim

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

Link to comment
Share on other sites

tep_session_save_path() is a part of stock osCommerce 2.3.1. It's found in includes/functions/sessions.php on both the catalog and admin sides. Did you replace that file with an older version?

 

Regards

Jim

 

I didn´t replace the older files.

 

From the language files I removed tep_session_save_path ().

Now I get this message: Notice: getimagesize () [function.getimagesize]: Read error! in / home / bejsi / public_html / trgovina_test / includes / modules / pdf_datasheet / pd_description.php on line 54

TCPDF ERROR: [image] Unable to get image: images /

 

I change my modules in Admin area, all modules indicate a different error.

 

I think the problem is in php PHP Version: 5.3.8 compatibility. I'll do a test with an old version of php.

 

If you have any idea what could be wrong please advise me.

 

Thanks for your help and kindness.

 

Regards

Joze

Link to comment
Share on other sites

This code was tested under PHP 5.3.8 and it runs correctly.

 

You cannot simply remove the calls to tep_session_save_path() and expect everything to work. You are missing part of stock osCommerce. That problem needs to be fixed.

 

The problem with pd_description.php is that it is trying to load a blank image. That should not happen. Check that you have at least one large image loaded for the product you are trying to see the datasheet for.

 

Regards

Jim

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

Link to comment
Share on other sites

Install and configured getting the following error

Notice: Constant MODULE_PAYMENT_COD_ZONE already defined in C:\wamp\www\home\pdf_datasheet.php on line 66

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 21868

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22239

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22239

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22665

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22960

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22239

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22665

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22960

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22239

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 21868

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22239

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22239

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22665

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22960

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22665

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22239

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22960

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22239

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22665

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22960

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22239

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22969

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22971

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22239

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22969

 

Notice: Undefined offset: 0 in C:\wamp\www\home\ext\tcpdf\tcpdf.php on line 22971

TCPDF ERROR: Wrong page number on setPage() function: 0

 

Any help or sugestions

 

Thanks Bob

Link to comment
Share on other sites

The error message states that MODULE_PAYMENT_COD_ZONE has been defined twice. This appears to be something to do with a COD payment module, perhaps with a SQL file that is run to install the module. In any case, you need to find and remove the second definition of that constant.

 

This actually has nothing to do with the PDF generator; it's an existing error in some other part 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

  • 1 month later...

Hello!

 

This looks like it will be an interesting add-on to my site, but I'm having troubles getting it going. I have installed it twice, each time following the instructions to the letter. I have only installed those modules listed as a starting point in the instructions (initialize, header, fonts, title, description, and product page link), and double-checked the sort order (they're in the order as I just listed them). However, when I click on a link on a product page I get the following errors:

 

Notice: getimagesize() [function.getimagesize]: Read error! in /home/chris400/public_html/crazychris.ca/store/includes/modules/pdf_datasheet/pd_description.php on line 54

TCPDF ERROR: [image] Unable to get image: images/

Fatal error: Call to a member function store() on a non-object in /home/chris400/public_html/crazychris.ca/store/includes/modules/ultimate_seo_urls5/main/usu5.php on line 78

 

Any help you can provide to me to fix these problems would be greatly appreciated. Btw, I notice that the second error relates to another add-on I have installed (ultimate_seo_urls5). Is there an incompatibility between your module and that one?

 

Again, thanks in advance for any help!

 

Regards,

 

Chris

Edited by Chrison
Link to comment
Share on other sites

Hmmm... for some reason, the site isn't letting me edit the above message. So, I'm sorry about a second post, but here's a quick update...

 

For some reason or another, the add-on is working for one item but not another. See the following items:

 

This one works: http://www.crazychris.ca/store/321-standard/321-bee-body-standard-yellow-p-81.html

 

This one doesn't: http://www.crazychris.ca/store/balloon-gifts/small-floral-arrangement-p-29.html

 

I have no idea why this would be the case?!?!? Btw, I also notice that the header is a bit mucked up. Is this because my store logo image might be too wide, or have I got another problem?

 

Again, thanks for any help you can provide!

 

Regards,

 

Chris

Link to comment
Share on other sites

1. It looks like that product doesn't have a large image. Please read the User's Manual section on images.

 

2. URL rewriters often cause problems with addons that use URLs. Try disabling the URL module, or turn off USU 5, and see if the error goes away.

 

The header problem is indeed because your image is larger than the stock logo. You will need to resize it or change the header settings to make it work.

 

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:

 

That item that wasn't working did have a large image, but for some reason the add-on wasn't picking it up. I re-uploaded the image into the catalog and it worked.

 

Also, I resized the store logo to the standard size. That's easier than mucking with the header to get it to work.

 

In short, all's well now... thanks for your help!

 

Regards,

 

Chris

Link to comment
Share on other sites

  • 3 weeks later...

Hi

I installed PDF Datasheet, it appear on product information page like this

 

Link: PDF Image & Product Name & Datasheet

 

and when you click on the link, the error message is as below:

 

Notice: Undefined variable: child_information in /includes/functions/information.php on line 48

TCPDF ERROR: Wrong page number on setPage() function: 0

 

and the information.php line 48 is as below:

$count_child = count($child_information);

Any idea how can I fix it?

 

Can anyboy please help? Thanks a lot in advance.

 

Lyn

Link to comment
Share on other sites

/includes/functions/information.php is not a part of the PDF Datasheet or of stock osCommerce. It must be something else you've added. Try the support thread for that Addon, or ask in the general support forum.

 

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,

 

thank you for the reply. I installed the addon "Information Page unlmited" which has this information.php.

 

Will try to post on that thread as well. If no luck, maybe have to uninstall one of it though I like to keep both...

 

Lyn

Link to comment
Share on other sites

Hi Jim,

 

Sorry I came back to post and bother you again.

 

I tried to post on information page unlimited but unfortunately no one answer so far.

 

I need that add on to help me to add extra front pages, and I also desperately need your add on to print out the product information.

 

So I came back and post the information.php whole page code, and see if you can help me to figure out.

 

I am newbie and don't know the PHP code and css at all. Since you have very good ability and make your own addon, just wonder if you could help me to modify code to make these two addon compatiable.

 

===================================================================================================

when I click on PDF image, this is the error I got:

 

Notice: Undefined variable: child_information in /catalog/includes/functions/information.php on line 48

TCPDF ERROR: Wrong page number on setPage() function: 0

===================================================================================================

the information.php page code are as below:

 

 

<?php

/*

$Id$

Module: Information Pages Unlimited

File date: 2007/02/17

Based on the FAQ script of adgrafics

Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands

Modified by [email protected] for OSC v2.3.1

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

Copyright © 2010 osCommerce

Released under the GNU General Public License

*/

////

/************************************************

Modified by Robert Fisher aka Thunderace

23 March 2006

Information_children mod

This file now shows highlights and children

in the same manner as osCommerce

************************************************/

function tep_information_show_category($information_group_id = 1) {

global $sitemapString, $languages_id;

$information_tree = array();

$informationString = '';

$parent_child_selected = '';

// Retrieve information from db

// ID set by module for Information box

$information_query = tep_db_query("select information_id, information_title, parent_id from " . TABLE_INFORMATION . " where visible = '1' and language_id = '" . (int)$languages_id ."' and information_group_id = '" . (int)$information_group_id . "' ORDER BY sort_order");

while ($information = tep_db_fetch_array($information_query)) {

$information_tree[$information['information_id']] = array(

'info_title' => $information['information_title'],

'parent_id' => $information['parent_id'],

'info_next_id' => 0

);

if ($information_tree[$information['information_id']]['parent_id'] != '0') {

$child_information[] = array (

'parent_info_id' => $information['parent_id'],

'child_info_id' => $information['information_id']

);

}

}

$count_child = count($child_information);

// Test if a child has been requested and set $parent_child_selected

for ($i = 1; $i < ($count_child+1); $i++) {

if ((isset($_GET['info_id'])) && ($child_information[$i]['child_info_id'] == $_GET['info_id'])) {

$parent_child_selected = $child_information[$i]['parent_info_id'];

}

}

// Run through the $information_tree to find all pages

while ($element = each($information_tree)) {

if (!isset($information_tree[$element['key']]['parent_id']) || ($information_tree[$element['key']]['parent_id'] == 0)) {

//Set the main title to bold if it was selected or one of its children were selected

if (((isset($_GET['info_id'])) && ($_GET['info_id'] == $element['key'])) || ($parent_child_selected == $element['key'])) {

$informationString .= '<a href="' . tep_href_link(FILENAME_INFORMATION, 'info_id=' . $element['key']) . '"><strong>' . $information_tree[$element['key']]['info_title'] . '</strong></a><br />';

} else {

$informationString .= '<a href="' . tep_href_link(FILENAME_INFORMATION, 'info_id=' . $element['key']) . '">' . $information_tree[$element['key']]['info_title'] . '</a><br />';

//Sitemap only

$sitemapString .= '<li><a href="' . tep_href_link(FILENAME_INFORMATION, 'info_id=' . $element['key']) . '">' . $information_tree[$element['key']]['info_title'] . '</a></li>' . "\n";

}

//Just for sitemap

$ul = false;

for ($i = 1; $i < ($count_child+1); $i++) {

if ($child_information[$i]['parent_info_id'] == $element['key']) {

if ($ul == false) {

$sitemapString .= '<ul>' . "\n";

$ul = true;

}

$sitemapString .= '<li><a href="' . tep_href_link(FILENAME_INFORMATION, 'info_id=' . $child_information[$i]['child_info_id']) . '">' . $information_tree[$child_information[$i]['child_info_id']]['info_title'] . '</a></li>' . "\n";

}

if (($i == $count_child) && ($ul == true)) {

$sitemapString .= '</ul>' . "\n";

}

}

//End just for sitemap

//Show children if they exist

if (((isset($_GET['info_id'])) && ($_GET['info_id'] == $element['key'])) || ($parent_child_selected == $element['key'])) {

for ($i = 0; $i < ($count_child); $i++) {

if ($child_information[$i]['parent_info_id'] == $element['key'])

//Show a child as bold if it was selected

if ((isset($_GET['info_id'])) && ($_GET['info_id'] == $child_information[$i]['child_info_id'])) {

$informationString .= '  <a href="' . tep_href_link(FILENAME_INFORMATION, 'info_id=' . $child_information[$i]['child_info_id']) . '"><strong>' . $information_tree[$child_information[$i]['child_info_id']]['info_title'] . '</strong></a><br />';

} else {

$informationString .= '  <a href="' . tep_href_link(FILENAME_INFORMATION, 'info_id=' . $child_information[$i]['child_info_id']) . '">' . $information_tree[$child_information[$i]['child_info_id']]['info_title'] . '</a><br />';

}

}

}

}

}

return $informationString;

}

////

// Define customer greetings

function tep_information_customer_greeting_define() {

global $customer_id, $customer_first_name, $languages_id, $category_depth;

if ($category_depth == 'top') {

// Retrieve information from db

$information_group_id = 2; // ID set by module for Entrance messages

$information_query = tep_db_query("select information_title, information_description from " . TABLE_INFORMATION . " where language_id = '" . (int)$languages_id . "' and information_group_id = '" . (int)$information_group_id . "'");

while ($information = tep_db_fetch_array($information_query)) {

// if($information['information_title'] == 'HEADING_TITLE')

define($information['information_title'], $information['information_description']);

}

}

}

////

// Return a customer greeting

function tep_information_customer_greeting() {

global $customer_id, $customer_first_name;

if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {

$greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));

} else {

$greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

}

return $greeting_string;

}

?>

 

thank you very much in advance

 

Lyn

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