Forums / Addon Admin Tools / Product Extra Fields for text, pdfs and flash

Product Extra Fields for text, pdfs and flash

Views: 74,657

Results 321 to 340 of 381
29 Jul 2015, 8:16 AM
#321
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Product Extra Fields for text, pdfs and flash

Remove the following code from admin/includes/modules/new_product_preview.php:

//extra fields mod

if ($_POST['file_1_title'] != '') {
$products_file_1 = new upload('file_1');
$products_file_1->set_destination(DIR_FS_PRODUCT_EXTRA);
if ($products_file_1->parse() && $products_file_1->save(true)) {
$products_file_1_name = $products_file_1->filename;
} else {
$products_file_1_name = (isset($_POST['previous_file_1']) ? $_POST['previous_file_1'] : '');
}
}

if ($_POST['file_2_title'] != '') {
$products_file_2 = new upload('file_2');
$products_file_2->set_destination(DIR_FS_PRODUCT_EXTRA);
if ($products_file_2->parse() && $products_file_2->save(true)) {
$products_file_2_name = $products_file_2->filename;
} else {
$products_file_2_name = (isset($_POST['previous_file_2']) ? $_POST['previous_file_2'] : '');
}
}

if ($_POST['file_3_title'] != '') {
$products_file_3 = new upload('file_3');
$products_file_3->set_destination(DIR_FS_PRODUCT_EXTRA);
if ($products_file_3->parse() && $products_file_3->save(true)) {
$products_file_3_name = $products_file_3->filename;
} else {
$products_file_3_name = (isset($_POST['previous_file_3']) ? $_POST['previous_file_3'] : '');
}
}

if ($_POST['file_4_title'] != '') {
$products_file_4 = new upload('file_4');
$products_file_4->set_destination(DIR_FS_PRODUCT_EXTRA);
if ($products_file_4->parse() && $products_file_4->save(true)) {
$products_file_4_name = $products_file_4->filename;
} else {
$products_file_4_name = (isset($_POST['previous_file_4']) ? $_POST['previous_file_4'] : '');
}
}
if ($_POST['video_title'] != '') {
$products_video = new upload('video');
$products_video->set_destination(DIR_FS_PRODUCT_EXTRA);;
if ($products_video->parse() && $products_video->save(true)) {
$products_video_name = $products_video->filename;
} else {
$products_video_name = (isset($_POST['previous_video']) ? $_POST['previous_video'] : '');
}
}

?>

and change the following (was highlighted in Diffmerge)

if (!isset($_GET['read']) || $_GET['read'] == 'only') {
$products_image = new upload('products_image');
$products_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']);
if ($products_image->parse() && $products_image->save($_POST['overwrite'])) {
$products_image_name = $_POST['img_dir'] . $products_image->filename;
} else {
$products_image_name = (isset($_POST['products_previous_image']) ? $_POST['products_previous_image'] : '');
}

to this (I can't see any difference):

if (!isset($_GET['read']) || $_GET['read'] == 'only') {
$products_image = new upload('products_image');
$products_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']);
if ($products_image->parse() && $products_image->save($_POST['overwrite'])) {
$products_image_name = $_POST['img_dir'] . $products_image->filename;
} else {
$products_image_name = (isset($_POST['products_previous_image']) ? $_POST['products_previous_image'] : '');
}

29 Jul 2015, 8:24 AM
#322
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Product Extra Fields for text, pdfs and flash

remove from admin/includes/modules/update_product.php

//extra product fields
$tmp_value = zen_db_prepare_input($_POST['text_1']);
$text_1 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['text_2']);
$text_2 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['text_3']);
$text_3 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['text_4']);
$text_4 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_1']);
$file_1 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_2']);
$file_2 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_3']);
$file_3 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_4']);
$file_4 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_1_title']);
$file_1_title = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_2_title']);
$file_2_title = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_3_title']);
$file_3_title = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_4_title']);
$file_4_title = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['video']);
$video = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['video_title']);
$video_title = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['extra_field']);
$extra_field = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['height']);
$height = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['width']);
$width = ($tmp_value=='') ? "null" : $tmp_value;

    $sql_data_array = array('products_id' => $products_id,
                            'extra_field' => $extra_field,
  						'text_1' => $text_1,
  						'text_2' => $text_2,
  						'text_3' => $text_3,
  						'text_4' => $text_4,
                            'video_title' => $video_title,
                            'file_1' => $file_1,
                            'file_2' => $file_2,
                            'file_3' => $file_3,
                            'file_4' => $file_4,
                            'file_1_title' => $file_1_title,
                            'file_2_title' => $file_2_title,
                            'file_3_title' => $file_3_title,
                            'file_4_title' => $file_4_title,
                            'video'			=> $video,
                            'height'		=> $height,
                            'width'			=> $width
                            );

    zen_db_perform(TABLE_PRODUCT_EXTRA_FIELDS, $sql_data_array);

&

