Re: Product Extra Fields for text, pdfs and flash
Ok, I found out that it should be added a piece of code in the collect_info.php that is located in admin/includes/modules/product/
added after line 458 in collect_info.php:
<!-- addition: editor for extra field -->
<?php if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") {
$oFCKeditor = new FCKeditor('extra_field',$pInfo->extra_field) ;
$oFCKeditor->Value = (isset($extra_field[$languages[$i]['id']])) ? stripslashes($extra_field[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']) ;
$oFCKeditor->Width = '99%' ;
$oFCKeditor->Height = '350' ;
// $oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ;
// $oFCKeditor->Create() ;
$output = $oFCKeditor->CreateHtml() ; echo $output;
} else { // using HTMLAREA or just raw "source"
echo zen_draw_textarea_field('extra field', 'soft', '100%', '30', stripslashes($pInfo->extra_field));
} ?>
<!-- end of the addition -->
Otherwise it works but can't get the existing value (extra field text content) in to the editor that it could be actually edited.
This means that above line
$oFCKeditor->Value = (isset($extra_field[$languages[$i]['id']])) ? stripslashes($extra_field[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']) ;
should be edited and should there be for example zen_get_extra_field instead of zen_get_products_description?
Then in that case there is no such function and I was trying to build one based on the example of the zen_get_products_description but didn't work out.
Is this function building necessary or there is another way to give the value for the editor?
It seems also that the language and product id's should be replaces by the extra_field id, or?
Elli
I may be blond but at least I found Zen.
Bookmarks