Jump to content



Photo
- - - - -

[Addon] PDF Datasheet

2.3.1 pdf

  • Please log in to reply
341 replies to this topic

#21   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,006 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 19 January 2012 - 21:19

That module should just work. It has where I've used it, and the copy you have is the exact same code. I have no idea why it's not working for you.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#22   mumme

mumme
  • Validating
  • 121 posts
  • Real Name:magnus andersson
  • Gender:Male
  • Location:Stockholm | sweden

Posted 19 January 2012 - 21:33

I guess it dosent have anything to do with the Image Price module?
Becuase that was the only module that didnt worked for me, (im missing price_in_cart_only in my sql)

#23   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,006 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 19 January 2012 - 21:38

No, the Specifications module pulls the specifications based on the products_id. It doesn't depend on any other module. It does also depend on $current_category_id and $languages_id, but those should always be set. I've been looking at the code, and I still don't see the problem.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#24   mumme

mumme
  • Validating
  • 121 posts
  • Real Name:magnus andersson
  • Gender:Male
  • Location:Stockholm | sweden

Posted 19 January 2012 - 21:46

I get the current_category_id and language_id
specification_query_raw:
select ps.specification, s.filter_display, s.enter_values, sd.specification_name, sd.specification_prefix, sd.specification_suffix from products_specifications ps join specification_description sd on (ps.specifications_id = sd.specifications_id) join specifications s on (sd.specifications_id = s.specifications_id) join specification_groups sg on (sg.specification_group_id = s.specification_group_id) join specification_groups_to_categories sg2c on (sg2c.specification_group_id = sg.specification_group_id) where sg.show_products = 'True' and s.show_products = 'True' and sg2c.categories_id = '18' and ps.products_id = '1' and sd.language_id = '1' and ps.language_id = '1' order by s.specification_sort_order, sd.specification_name

So I get the data from the sql, but no display.
I will see if I can find anything..

#25   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,006 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 19 January 2012 - 21:58

I took the query you posted, changed the category and product_id to valid numbers for my test site, and ran it against the database. It returned the expected data. Check that your values are correct, and that you have specifications entered for that product.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#26   mumme

mumme
  • Validating
  • 121 posts
  • Real Name:magnus andersson
  • Gender:Male
  • Location:Stockholm | sweden

Posted 19 January 2012 - 22:17

The values in the query is the same on product_info and on pd.specifications, so it should work.
I will try to reinstall all.

#27   mumme

mumme
  • Validating
  • 121 posts
  • Real Name:magnus andersson
  • Gender:Male
  • Location:Stockholm | sweden

Posted 19 January 2012 - 23:17

If anyone wants to use this with the "master products" addon and show the slave products under the product descriptions text you can do like this:
(this is a quick and dirty soultion that works on my site, if you want to use it you probably need to change styling on the table.
This code also takes raw price from products description and dosent ads tax, currency etc. It fits my needs.. )

In catalog / includes / modules / pdf_datasheet / pd_description.php

Find:

$pdf->writeHTMLCell( $content_width, 0, PDF_MARGIN_LEFT, $current_y, $html, $border=0, $ln=0, $fill=false, $reseth=true, $align='', $autopadding=true);

After Add:

//START MASTER PRODUCTS - SHOW SLAVES
  $slave_query_raw = "select p.products_id, p.products_model, pd.products_name, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master like '% " .$products_id. " %' and p.products_status = '1'";
  $slave_query = tep_db_query ($slave_query_raw);
  $count_slave = tep_db_num_rows ($slave_query);
 
  if ($count_slave > 0) {

$html .= '<font size="8"><table border="0" width="100%" cellspacing="0" cellpadding="3"><tr>
<td width="30%"><strong>Art nr</strong></td>
<td width="60%"><strong>Ben&auml;mning</strong></td>
<td width="10%"><strong>Pris</strong></td>
</tr>
';

  while ($slave = tep_db_fetch_array ($slave_query) ) {
   $html .= '<tr>
<td>'.$slave['products_model'].'</td>
<td>'.$slave['products_name'].'</td>
<td>'.$slave['products_price'].'</td>
</tr>
';}
$html .= '</table></font>';
  
  }
 
  $pdf->writeHTMLCell( $page_width, 0, PDF_MARGIN_LEFT, $current_y, $html, 0, 1, false, true, '', true );
  //STOPP MASTER PRODUCTS SHOW SLAVES


#28   mumme

mumme
  • Validating
  • 121 posts
  • Real Name:magnus andersson
  • Gender:Male
  • Location:Stockholm | sweden

Posted 19 January 2012 - 23:35

I took the query you posted, changed the category and product_id to valid numbers for my test site, and ran it against the database. It returned the expected data. Check that your values are correct, and that you have specifications entered for that product.

Regards
Jim


I found out why is not working.
Im from sweden and we are using Å Ä Ö as letters in our specifications.

If the result from the query has Å Ä or Ö then the module isnt showing.
When I changed to A A and O it works.

Is it possible to show the specification data as html, as the products_description. Then I think it can be compatible with non US characters.

#29   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,006 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 19 January 2012 - 23:43

The TCPDF library uses Unicode fonts so that should work. The module uses the writeHTMLCell library method, which is what the Description module uses. Now I'm even more puzzled.

Regards
JIm

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#30   mumme

mumme
  • Validating
  • 121 posts
  • Real Name:magnus andersson
  • Gender:Male
  • Location:Stockholm | sweden

Posted 20 January 2012 - 12:22

About the Letter problem
I have tried some different things.
In all modules, if I enter one of the letter Å Ä Ö, example in the link module I want it to look like this: "Länk: productname". (english: Link: produkcname). If I write Länk, the modules wont show up, but if i write Lank with a normal a it works. It also works if I enter the html code for the letter "

&\auml;" (without the \)


My swedish.php uses

define('CHARSET', 'ISO-8859-1');


instead of




define('CHARSET', 'utf');


Maybye thats the problem?


But the strange thing is that the products_description works without any problem.


Edited by mumme, 20 January 2012 - 12:23.


#31   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,006 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 20 January 2012 - 20:01

The PDF library uses Unicode fonts, so you must store everything as UTF. Make certain that your database is using the utf8_general_ci collation. Using the wrong encoding will send incorrect characters to the PDF translation functions, resulting in unpredictable behavior.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#32   mumme

mumme
  • Validating
  • 121 posts
  • Real Name:magnus andersson
  • Gender:Male
  • Location:Stockholm | sweden

Posted 21 January 2012 - 21:41

The PDF library uses Unicode fonts, so you must store everything as UTF. Make certain that your database is using the utf8_general_ci collation. Using the wrong encoding will send incorrect characters to the PDF translation functions, resulting in unpredictable behavior.

Regards
Jim


changed back to:
define('CHARSET', 'utf-8');
in the languages file and now the SQL is in UTF_8..

And now it works perfect! =)