//extra product fields
$tmp_value = zen_db_prepare_input($_POST['extra_field']);
$extra_field = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['text_1']);
$text_1 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['text_2']);
$text_2 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['text_3']);
$text_3 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['text_4']);
$text_4 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_1']);
$file_1 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_2']);
$file_2 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_3']);
$file_3 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_4']);
$file_4 = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_1_title']);
$file_1_title = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_2_title']);
$file_2_title = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_3_title']);
$file_3_title = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['file_4_title']);
$file_4_title = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['video']);
$video = ($tmp_value=='') ? "null" : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['video_title']);
$video_title = ($tmp_value=='') ? "null" : $tmp_value;

     $tmp_value = zen_db_prepare_input($_POST['height']);
    $height = ($tmp_value=='') ? "null" : $tmp_value;
     $tmp_value = zen_db_prepare_input($_POST['width']);
    $width = ($tmp_value=='') ? "null" : $tmp_value;

    

    $sql_data_array = array('extra_field' => $extra_field,
  						'text_1' => $text_1,
  						'text_2' => $text_2,
  						'text_3' => $text_3,
  						'text_4' => $text_4,
                            'file_1' => $file_1,
                            'file_2' => $file_2,
                            'file_3' => $file_3,
                            'file_4' => $file_4,
                            'file_1_title' => $file_1_title,
                            'file_2_title' => $file_2_title,
                            'file_3_title' => $file_3_title,
                            'file_4_title' => $file_4_title,
                            'video' => $video,
                            'video_title' => $video_title,
                            'height'		=> $height,
                            'width'			=> $width
                            
                            );

    zen_db_perform(TABLE_PRODUCT_EXTRA_FIELDS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");
29 Jul 2015, 11:03 AM
#323
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

You are making this very hard when it is not.

There are only a few files in the upload for this mod. All you have to do is grab those same files from the default 1.5.4 and upload them. Look at the readme for a list.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

30 Jul 2015, 11:30 AM
#326
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

What do you mean try it out?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

28 Nov 2015, 11:28 AM
#327
giuly avatar

giuly

Zen Follower

Join Date:
May 2007
Location:
Italy
Posts:
438
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

hello thanks for your mod, I installed successfully in fact I see in admin, but i insert values and they don't appear on product page.
I have ZC 1.5.4

I upload every folder (included tabproductsv1.10) under my site, and I run the .sql correctly, but the only problem is that don't appear on product page, in admin appears correctly.

Please, thanks in advance Attachment 15830

28 Nov 2015, 12:45 PM
#328
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

Did you change the template folder name to the name of your custom template?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

28 Nov 2015, 1:21 PM
#329
giuly avatar

giuly

Zen Follower

Join Date:
May 2007
Location:
Italy
Posts:
438
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

yes obviously
It is a demo site, in which I charge a test product, if you want to see the link is
www_giocattoliamo_it/prova
and in home page there is the test product
thanks

28 Nov 2015, 3:54 PM
#330
giuly avatar

giuly

Zen Follower

Join Date:
May 2007
Location:
Italy
Posts:
438
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

if you want i can give to you data access in some way, I would need of this mod please

14 Jan 2016, 11:34 AM
#331
teaj avatar

teaj

New Zenner

Join Date:
Dec 2007
Location:
South, UK
Posts:
66
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

kdays:

modules/product_listing.php is not part of this mod.

It works great for the product **info **page but I also need the field to show on the product **listing **page.

Have you done this before?

delia:

haven't done it but is doable. PM me.

Hello, I would also like to display these extra fields on the Product Listing page....is there some code / more info available?

Has any body acheived this? I had a go but no joy yet....

Thanks!

14 Jan 2016, 1:01 PM
#332
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

Sorry, I'm having surgery tomorrow and have been a bit off recently. I don't know what you are doing wrong but you've missed something somewhere. Are you saying that you have put in the extra information and when looking at that particular product, it doesn't show on the product page?

Did you change the folder names before you uploaded the includes folder?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

14 Jan 2016, 1:13 PM
#333
teaj avatar

teaj

New Zenner

Join Date:
Dec 2007
Location:
South, UK
Posts:
66
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

The extra fields are all working fine on the product info page...I would just like to display the extra field(s) on the product listing page too.

Good luck with your surgery....hope it goes smoothly and isn't too major.

Thanks

14 Jan 2016, 1:20 PM
#334
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

oh, that's totally different and is not in the mod.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

26 Apr 2016, 3:07 AM
#335
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

Hi Delia,

I have installed this mod on the newest versions of Zen Cart. Everything is installed but I have made two extra fields for Materials & Dimensions. After I enter them it doesn't show up on Product Info page(s).

26 Apr 2016, 11:14 AM
#336
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

are you sure you added the changes to the product info template?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

26 Apr 2016, 2:31 PM
#337
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

delia:

are you sure you added the changes to the product info template?

Yes I did and it didn't change or work at all.

26 Apr 2016, 2:35 PM
#338
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

well, it does work properly if installed properly - just to be clear. I have not upgraded this mod for 1.5.5. If you are using it on 1.5.5, then I can't speak to what your problem may be. But I don't expect there to be anything in 1.5.5 that prevents it from working.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

26 Apr 2016, 2:57 PM
#339
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

delia:

well, it does work properly if installed properly - just to be clear. I have not upgraded this mod for 1.5.5. If you are using it on 1.5.5, then I can't speak to what your problem may be. But I don't expect there to be anything in 1.5.5 that prevents it from working.

Well I re-upload the files indvidually and install all SQL files and still doesn't work.

26 Apr 2016, 3:13 PM
#340
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

What version of zen cart?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo