Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] PDF data-sheet maker v.1.1


alverman

Recommended Posts

hello,

 

logo is ok, but the line with categorie and product_name is only grey and ">" is on the grey line.

 

Ines

 

The solution to this is to place the following at the top of pdf_datasheet_funtions.php

 

// Fix supplied by Kymation - to overcome register global problem
// Fixes missing Product Attributes, Category Path, and Product Name on PHP5/MYSQL5
 $products_id = '';
   if (isset($_GET['products_id']) && $_GET['products_id'] != '') {
    $products_id = (int) $_GET['products_id'];
	  }
// End Fix

 

Thanks to Kymation and MrPhil for helping me sort out the problem.

-Dave

Link to comment
Share on other sites

  • 3 months later...
  • Replies 179
  • Created
  • Last Reply

Top Posters In This Topic

Thanks, I had the same problem like Roaddoctor and this fix worked!

 

But I have some issues left to solve for my purpose. First would be:

 

Is there a way to modify the pdf-output to show the selected options rather then all options available? (I have also Option Types v2 installed and would be happy if this would be also possible with the users input)

 

I think the solution must be in these lines (row 541) of the pdf_datasheet_functions.php

 

 

   if(PDF_SHOW_OPTIONS) {
     if (tep_db_num_rows($products_options_name)) {
       $this->MultiCell(0,8,TEXT_PRODUCTS_OPTIONS . $print_catalog_array['name'] .' :',0,'L',0);
       $this->Ln(-5);
     }
     while ($products_options_name_values = tep_db_fetch_array($products_options_name)) {
       $products_options_array = array();
       $products_options_name_values['products_options_name'];
       $this->Ln(6);
       $attributes_heading_font=explode(",",PDF_ATTRIBUTES_HEADING_FONT);
       $this->SetFont($attributes_heading_font[0],$attributes_heading_font[1],$attributes_heading_font[2]);
       $this->Cell(190,5,$products_options_name_values['products_options_name'],0,0,'L');
       $this->Ln();
       $products_options = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $products_id . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . " order by 0+pov.products_options_values_name");
       $count_options_values = tep_db_num_rows($products_options);
  		$count_options = 0;

       while ($products_options_values = tep_db_fetch_array($products_options)) {
         $products_options_array[] = array('id' => $products_options_values['products_options_values_id'], 'text' => $products_options_values['products_options_values_name'],  'price_id' => $products_options_values['products_options_values_id'],   'text2' => $products_options_values['options_values_price']);
         $w=$this->GetStringWidth($products_options_values['products_options_values_name'])+2;
         $attributes_font=explode(",",PDF_ATTRIBUTES_FONT);
         $this->SetFont($attributes_font[0],$attributes_font[1],$attributes_font[2]);
         $this->SetTextColor(0,0,200);
         $option_string = $products_options_values['products_options_values_name'] . $option_value;
         if ( $products_options_values['options_values_price'] != ' 0.0000' && PDF_SHOW_OPTIONS_PRICE == '1') {
           $count_options++; $add_to = ($count_options_values != $count_options ? ',' : '.' );
           $this->Write(5,$products_options_values['products_options_values_name']. ' (' . $products_options_values['price_prefix'] . $currencies->display_price($products_options_values['options_values_price'], tep_get_tax_rate($print_catalog['products_tax_class_id'])) . ')' . $add_to);
         } else {
           $count_options++; $add_to = ($count_options_values != $count_options ? ',' : '.' );
           $this->Write(5,$products_options_values['products_options_values_name'] . $add_to);
         }
         $this->Cell(3,6,"",0,0,'C');
         $this->SetTextColor(0,0,0);
       }
     }
   }

Link to comment
Share on other sites

  • 1 month later...

Hi can someone help me,

 

i try to install my Sql file and its gives the following messages:

 

# Data Table configuration INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Show Product Image', 'PDF_SHOW_PRODUCT_IMAGE', '1', 'Shall the product image be displayed on the datasheet?

 

0 = Not Displayed

1 = Displayed', 200, 5, '2005-06-08 21:01:41', '0000-00-00 00:00:00', NULL, NULL), ('', 'Show Product Name', 'PDF_SHOW_PRODUCT_NAME', '1', 'Shall the product name be displayed on the datasheet (already present in header)?

 

0 = Not Displayed

1 = Displayed', 200, 10, '2005-06-08 21:01:41', '0000-00-00 00:00:00', NULL, NULL), ('', 'Show Product Manufacturer', 'PDF_SHOW_PRODUCT_MANUFACTURER', '1', 'Shall the product manufacturer be displayed on the datasheet?

 

0 = Not Displayed

1 = Displayed', 200, 15, '2005-06-08 21:01:41', '0000-00-00 00:00:00', NULL, NULL), ('', 'S[...]

 

Mensagens do MySQL : Documentação

#1062 - Duplicate entry '0' for key 1

 

 

 

also when i click in the products pdf icon the pdf target appears blank,

 