#33   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,006 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 06 March 2012 - 06:04

I've submitted the code again, this time without the TCPDF library package. You'll have to go get that from Sourceforge. Hopefully this will make the package small enough to be approved. I'll post the link here when that happens. As usual, the package is available from my site until the official release happens.

This release fixes a number of minor bugs and adds some new modules. Two of those modules work only with the Products Specifications addon, so you can ignore those if you don't have PS. The remaining modules print things that are on the default Product Info page, plus some things that you might want that are not on the stock page.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#34   mumme

mumme
  • Validating
  • 121 posts
  • Real Name:magnus andersson
  • Gender:Male
  • Location:Stockholm | sweden

Posted 07 March 2012 - 20:31

Dear Jim,

First of all, thank you for your great contributions to the Oscommerce community.

Im tryting to add this to a new, modified store and I need some hints on where to look to solves this issues:
Last time i installed this contr it was my store that had some porly written addons,

This time I guess it is the same problem, but I dont know where to start look.

I get this errors on product_datasheet.php

1, Notice: Constant DOCUMENTS_SHOW_PRODUCT_INFO already defined in C:\wamp\www\sknbrgs\pdf_datasheet.php on line 66

2, Notice: Undefined variable: languages_id in C:\wamp\www\sknbrgs\includes\modules\boxes\bm_whats_new.php on line 38

3, Fatal error: Call to a member function store() on a non-object in C:\wamp\www\sknbrgs\includes\modules\ultimate_seo_urls5\main\usu5.php on line 78

Any clue where to start looking on this issues?

row 7 in usu5.php is:

$this->getVar( 'cache' )->store( $this->getVar( 'registry' )->store() );


#35   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,006 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 07 March 2012 - 21:32

1. This is from the Document Manager Addon. The constant is defined in the database, so apparently you have that define in there twice. Search your configuration table key field for the string DOCUMENTS_SHOW_PRODUCT_INFO and get rid of all but one entry.

2. That's in includes/modules/boxes/bm_whats_new.php, but the error is not in the stock module, so apparently you've made some changes there. It might be enough to add this line near the top of the method:

	  global $languages_id;


3. That's a problem with Ultimate SEO URLs 5. The PDF Datasheet modules all use tep_href_link() to generate links, so this should just work. I have no idea why it's failing.

Regards
Jim

Edit: Stupid autocorrect....

Edited by kymation, 07 March 2012 - 21:33.

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#36   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,006 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 09 March 2012 - 00:03

The official release is now available in the Addons section.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#37   onlinesell

onlinesell
  • Members
  • 11 posts
  • Real Name:Vicentiu

Posted 12 March 2012 - 20:03

Hi,
I've instaled a few times and days ago this release, but when I access the PDF link, nothing is shown (http://onlinesell.ro...oducts_id/74584). Could you please have a solution for me? I realy do not know what seems to be the problem.
Thank you!
Regars,
Vicentiu.

#38   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,006 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 12 March 2012 - 20:24

Your URL rewriter is messing up the link. Fix it or turn it off.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#39   onlinesell

onlinesell
  • Members
  • 11 posts
  • Real Name:Vicentiu

Posted 13 March 2012 - 05:55

Hi,
I am not ussing any addon for URL rewrite. Is the standard oscommerce (with some addons, of course, but it can not interfier with your).

#40   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,006 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 13 March 2012 - 18:56

Then you are using the rewriter built into osCommerce. The answer is still the same.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated