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
Re: Product Extra Fields for text, pdfs and flash
When using HTMLarea it does appear. No other editor was specifically integrated for this. I'll look into it when I can but since the extra field was done the same as product description, I think the answer lies with FCKeditor instead of with this mod. I would think that ellivir is on the right track.
Re: Product Extra Fields for text, pdfs and flash
So, this code below seems to be working for adding the FCKeditor for the extra field:
<!-- 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)) ? stripslashes($extra_field) : ($pInfo->extra_field) ;
$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 -->
Anyhow, please have a look if there is anything "dangerous" in the coding itself. This was merely a result of trial and error in this case, so I can't definitely suggest people to follow this if nobody knows this coding to be correct or proper for its usage. I was able to see the extra field content and update it successfully though.
Re: Product Extra Fields for text, pdfs and flash
hello please can I see a demo on this addon in any way?
or a screenshot?
please :smile:
Re: Product Extra Fields for text, pdfs and flash
The extra fields do not show when the product type used is "music". Did I miss something?
Thanks for any help.
Art
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/"
I believe there will be a set of files for each product type, so you would need to do the whole set of additions and edits for /product_music/ files or whatever the exact folder name is.
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
artmuns
The extra fields do not show when the product type used is "music". Did I miss something?
Thanks for any help.
Art
In other words this mod is just for the product - general and not the music or documents,etc. It's for a product type = not all products.
Extra <li> and extra line of text
Delia,
Awesome mod! love it!
I tried Lat9 "update" to get rid of the extra <li> with no luck so i ended removing the <li> straight from the tpl_product_info_display.php.
I still got a small issue:
I got a piece of text saying "TEXT_PRODUCT_MORE_INFO" showing up on top of the extra text field and i can't figure why.
It's probably so obvious that i can't see it :blush:
From the Developers Tool Kit in the Admin, the only place i found "TEXT_PRODUCT_MORE_INFO" is in the tpl_product_info_display.php file:
PHP Code:
<div class="files">
<?php if(isset($products_file_1_link) || isset($products_file_2_link) || isset($products_file_3_link) || isset($products_file_4_link) || isset($video_file_link) || isset($extra_field)) {
echo '<div class="filesHead">'.TEXT_PRODUCT_MORE_INFO.'</div><ul>';
}?>
How can i get rid of the extra line of text?
Thanks,
Damien
http://i294.photobucket.com/albums/m...ScreenShot.jpg
FYI: I moved the extra.field underneath the additional images, the add to cart button, etc...
Re: Product Extra Fields for text, pdfs and flash
To those who might have the same problem, i found out a solution to my problem posted above:
I simply added a definition to my "product_info.php" (the one in includes/languages/MYTEMPLATE/)
PHP Code:
define('TEXT_PRODUCT_MORE_INFO', 'More information: ');
:clap:
Easy enough!
Damien
Re: Product Extra Fields for text, pdfs and flash
HAPPY NEW YEAR from snowy SCOTLAND.
Thank you so much for all the help.... This is a great mod.
I seem to have managed to get it to work ... mostly. The only problem that I have is with the upload files. The text is appearing but the file is not. The links point here:
mydomain.com/Store/product_extra_files//tmp/phpAm4OCf
Can you shed any light on this? I am sure that it is something very simple.
Thanks again
Gillian