I removed the query part 0 = Not Displayed and the installation was sucessfull, is that procedure Ok? still i don´t see any information in the data_sheet

 

Many thanks

Link to comment
Share on other sites

  • 5 months later...

I realy like this contribution. It's very handy for my clients.

 

Now i have one problem.

I work with Icecat. The fill my database with the productspecs. These specs are in html-format. The datasheetmaker can't read this html code. This result in al long unreadable specification without seperators.

is there an way that this contribution can read this html code and make a good readable specs?

 

Example:

This is the icecat specs readed from my databes

icecat.jpg

 

And the pdf_sheet_maker shows this

 

PrintkwaliteitKleurYMaximale

resolutie4800 x 1200 DPIPrintsnelheidPrintsnelheid (zwart,

standaardkwaliteit, A4)7.5 ppmPrintsnelheid (kleur,

standaard, A4)4.5

ppmPrinttechnologiePrinttechnologieInkjetScannenMaximum

scanresolutie1200 x 2400 DPIKleurenscansYKleurdiepte48 /

24 bitSoort scannerFlatbed scannerMet geïntegreerde

scannerYGrijsniveau's256 levels of greyOptische

scanresolutie19200 x 19200 DPIKopiërenKopieersnelheid

(standaard, zwart, A4)5.5

cpmKleurenkopiemogelijkheidYKopieersnelheid (standaard,

kleur, A4)2.2 cpmCopyingYFaxenMet geïntegreerde

faxYModemsnelheid33.6 Kbit/sAutomatische

nummerherhalingYFaxgeheugen50

pagesDatacompressieMH, MR,

MMRInvoercapaciteitMaximum invoercapaciteit100

sheetsMediaformatenMaximale printafmetingenA4 / Letter

(216 x 297 mm)Media-afmetingen voor afdrukken zonder

witrandA4, Letter, 20 x 25cm, 13 x 18cm, 10 x

15cmEnvelopes sizesDL, COM10ISO A-series sizes

(A0...A9)A4, A5MediaformatenISO B-series sizes

(B0...B9)B5LegalYLetterYPhoto paper sizes10 x 15cm, 13 x

18cm, 20 x 25cmMediatypesEnveloppenYGlanzend

papierYNormaalpapierYFotopapierYMinimale

systeemeisenMac-compatibiliteitYCompatibele

besturingssystemenWindows Vista, Vista SP1 Windows XP

SP2, SP3 \nWindows 2000 Professional SP4\nMac OS X

v.10.3.9, v.10.4, v10.5Minimale processor1 GHzMinimaal

Edited by senatorman
Link to comment
Share on other sites

  • 3 months later...

I realy like this contribution. It's very handy for my clients.

 

Now i have one problem.

I work with Icecat. The fill my database with the productspecs. These specs are in html-format. The datasheetmaker can't read this html code. This result in al long unreadable specification without seperators.

is there an way that this contribution can read this html code and make a good readable specs?

 

Example:

This is the icecat specs readed from my databes

icecat.jpg

 

And the pdf_sheet_maker shows this

 

PrintkwaliteitKleurYMaximale

resolutie4800 x 1200 DPIPrintsnelheidPrintsnelheid (zwart,

standaardkwaliteit, A4)7.5 ppmPrintsnelheid (kleur,

standaard, A4)4.5

ppmPrinttechnologiePrinttechnologieInkjetScannenMaximum

scanresolutie1200 x 2400 DPIKleurenscansYKleurdiepte48 /

24 bitSoort scannerFlatbed scannerMet geïntegreerde

scannerYGrijsniveau's256 levels of greyOptische

scanresolutie19200 x 19200 DPIKopiërenKopieersnelheid

(standaard, zwart, A4)5.5

cpmKleurenkopiemogelijkheidYKopieersnelheid (standaard,

kleur, A4)2.2 cpmCopyingYFaxenMet geïntegreerde

faxYModemsnelheid33.6 Kbit/sAutomatische

nummerherhalingYFaxgeheugen50

pagesDatacompressieMH, MR,

MMRInvoercapaciteitMaximum invoercapaciteit100

sheetsMediaformatenMaximale printafmetingenA4 / Letter

(216 x 297 mm)Media-afmetingen voor afdrukken zonder

witrandA4, Letter, 20 x 25cm, 13 x 18cm, 10 x

15cmEnvelopes sizesDL, COM10ISO A-series sizes

(A0...A9)A4, A5MediaformatenISO B-series sizes

(B0...B9)B5LegalYLetterYPhoto paper sizes10 x 15cm, 13 x

18cm, 20 x 25cmMediatypesEnveloppenYGlanzend

papierYNormaalpapierYFotopapierYMinimale

systeemeisenMac-compatibiliteitYCompatibele

besturingssystemenWindows Vista, Vista SP1 Windows XP

SP2, SP3 \nWindows 2000 Professional SP4\nMac OS X

v.10.3.9, v.10.4, v10.5Minimale processor1 GHzMinimaal

 

nobody to help?

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