Forums / General Questions / How to add technical data sheets (MSDS and TDS) to the products for download.

How to add technical data sheets (MSDS and TDS) to the products for download.

Started by oavs on 13 Jul 2016, 6:39 AM · Views: 1,231

Results 1 to 18 of 18
13 Jul 2016, 6:39 AM
#1
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

How to add technical data sheets (MSDS and TDS) to the products for download.

Hi ,

I need to add to some products to have an MSDS and a tech sheet, but most all products to have MSDS.

Is there a mod where admin user easily add PDF files to appear in the product detail page listed as

==========================
Click to download:
MSDS: MSDS_filename.pdf ( or show as linked PDF icon to download)
TDS: TDS_filename.pdf ( or show as linked PDF icon to download)

Please Note these should be available to download free and without registration or logging in.

Can someone please advise or suggest some solution?

I know it can be done in the description with hyper links etc , but it needs to be consistent in look and style and easy to upload (even if it meant via FTP) as log as it appears something like as above.

Thank you

Downunder QLD

13 Jul 2016, 10:24 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

Never used it, but a search of the plugins on pdf found pdf attachment in product description. It indicates that it is compatible with ZC 1.5.1, if properly written it should not be difficult/extreme to merge into ZC 1.5.5.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Jul 2016, 11:02 AM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

There's also Delia's Product Extra Fields; I use that on my needlework site.

13 Jul 2016, 9:45 PM
#4
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

Hi

Thank you for your kind responses.

