Re: Product Extra Fields for text, pdfs and flash
Remove the following code from admin/includes/modules/new_product_preview.php:
Quote:
//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)
Quote:
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):
Quote:
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'] : '');
}
Re: Product Extra Fields for text, pdfs and flash
remove from admin/includes/modules/update_product.php
Quote:
//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);
&
Quote:
//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 . "'");
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.
Re: Product Extra Fields for text, pdfs and flash
Thanks so much Delia. I am a novice - and learning on the fly. I was in a bit of a panic.
Re: Product Extra Fields for text, pdfs and flash
Sorted :)
Would you be interested in trying it out with temporary access?
Re: Product Extra Fields for text, pdfs and flash
What do you mean try it out?
1 Attachment(s)
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
Re: Product Extra Fields for text, pdfs and flash
Did you change the template folder name to the name of your custom template?
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
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