@ mc12345678 yes this would have been ideal but I was unable to merge. Shame :-(

@lat9 yes I had a look at your website. Looks like this will do for now until there is an update for 'pdf attachment in product description'.

Downunder QLD

20 Jul 2016, 2:54 AM
#5
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

Hi lat9 ,

I tried this mod without success. Reason ;
It wants to write over my latest version 1.5.5a

After 'merging' with WinMerge carefully as much as I can as the code had inconsistent 'commenting' and was to difficult to follow. ( I wish mods only had the bits required to be merged not the complete replacement file)

After installing msql (which mod supposed to do automatically as well) I am getting a blank Admin screen with message "WARNING: An Error occurred, please refresh the page and try again."

Error log file indicates something to do with the product_extra_fields_install.php but can't figure out what?

Can you or anyone assist please? I really need to include 2 x PDF' SDS and TDS pdf files for each product and don't know how else can be done apart from including in the descriptions.

[20-Jul-2016 12:49:51 Australia/Sydney] Request URI: /qb/admin/, IP address: 14.202.99.123
#1 trigger_error() called at [/home/AAA49655/public_html/qb/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/home/AAA49655/public_html/qb/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/home/AAA49655/public_html/qb/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/home/AAA49655/public_html/qb/admin/includes/functions/extra_functions/product_extra_fields_install.php:30]
#5 require(/home/AAA49655/public_html/qb/admin/includes/functions/extra_functions/product_extra_fields_install.php) called at [/home/AAA49655/public_html/qb/admin/includes/init_includes/init_general_funcs.php:45]
#6 require(/home/AAA49655/public_html/qb/admin/includes/init_includes/init_general_funcs.php) called at [/home/AAA49655/public_html/qb/includes/autoload_func.php:48]
#7 require(/home/AAA49655/public_html/qb/includes/autoload_func.php) called at [/home/AAA49655/public_html/qb/admin/includes/application_top.php:171]
#8 require(/home/AAA49655/public_html/qb/admin/includes/application_top.php) called at [/home/AAA49655/public_html/qb/admin/index.php:10]

[20-Jul-2016 12:49:51 Australia/Sydney] PHP Fatal error: 1146:Table 'AAA49655_zenc829.product_extra_fields' doesn't exist :: INSERT IGNORE INTO product_extra_fields (products_id)
SELECT products_id FROM products where products_type = 1 ==> (as called by) /home/AAA49655/public_html/qb/admin/includes/functions/extra_functions/product_extra_fields_install.php on line 30 <== in /home/AAA49655/public_html/qb/includes/classes/db/mysql/query_factory.php on line 167

Downunder QLD

20 Jul 2016, 3:03 AM
#6
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

Commenting the file '_product_extra_fields_install.php' let's me login to admin.

and after loggin in there is no extra text fields in when I add products.

Downunder QLD

20 Jul 2016, 3:13 AM
#7
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

Commenting the file '_product_extra_fields_install.php' let's me login to admin.

and after loggin in there is no extra text fields in when I add products.

I have zen prefix for my tables 'zenwn_' and also in phpMyadmin I can see there is a table 'zenwn_product_extra_fields' .

Looking at the 'product_extra_fields_install.php' should I be changing anything?

#<?php
// auto installer for product extra fields mod v. 2, Delia Wilson Lunsford

$db->Execute ("CREATE TABLE IF NOT EXISTS ".DB_PREFIX."product_extra_fields (

products_id int(11) NOT NULL default '0',
extra_field text default '',
text_1 varchar(50) default NULL,
text_2 varchar(50) default NULL,
text_3 varchar(50) default NULL,
text_4 varchar(50) default NULL,
file_1 varchar(50) default NULL,
file_2 varchar(50) default NULL,
file_3 varchar(50) default NULL,
file_4 varchar(50) default NULL,
file_1_title varchar(100) default NULL,
file_2_title varchar(100) default NULL,
file_3_title varchar(100) default NULL,
file_4_title varchar(100) default NULL,
video varchar(150) default NULL,
video_title varchar(50) default NULL,
height smallint(6) default NULL,
width smallint(6) default NULL,
PRIMARY KEY (products_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1");

$db-> Execute ("INSERT IGNORE INTO product_extra_fields (products_id)
SELECT products_id FROM products where products_type = 1");

Downunder QLD

20 Jul 2016, 7:57 AM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

oavs:

Commenting the file '_product_extra_fields_install.php' let's me login to admin.

and after loggin in there is no extra text fields in when I add products.

I have zen prefix for my tables 'zenwn_' and also in phpMyadmin I can see there is a table 'zenwn_product_extra_fields' .

Looking at the 'product_extra_fields_install.php' should I be changing anything?

#<?php
// auto installer for product extra fields mod v. 2, Delia Wilson Lunsford

$db->Execute ("CREATE TABLE IF NOT EXISTS ".DB_PREFIX."product_extra_fields (

products_id int(11) NOT NULL default '0',
extra_field text default '',
text_1 varchar(50) default NULL,
text_2 varchar(50) default NULL,
text_3 varchar(50) default NULL,
text_4 varchar(50) default NULL,
file_1 varchar(50) default NULL,
file_2 varchar(50) default NULL,
file_3 varchar(50) default NULL,
file_4 varchar(50) default NULL,
file_1_title varchar(100) default NULL,
file_2_title varchar(100) default NULL,
file_3_title varchar(100) default NULL,
file_4_title varchar(100) default NULL,
video varchar(150) default NULL,
video_title varchar(50) default NULL,
height smallint(6) default NULL,
width smallint(6) default NULL,
PRIMARY KEY (products_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1");

$db-> Execute ("INSERT IGNORE INTO product_extra_fields (products_id)
SELECT products_id FROM products where products_type = 1");

Oops. Need to rewrite.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

20 Jul 2016, 8:08 AM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

oavs:

Commenting the file '_product_extra_fields_install.php' let's me login to admin.

and after loggin in there is no extra text fields in when I add products.

I have zen prefix for my tables 'zenwn_' and also in phpMyadmin I can see there is a table 'zenwn_product_extra_fields' .

Looking at the 'product_extra_fields_install.php' should I be changing anything?

#<?php
// auto installer for product extra fields mod v. 2, Delia Wilson Lunsford

$db->Execute ("CREATE TABLE IF NOT EXISTS ".DB_PREFIX."product_extra_fields (

products_id int(11) NOT NULL default '0',
extra_field text default '',
text_1 varchar(50) default NULL,
text_2 varchar(50) default NULL,
text_3 varchar(50) default NULL,
text_4 varchar(50) default NULL,
file_1 varchar(50) default NULL,
file_2 varchar(50) default NULL,
file_3 varchar(50) default NULL,
file_4 varchar(50) default NULL,
file_1_title varchar(100) default NULL,
file_2_title varchar(100) default NULL,
file_3_title varchar(100) default NULL,
file_4_title varchar(100) default NULL,
video varchar(150) default NULL,
video_title varchar(50) default NULL,
height smallint(6) default NULL,
width smallint(6) default NULL,
PRIMARY KEY (products_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1");

$db-> Execute ("INSERT IGNORE INTO product_extra_fields (products_id)
SELECT products_id FROM products where products_type = 1");

The last query needs modified, perhaps like so:

$db-> Execute ("INSERT IGNORE INTO `".DB_PREFIX."product_extra_fields` (`products_id`)
SELECT `products_id` FROM `".D$db-> Execute ("INSERT IGNORE INTO `".DB_PREFIX."product_extra_fields` (`products_id`)
SELECT `products_id` FROM `".DB_PREFIX."products` where `products_type` = 1");

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

20 Jul 2016, 8:19 AM
#10
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

Syntax error on this line ?/
SELECT products_id FROM ".D$db-> Execute ("INSERT IGNORE INTO ".DB_PREFIX."product_extra_fields (products_id`)

Downunder QLD

20 Jul 2016, 8:42 AM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

mc12345678:

The last query needs modified, perhaps like so:

$db-> Execute ("INSERT IGNORE INTO ".DB_PREFIX."product_extra_fields (products_id)
SELECT products_id FROM ".DB_PREFIX."products where products_type = 1");


Should be:

$db-> Execute ("INSERT IGNORE INTO ".DB_PREFIX."product_extra_fields (products_id)
SELECT products_id FROM ".DB_PREFIX."products where products_type = 1");

Yeah, major issue that a popup occurred, and while trying to "clear" it the paste button got pressed, and then when I went back to delete what looked like all that was necessary, ended up with the below frankencode...
> **oavs:**
>
> Syntax error on this line ?/
> SELECT `products_id` FROM `".D$db-> Execute ("INSERT IGNORE INTO `".DB_PREFIX."product_extra_fields` (`products_id`)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

20 Jul 2016, 8:50 AM
#12
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

Great thanks that work and greatly appreciated your assistance.

...I have no another problem ..fields are not showing in the admin > add product page but they do in the Preview before update..Looks like I did go wrong somewhere during merge..

I hate merging... I think Zencart is on a very good track with new 1.5.5a where NO core files are over written and easy uninstall.

Downunder QLD

20 Jul 2016, 9:28 AM
#13
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

This is an aspect that every contributor has to deal with. Some plugins can simply state: find this insert this, some are more complex (either by requirement or because they were overly made as such). The few contributions I have worked on, I tend to provide a copy of the original version of the file for the desired version with the changes made to apply (incorporate) for the software to work on that version. Lat9 tends to provide the latest version(s) of the file(s) which are intended to replace whatever version is present regardless of the existing version but also with the caveat that it works only on the version(s) referenced for the plugin assuming any core file mod is necessary.

Each has its strengths and weaknesses, the goal being that the code change(s) needed for functionality can be or are identified.

Based on the system response and relative age of the plugin, I would likely agree that something wasn't incorporated correctly. The file most likely in question is admin/includes/modules/collect_info.php

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

20 Jul 2016, 4:37 PM
#14
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

Almost there.

First I can see in admin > product add/edit page now I can't. I had earlier problems merging when it wasn't uploading the PDF and did not show on the preview. After fixing the code now It won't let me see product edit page.

Here is the log. What is wrong with the mysql ?

[21-Jul-2016 02:31:29 Australia/Sydney] Request URI: /qb/admin/product.php?cPath=64&product_type=1&pID=47&action=new_product, IP address: 14.202.99.123
#1 trigger_error() called at [/home/AAA49655/public_html/qb/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/home/AAA49655/public_html/qb/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/home/AAA49655/public_html/qb/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/home/AAA49655/public_html/qb/admin/includes/modules/product/collect_info.php:100]
#5 require(/home/AAA49655/public_html/qb/admin/includes/modules/product/collect_info.php) called at [/home/AAA49655/public_html/qb/admin/product.php:139]

[21-Jul-2016 02:31:29 Australia/Sydney] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zenwn_product_extra_fields pe
where p.products_id ' at line 32 :: select pd.products_name, pd.products_description, pd.products_url,
p.products_id, p.products_quantity, p.products_model,
p.products_image, p.products_price, p.products_virtual, p.products_weight,
p.products_date_added, p.products_last_modified,
date_format(p.products_date_available, '%Y-%m-%d') as
products_date_available, p.products_status, p.products_tax_class_id,
p.manufacturers_id,
pe.extra_field,
pe.file_1,
pe.file_2,
pe.file_3,
pe.file_4,
pe.file_1_title,
pe.file_2_title,
pe.file_3_title,
pe.file_4_title,
pe.video,
pe.video_title,
pe.width,
pe.height,
pe.text_1,
pe.text_2,
pe.text_3,
pe.text_4,
p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
p.product_is_free, p.product_is_call, p.products_quantity_mixed,
p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max,
p.products_sort_order,
p.products_discount_type, p.products_discount_type_from,
p.products_price_sorter, p.master_categories_id
from zenwn_products p, zenwn_products_description pd
zenwn_product_extra_fields pe
where p.products_id = '47'
and p.products_id = pd.products_id and p.products_id = pe.products_id
and pd.language_id = '1' ==> (as called by) /home/AAA49655/public_html/qb/admin/includes/modules/product/collect_info.php on line 100 <== in /home/AAA49655/public_html/qb/includes/classes/db/mysql/query_factory.php on line 167

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

Downunder QLD

20 Jul 2016, 6:17 PM
#15
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

You're missing a comma (look in /admin/includes/modules/products/collect_info.php around line 100):

...
from zenwn_products p, zenwn_products_description pd[B], [/B]
zenwn_product_extra_fields pe
...
20 Jul 2016, 11:01 PM
#16
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

Thank you both and specially pointing ot the 'comma' lat9 . Much appreciated.

Page now shows and its back to the original problem again. That is on the preview it does not show uploaded file list and product page naturally do not show either. At the same time if you go back and want to edit, all image and product details are gone (empty/deleted)

I really need this to work like this site has used the same mod. http://www.latitude9needlearts.com/sandb0x/index.php?main_page=product_info&cPath=6_10&products_id=44

Downunder QLD

21 Jul 2016, 12:00 PM
#17
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

You've got a bad merge in /admin/includes/modules/product/preview_info.php for the page to display like that. Anything in the /logs folder?

26 Jul 2016, 2:50 AM
#18
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: How to add technical data sheets (MSDS and TDS) to the products for download.

Ok, Now they are showing but have other issues.

I am sorry to say I found the developer support on this page and started a ...yet another tread unfortunately, so if you kindly go to this https://www.zen-cart.com/showthread.php?t=127600&goto=newpost tread then you will see the other new problems. BTW as is now no logs recorded.

Downunder QLD