-
Product Extra Fields for text, pdfs and flash
I have created a new contribution for adding in new fields to the product pages. It should be available by May 18, 2009 in the contribution section. Below is the readme file for the contribution:
https://www.zen-cart.com/downloads.php?do=file&id=926
Quote:
Contribution: Product Extra Fields Mod
Version: 1.0
Updated: 5/17/2009
Designed for: Zencart 1.3.8 (not tested in any other version)
This mod is based on the work done by Mariusz Józala of
http://zencart.aetas.pl. His mod is called extra description files and is not to be confused with this one. I have cleaned up his code, made it more zen cart compatible and added the flash to it.
This mod creates one extra text field, 4 fields that are designed for pdf uploads and one field for a flash video with adjustable size.
There are changed files - note the use of override files for page templates that should go into your template directory. Do not upload the template directory without changing the folder name (your_template) in the package.
Included in this text file:
Directions
Warnings
Files list
CSS directions
-------------------------------------------------------------------
Directions:
Change template directory name (see above)
Upload all files.
Change permissions on new directory : product_extra_files
Apply sql patch
You're done! (unless you already have products in your cart - see warning below)
--------------------------------------------------------------------
Warnings:
There is no file extension check on the uploads. All fields will upload any file so
1) be sure your flash file has the appropriate ending (swf, most likely)
2) you may upload any file to be viewed with your product, such as any size image (up to your server limit of course), any word, excel or php file, etc. Anyone who uses this really should restrict the upload files to pdfs as these are the safest files to have on your website.
File deletions and overwrites: Once you delete a product or change the files for a product, the old files never fade away. Uploading a file with the same name will overwrite that file
If you are installing this into a cart that already has products, you will have to populate the new table with every product id in order for the products to be visible. This is not hard to do with excel and phpmyadmin. If you have access to your database, export the file to excel, add the fields and import it back in.
---------------------------------------------------------------------
Admin Modified Files:
admin/includes/modules/product/collect_info.php
admin/includes/modules/product/preview_info.php
admin/includes/modules/new_product_preview.php
admin/includes/modules/update_product.php
Admin New Files:
admin/includes/extra_datafiles/product_database_names.php
admin/includes/languages/english/extra_definitions/product.php
Cart Modified Files:
includes/modules/pages/product_info/main_template_vars_product_type.php
includes/templates/your_template/templates/tpl_product_info_display.php
Cart New Files:
includes/extra_datafiles/product_database_names.php
includes/modules/pages/product_info/jscript_main.js
includes/modules/popup_flash/header_php.php
includes/modules/popup_flash/jscript_AC_RunActiveContent.js
includes/modules/popup_flash/jscript_main.js
includes/templates/your_template/popup_flash/tpl_main_page.php
New upload directory:
product_extra_files/ (set permissions at 777 - where your files will be uploaded to.
-------------------------------------------------------------------
CSS style tips:
Here is the suggested minimum css for the product page layout. Just add these lines to the end of your CSS if you want.
.files {
clear:left; float:left;
}
.filesHead {
font-weight: bold; margin-bottom: 5px;
}
I did create these items into a unordered list so many other things can also be done with these block as well.
-
Re: Product Extra Fields for text, pdfs and flash
Thanks for developing this kind of module. But how to download it please mark a link.
-
Re: Product Extra Fields for text, pdfs and flash
This is exactly what I have been waiting for. :clap:When do you think it will be available?
Many Thanks.
-
Re: Product Extra Fields for text, pdfs and flash
Hi,
I can get the fields for the product on the admin site but no changes appears in the cart site. I have uploaded all the files, including the template where is defines where the link should be but can't get anything visible. The file also gets uploaded to the folder "download" in the server.
My installation is in a sub-folder. Should I make some changes due to that?
SQL script is still the same like in the previous version? I have also prefix in the db tables. Is the admin adding that when using SQL tool or should I make something for that as well? Anyhow the admin side looks like working but the front-end won't show anything.
Elli
-
Re: Product Extra Fields for text, pdfs and flash
Did you change the template folder name to your override folder name? If you just uploaded the files, you have a problem with that.
-
Re: Product Extra Fields for text, pdfs and flash
The first extra field is now a textarea that can be used for embedding a YouTube video by the way.
One note: the extra-field that can be used for the youtube video has to be used without the editor. Either turn off the editor or click the source button and paste in the link.
-
1 Attachment(s)
Re: Product Extra Fields for text, pdfs and flash
Thanks Delia for the download link to get your contribution! Now I got some change on the site but not yet really working. I switched on the classic green template in order to skip possible issues with templating and of course put the needed files under classic template folder then. Not much success but it appeared a html button with text "UN_FILENAME_WISHLIST" there. If you click the button, it goes to a page "page not found". Please look the picture file attached here.
So, looks like some definition file is missing for the language. In which one that text should be in?
-
Re: Product Extra Fields for text, pdfs and flash
I'm so sorry! I totally blanked on the fact that I was using a template from a specific website. I have to change that and up load the changed files. I'll let you know when it's ready.
-
Re: Product Extra Fields for text, pdfs and flash
Okay, this the link to the corrected package and I am adding in the corrected template to the original link package as well so as not to leave anyone out in the night!
http://www.zen-cart.com/index.php?ma...oducts_id=1331
If you want instructions, just open up this file from either your default template directory or your already modded custom file:
tpl_product_info_display.php
Paste these lines in right after the product descripton - about at line 85
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>';
}?>
<?php if(isset($extra_field)) {
echo '<li>'.$extra_field . '</li>';
} ?>
<?php if(isset($products_video_link)) {
echo '<li>'.$products_video_link . '</li>';
} ?>
<?php if(isset($products_file_1_link)) {
echo '<li>'.$products_file_1_link . '</li>';
} ?>
<?php if(isset($products_file_2_link)) {
echo '<li>'.$products_file_2_link . '</li>';
} ?>
<?php if(isset($products_file_3_link)) {
echo '<li>'.$products_file_3_link. '</li>';
} ?>
<?php if(isset($products_file_4_link)) {
echo '<li>'.$products_file_4_link;
}
echo '<ul>';
?>
</div>
-
Re: Product Extra Fields for text, pdfs and flash
You're fast to contribute. That's very nice from you.
Elli
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
delia
fast - but not totally accurate, huh?
now it works:
- -
Yes, well, we will forgive you that. ;) After all this is open-source and by co-operating we all will benefit.
By the way, would you have any knowledge how to hide a part of description or totally if you are not logged in?
I have been asking it elsewhere here but didn't get an answer from anybody. I think it is technically somehow related to this kind of extra descriptions.
The idea is that the prices are hidden (like standard ZC lets you to set up) but in this case part of the "tailored" price info would be also in description, so that should be hidden too if customer is not authorised to see that part of the description.
I think it needs only to know which file is controlling this hiding for the prices and then implement the same conditions for the description or part of it.
Elli
-
Re: Product Extra Fields for text, pdfs and flash
The following code controls the showroom - no prices, I think. Just use that with the part of the extra fields you want hidden. You can't use it with part of the regular description.
I found another error in the template file by the way. If your file is working I wouldn't worry about it but I have updated the zip zile on my server.
Full example using the extra_field:
PHP Code:
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
// do nothing
}
else {
if(isset($extra_field)) {
echo '<li>'.$extra_field . '</li>';
}
}
-
Re: Product Extra Fields for text, pdfs and flash
Aren't those just admin settings or values? You would still need to check if the particular customer was logged in with
PHP Code:
if ($_SESSION['customer_id']) {//logged in
//do something
}
-
Re: Product Extra Fields for text, pdfs and flash
I'm assuming that's already happening since that is already in the file. Of course, I haven't tested this.
-
Re: Product Extra Fields for text, pdfs and flash
OK, if that test is already done earlier in the file section, it's probably good to go.
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
delia
The following code controls the showroom - no prices, I think. Just use that with the part of the extra fields you want hidden. You can't use it with part of the regular description.
I found another error in the template file by the way. If your file is working I wouldn't worry about it but I have updated the zip zile on my server.
Thanks for the tips. I will look on that.
I tried the previous zip and when pushing the category link in the sidebox the whole page went blank.
I'm gonna test now if your fix helps on that or it can be also issued by the earlier installation of the "Extra description files". There may be some files left from that installation that hasn't been overwritten or removed and are causing the conflict.
-
Re: Product Extra Fields for text, pdfs and flash
-
Re: Product Extra Fields for text, pdfs and flash
ThanksDelia,
Look froward to installing it.
-
Re: Product Extra Fields for text, pdfs and flash
I have build a test webshop just to try this Delia's extra fields there first before installing it to the real shop.
I ran to a lots of problems and thus I had to take a pause and make other productive things for a while.
The sql in the pack has been installed both with and without prefix to the database, just to try if any of them should work but it didn't. The new database table remains empty.
The error that comes when I open the admin product info form:
Warning: reset() [function.reset]: Passed variable is not an array or object in /home/myserver/public_html/webshop/admin/includes/classes/object_info.php on line 29
Warning: Variable passed to each() is not an array or object in /home/myserver/public_html/webshop/admin/includes/classes/object_info.php on line 30
Product in Category: "Prefix category"
I created new category called "Prefix category" after installing the database table with the prefix (first was without) and then I made new products there but just doesn't save those product ids either. So I can't get an example either how I should fix the previous test product ids.
The files should all be in the server in their right place and I checked that many times.
In the product form the master category doesn't exist at all, so not even zero, just nothing like this "Product Master Category: ID# "
Is that making any difference here?
It would be just nice to find a solution for this.
Elli
-
Re: Product Extra Fields for text, pdfs and flash
Now I got the extra fields installed. If it helps anybody, the problem was that there was still traces of the module "PRODUCT_EXTRA_DESCRIPTION_EXTRA" (original extra field module by "aetas") in my test webshop. I went thoroughly through all the files that I should removed or replace from the standard Zencart files and then I put again the ones made by Delia and I started to get it working.
Now I will test how to get one of these extra fields hidden when the price is hidden as well.
-
Re: Product Extra Fields for text, pdfs and flash
can you give me examples of what you found? And did you use one in the contribution section or one I hosted briefly on my website?
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
delia
can you give me examples of what you found? And did you use one in the contribution section or one I hosted briefly on my website?
In the admin -> includes -> modules -> product, I had too many edited files, so I removed all of them and put from the standard copy of ZC the original ones and then I replaced them by using your package from the Add-ons.
I have the copies of your links as well but I used here the Add-on (contribution) package made by you.
Also the database had still the product_extra_description_extra table that was not needed anymore and I removed it. It hadn't got removed earlier because I didn't realise to put my prefix in the sql in phpmyadmin.
Now looking the idea for hiding the extra field when having the price hidden with the idea you said earlier. Is it the template file where this "switch" should be?
-
Re: Product Extra Fields for text, pdfs and flash
For hiding the extra field (or any of these extras would be ok for now) when having the customer detail for authorization in "2" or "3" and the customer shop status as "2" as well, I tried to change the code like this for tpl_product_info_display.php:
- -
<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>';
}?>
<?php if(isset($extra_field)) and (CUSTOMERS_APPROVAL == 2 and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) {
// do nothing
}
else {
echo '<li>'.$extra_field . '</li>';
} ?>
- -
But now my product part of the page goes blank, so there is some error in this structure.
I noted that the hiding prices (standard solution) is not done inside the template file, so maybe there is another way to do this as well.
-
Re: Product Extra Fields for text, pdfs and flash
I still get a blank page issue with my code, couldn't find what is wrong with that.
There must be some error in this structure. I haven't changed anything else than the above part for the file tpl_product_info_display.php.
Any ideas to solve this?
Thanks!
Elli
-
Re: Product Extra Fields for text, pdfs and flash
You've got a php error in the do nothing line - use of and instead of && - but I'm not a php wizard!
-
Re: Product Extra Fields for text, pdfs and flash
"and" and "&&" are practically interchangeable, as are "or" and "||". There are subtle differences in precedence, but they will both work. Depending on precedence rules for organizing multiple logic tests is not generally a good idea anyway - better to make the order explicit with parentheses.
-
Re: Product Extra Fields for text, pdfs and flash
thanks Glenn. There's definitely an error there somewhere in his code. Please check it!
-
Re: Product Extra Fields for text, pdfs and flash
Looking at the posted code with PHP highlighting...
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>';
}?>
<?php if(isset($extra_field)) and (CUSTOMERS_APPROVAL == 2 and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) {
// do nothing
}
else {
echo '<li>'.$extra_field . '</li>';
} ?>
-
Re: Product Extra Fields for text, pdfs and flash
There is one PHP error:
if(isset($extra_field)) and (CUSTOMERS_APPROVAL == 2 and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) {
has an extra ) that makes PHP think the conditional test is done too soon.
There is also a logic error that could result in outputting a bare <li> with null content. Moving the $extra_field code to inside the products_file_1_link loop should eliminate that possibility.
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>';
?>
<?php
if(isset($extra_field) and (CUSTOMERS_APPROVAL == 2 and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) {
// do nothing
}
else {
echo '<li>'.$extra_field . '</li>';
}
}// /if prod_file_1 ?>
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
delia
You've got a php error in the do nothing line - use of and instead of && - but I'm not a php wizard!
hmmm... tried that too, no success so far but definitely it is some structural error in the php. :(
That line of "do nothing" has been used elsewhere in the ZC itself. It can be found via developers tool.
Elli
Editing: I got all the other answers after Delia's only after posting that even if I have refreshed the forum. Funny.
But thanks very much. Time to go to sleep but I'll try tomorrow! :)
-
Re: Product Extra Fields for text, pdfs and flash
Hi all,
Does anyone know why I'm getting the following UL list appear when I dont add any additional files? :
Downloadable Datasheets
* NULL
* NULL
* NULL
* NULL
* NULL
Any products where I HAVE added additional files are fine. I've removed the mod for the time being, but really want to get it working as our customers need PDF's.
Fantastic contribution by the way Delia! Thank you! :clap: I just hope i can get it working properly
-
Re: Product Extra Fields for text, pdfs and flash
Looks like you have put NULL in the database field. Did you add this into an cart with existing products? Or are these fields created by the sql that came with the mod?
The solution is to clean up those fields and I can give you a sql statement you can run to do that but we need to figure out how this happened.
-
Re: Product Extra Fields for text, pdfs and flash
Hi Delia
Thanks for your reply.. yes there were products in there in the 1st place. I've spoken to our techy/servery type guy.. and he admits he may not have copied the tables properly in the database!
He's going to take a look at it in the next few days, i'll let you know how I get on
Thank you! :smile:
-
Re: Product Extra Fields for text, pdfs and flash
hi, thanx for this great mod. The only problem I have is when I try and copy a product. Please can you confirm that this works?
When I copy a product at the moment, the new item just gives me errors:
Warning: reset() [function.reset]: Passed variable is not an array or object in /home/cashback/public_html/....../includes/classes/object_info.php on line 29
Warning: Variable passed to each() is not an array or object in /home/cashback/public_html/....../admin/includes/classes/object_info.php on line 30
-
Re: Product Extra Fields for text, pdfs and flash
Hi
Well this contribution.
When you delete an item, the field in the table "product_extra_field" is not deleted.
A solution?
Thank you
Patrick
-
Re: Product Extra Fields for text, pdfs and flash
Will someone who has this installed try copying a product and see if you get the same results as jezjones29?
Nope, it's not added into the delete file - when I get a chance I'll do that and probably attend to the copy function as well.
-
Re: Product Extra Fields for text, pdfs and flash
Just trying to populate finally the old products in the shop to have their id in the product_extra_fields
- so, reading above, should I not put NULL in those fields I have nothing? I made an example, took the db structure out from the database and I've been building all hundreds of products like this in a spreadsheet: (1044, '<br />', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
- if the product id needs to be in the table product_extra_fields, can I update the site anymore with Easy Populate?!
Elli
-
Re: Product Extra Fields for text, pdfs and flash
The fields should be left empty if there's nothing there. And no, easy populate will not populate these fields - it will still work however, no changes to the rest of the product database setup.
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
delia
The fields should be left empty if there's nothing there. And no, easy populate will not populate these fields - it will still work however, no changes to the rest of the product database setup.
Maybe there is a way to make the Easy Populate to populate this too or what is the wisest to fix that the populated once would work too?
Otherwise comes on error I guess (like now with the old products).
-
Re: Product Extra Fields for text, pdfs and flash
can be coded, yes, but it would not simple.
-
Re: Product Extra Fields for text, pdfs and flash
Ou. :(
I was reading here meanwhile the code of easypopulate.php but there are lots of stuff indeed...
tips could be welcome!
-
Re: Product Extra Fields for text, pdfs and flash
I've never even looked at the code but it would be primarily twofold. Adding the table to import and the text file for export. There is some other stuff there too but that's about all I actually know about it.
-
Re: Product Extra Fields for text, pdfs and flash
Hi Delia,
I've asked a forum question under "General" about some additional functionality I need that looks very similar in concept to what you have done here. From the comments on the forum you look like an expert!
Basically I need to add a set of check-boxes (from a table) to each product. I suspect it is too complicated for me to do, and I have a little budget available if it is going to take up your time.
Please have a look at the general area and email me if you might be prepared to look at a new or adapted module for me.
Kind regards
Dianne
-
Re: Product Extra Fields for text, pdfs and flash
hello
I have this message when I copy an item, how to solve this problem?
---
Warning: reset() [function.reset]: Passed variable is not an array or object in C:\Program Files\EasyPHP 2.0b1\www\xxx\admin\includes\classes\object_info.php on line 29
Warning: Variable passed to each() is not an array or object in C:\Program Files\EasyPHP 2.0b1\www\xxx\admin\includes\classes\object_info.php on line 30
----
Thank you very much for your help
Patrick
Version Zencart 1.3.8
-
Re: Product Extra Fields for text, pdfs and flash
I just see it when you copy the product, the table "product_extra_fields" is not updated.
An idea?
Thank you
Patrick
-
Re: Product Extra Fields for text, pdfs and flash
OK, I applied the product_extra_files mod and am unclear as to how/where the extra files' definitions should appear. I've got an off-line installation of zen-cart 1.38a with the security mods applied.
There is currently 1 category with 2 products in my database. I tried creating a new category and adding a new product to it, but there is no opportunity to define the additional files.
Please help ...
-
Re: Product Extra Fields for text, pdfs and flash
Never mind, it's just me being dumb (again!). I loaded my store directory, but never applied the admin patches.:oops:
-
Product Extra Fields & Ceon URI Mapping (SEO)
Hi Delia,
After read all the threads, I still can not find the answer with my problem now.
I had added 'Product Extra Fields' without any problem and then I also added another module 'Ceon URI Mapping (SEO)' before I copy the completely folder for moving to under my another domain name.
When I check every modules which I have added that I found out the 'Product Extra Fields' doesn't exsist in my admin any more, so I check it back if every files are located in the correct locations and they are all correctly. Check on my shop, the extra information and files which I added/uploaded are still showed on the site. So, I decided to re-write the admin file of 'Product Extra Fields'. And then it appear again on the admin, but at the same time the 'Ceon URI Mapping (SEO)' select/add box is gone.
Could you please tell me how/what I should do for those two modules appear on the same page when I add the new product?
Christine
-
Re: Product Extra Fields & Ceon URI Mapping (SEO)
Quote:
Originally Posted by
ziamo
Hi Delia,
After read all the threads, I still can not find the answer with my problem now.
I had added 'Product Extra Fields' without any problem and then I also added another module 'Ceon URI Mapping (SEO)' before I copy the completely folder for moving to under my another domain name.
When I check every modules which I have added that I found out the 'Product Extra Fields' doesn't exsist in my admin any more, so I check it back if every files are located in the correct locations and they are all correctly. Check on my shop, the extra information and files which I added/uploaded are still showed on the site. So, I decided to re-write the admin file of 'Product Extra Fields'. And then it appear again on the admin, but at the same time the 'Ceon URI Mapping (SEO)' select/add box is gone.
Could you please tell me how/what I should do for those two modules appear on the same page when I add the new product?
Christine
Hi,
I've got the answer of my problem and fix it already. Just like to post and share it with people who also have the same problem with those 2 modules "Product Extra Fields & Ceon URI Mapping (SEO)".
I change those two modules with the software "Winmerge" from below 3 files:
#admin/includes/modules/update_product.php
#admin/includes/modules/product/collect_info.php
#admin/includes/modules/product/preview_info.php
Right now, everything is functional. :clap:
-
Re: Product Extra Fields for text, pdfs and flash
diannev - contact me via private message if you will. I cant' seem to find your info.
-
Re: Product Extra Fields for text, pdfs and flash
i installed the module in my test site but i don't know how to add the product id in the product_extra_fields table through excel with phpmyadmin and than import again in the database
Could someone explain me please how to do that ?
:frusty:
thank you
-
Re: Product Extra Fields for text, pdfs and flash
You're not going to affect the "product id" with an extra field - that is set automatically when the product is created, and you should not try to change it. If you mean the product's model number, that is something you can input when creating/editing the product, but not subject to the extra fields in this mod.
You will have to explain in more detail what number you are talking about, and Delia will have to be the one to answer, as I don't know the code for this mod.
-
Re: Product Extra Fields for text, pdfs and flash
right ..i mean when Delia says
Quote:
If you are installing this into a cart that already has products, you will have to populate the new table with every product id in order for the products to be visible. This is not hard to do with excel and phpmyadmin. If you have access to your database, export the file to excel, add the fields and import it back in.
When i try to upload a file into the description the product disappears due to Product Master Category: ID# that is missing
how does i do that in practice ?
-
Re: Product Extra Fields for text, pdfs and flash
I got enough of dealing HTMLarea and installed FCKeditor. All went fine with the installation itself and the new editor appears when making a new product on the standard text areas but in the "Extra Text Field" it comes just as plain text, no editor at all.
What shall I do?
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
ellivir
I got enough of dealing HTMLarea and installed FCKeditor. All went fine with the installation itself and the new editor appears when making a new product on the standard text areas but in the "Extra Text Field" it comes just as plain text, no editor at all.
What shall I do?
personally i prefer tiny mce on zen ..anyway have you activated it in the admin and under the products /category ?
Personally it's a week that i'm waiting a reply from delia about her "easy" phpmyadmin product id modify.
Maybe i'm retarded but i didn't understand
-
Re: Product Extra Fields for text, pdfs and flash
@emilio: Here's what I did to get the product_extra_fields on products that were in my catalog before I applied the PEF add-on:
NOTE: Backup your database before you do this stuff (in case it goes wrong).
Start phpMyAdmin. If you've installed PEF correctly, you'll see a product_extra_fields table within your zen-cart database.
If that's there, go to your product table and write down the products_id values for all the products that you want to have the extra fields. Now, click on the product_extra_fields table name on the left-side of the display. Up at the top of the screen, click the Insert tab and you're presented with an entry screen to create a new entry in the PEF table.
For each of the products_id values that you want to have the extra fields: enter the products_id number in the products_id Value element of the form, enter in the extra_field Value element of the form, and keep the Null checkbox checked for all other elements. Click "Go"; that will add an element in the PEF table for that products_id.
Note: If you have a bunch of products_id's to add, make sure to look at the bottom of the page and select "Insert another new row" as the action to take after the current row is added.
It's cumbersome, but it worked for me!
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
lat9
@emilio: Here's what I did to get the product_extra_fields on products that were in my catalog before I applied the PEF add-on:
NOTE: Backup your database before you do this stuff (in case it goes wrong).
Start phpMyAdmin. If you've installed PEF correctly, you'll see a product_extra_fields table within your zen-cart database.
If that's there, go to your product table and write down the products_id values for all the products that you want to have the extra fields. Now, click on the product_extra_fields table name on the left-side of the display. Up at the top of the screen, click the Insert tab and you're presented with an entry screen to create a new entry in the PEF table.
For each of the products_id values that you want to have the extra fields: enter the products_id number in the products_id Value element of the form, enter in the extra_field Value element of the form, and keep the Null checkbox checked for all other elements. Click "Go"; that will add an element in the PEF table for that products_id.
Note: If you have a bunch of products_id's to add, make sure to look at the bottom of the page and select "Insert another new row" as the action to take after the current row is added.
It's cumbersome, but it worked for me!
thank you buddy for the help.
is very difficult to have support here in zen-cart
i started with zen about 6 7 years ago but now i'm moving to joomla + vm because of this .... poor support especially international (...)
It's a pity because zen was a milestone in ecommerce ....
People needs to be more in collaboration and take off the nerd coder behaviour ..using simple words ...thinking that everyone can give his support.
thanks again
Emilio
-
Extra <li> generated
There's (at a minimum) an extra empty <li> generated when a product is created after the product_extra_fields add-on is installed. The problem is that the default value for the extra_field element is (which is not an empty string).
What I did to correct this was to take the code at line 37 in \includes\modules\pages\product_info\main_page_vars_product_type.php:
Code:
$extra_field = $files->fields['extra_field'];
and expand it to:
Code:
$extra_field = $files->fields['extra_field'];
if (!empty($extra_field) && $extra_field == ' ') $extra_field = '';
That makes empty($extra_field) to be true for the processing in the product_info display.
-
Re: Product Extra Fields for text, pdfs and flash
Sorry about being awol, guys! Been under the weather.
First of all, the absolute best way to create the correct fields and rows after installing this is to do it via excel. lat9 is right about the way he did his cart. However, some folks may find that to be cumbersome and may not even work for others. You need to create a row for every product you have not just the ones you think you need this on.
First, export the product_extra_fields table via phpmyadmin. Choose excel csv as the type of export and you may need to experiment to see which opens correctly in your version of excel but the csv works for me. Be sure not to leave NULL in the blank for filler for empty space.
Open that file in excel. Fill in the product id numbers for every product (type 1,2,3,4,5 - select and draw the column down to easily create your product id numbers). Save the file as csv and import in phymyadmin. Put a comma in Fields terminated by where it defaults to semicolon. Be sure to check the box to replace the table data.
I am aware that copying and deleting the product does not work correctly and will be fixing once I get a chance to do that.
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
emilio
personally i prefer tiny mce on zen ..anyway have you activated it in the admin and under the products /category ?
Personally it's a week that i'm waiting a reply from delia about her "easy" phpmyadmin product id modify.
Maybe i'm retarded but i didn't understand
So, the editor DOES APPEAR with the normal product description area but not with the extra field that this Delia's contribution adds into product information.
Editor is activated but just doesn't appear for the extra field, for other places it comes visible.
Elli
-
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
-
Re: Product Extra Fields for text, pdfs and flash
I like this contrib, it's very easy to install and use.
I have some questions, though.
1) How do i get the extra fields to be multi-lingual?
2) How do i make extra description NOT be part of main description? I'm using 'tabbed products pro' addon and would like to have the extra description in a seperate tab.
-
Re: Product Extra Fields for text, pdfs and flash
OK, first, my apologies for my mistake - it's not a part of products main description. I wasn't looking carefully. :frusty:
Now, I found another problem - my flash files aren't working. They are normally uploaded, but don't play in the popup. What could be causing this?
BTW, I'm still looking for a way to have this mod multi-lingual...
-
Re: Product Extra Fields for text, pdfs and flash
Since I have applied this mod I get this error on Product info page in Admin area:
Code:
Warning: reset() [function.reset]: Passed variable is not an array or object in D:\xampplite\htdocs\shop\admin\includes\classes\object_info.php on line 29
Warning: Variable passed to each() is not an array or object in D:\xampplite\htdocs\shop\admin\includes\classes\object_info.php on line 30
Previous values are not populating anywhere.
Any Solution or at least tell me how to revert old settings.
-
Re: Product Extra Fields for text, pdfs and flash
That either comes from installing the mod incorrectly or something else. The file references is not one changed by the mod.
When do you get the error?
-
Re: Product Extra Fields for text, pdfs and flash
Reading back thru the thread I saw that happens when you try to copy a product which wasn't tended to in the present release. I'm going to see if I can't get that working today.
Quote:
Originally Posted by
Pathan
Since I have applied this mod I get this error on Product info page in Admin area:
Code:
Warning: reset() [function.reset]: Passed variable is not an array or object in D:\xampplite\htdocs\shop\admin\includes\classes\object_info.php on line 29
Warning: Variable passed to each() is not an array or object in D:\xampplite\htdocs\shop\admin\includes\classes\object_info.php on line 30
Previous values are not populating anywhere.
Any Solution or at least tell me how to revert old settings.
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
balihr
I like this contrib, it's very easy to install and use.
I have some questions, though.
1) How do i get the extra fields to be multi-lingual?
2) How do i make extra description NOT be part of main description? I'm using 'tabbed products pro' addon and would like to have the extra description in a seperate tab.
That would require some recoding of many of the files and changing the database. Not a newbie task at all.
-
Re: Product Extra Fields for text, pdfs and flash
I have the fixes, delete and copy edits done and would like someone to test them as I don't actually have a cart I can play with right now. Just let me know and I'll send you the link to the files.
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
delia
I have the fixes, delete and copy edits done and would like someone to test them as I don't actually have a cart I can play with right now. Just let me know and I'll send you the link to the files.
HI,
I am interested. The above error occurs when I install the mode. I followed the instructions given in readme file.
-
Re: Product Extra Fields for text, pdfs and flash
I'm not sure what fixes, but if you give a short explanation, I'm willing to give it a try.
BTW, do you have any idea why my flash files don't work in the popup? I just get a blank popup with "close window" lines.
And, I gave up on the multilingual extra and on a special tab, now i just need the flash working in the popup...
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
Pathan
HI,
I am interested. The above error occurs when I install the mode. I followed the instructions given in readme file.
What error?
balihr: I haven't had any other complaints about the flash - what browser are you using to view?
-
Re: Product Extra Fields for text, pdfs and flash
Firefox 3.0.17, IE9, Opera 10.10
every time i get the same thing
Do i have to install something else before this module? I've tried on a clean install...
-
Re: Product Extra Fields for text, pdfs and flash
give me a url to see so I can look at the source code
-
Re: Product Extra Fields for text, pdfs and flash
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
delia
I have the fixes, delete and copy edits done and would like someone to test them as I don't actually have a cart I can play with right now. Just let me know and I'll send you the link to the files.
Delia
I am interested in corrections files, you can send me the link files by MP. I perform the tests.
Thank you
Patrick
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
Pathan
Since I have applied this mod I get this error on Product info page in Admin area:
Code:
Warning: reset() [function.reset]: Passed variable is not an array or object in D:\xampplite\htdocs\shop\admin\includes\classes\object_info.php on line 29
Warning: Variable passed to each() is not an array or object in D:\xampplite\htdocs\shop\admin\includes\classes\object_info.php on line 30
Previous values are not populating anywhere.
Any Solution or at least tell me how to revert old settings.
I am having the very same problem. Anyone know of a fix for this error when copying products?
-
Re: Product Extra Fields for text, pdfs and flash
Working on a solution now. I had not incorporated the copy function before.
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
delia
Working on a solution now. I had not incorporated the copy function before.
Thank you Delia! Please let me know when a fix is released.
-
Re: Product Extra Fields for text, pdfs and flash
I have installed the contribution and have altered it so it only shows extra text fields. Is there a possibility to show these textfields also on the invoice and in the admin orders.
-
Re: Product Extra Fields for text, pdfs and flash
Couldn't find this anywhere in the thread. I would like one of the extra fields to show up on orders in the admin screen.
Do anyone have a good idea for this?
Bernie
-
Re: Product Extra Fields for text, pdfs and flash
since this mod has nothing to do with orders or attributes, it would have to be coded into the mod. Not easily done and I don't know why you want it. These fields are for extra information, not vital product info.
-
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
kgmmusic
I am having the very same problem. Anyone know of a fix for this error when copying products?
I have installed the Mod, exactly as described in the readme. but i get two errors
1)The Extra Files for them to view dont show up in the store area (pdf data sheets, tech documentation).
2 get this error any time im editing an existing product.
"Warning: reset() [function.reset]: Passed variable is not an array or object in /home/content/s/w/a/swannassoc/html/store/admin/includes/classes/object_info.php on line 29
Warning: Variable passed to each() is not an array or object in /home/content/s/w/a/swannassoc/html/store/admin/includes/classes/object_info.php on line 30 "
i have looked for were the error is coming from but unable to see where and when its comeing from.
-ANdrew
-
Re: Product Extra Fields for text, pdfs and flash
have you added all the existing products into the new database table?
-
Re: Product Extra Fields for text, pdfs and flash
The new version is ready for testing. If you pm me, I'll send you the link to the new files.
-
Re: Product Extra Fields for text, pdfs and flash
Very useful mod for product PDF brochures :)
The magic spell you cast in Phpmyadmin if you have existing products when you intall this mod:
INSERT INTO product_extra_fields (products_id) SELECT products_id FROM products;
Much easier than messing about with excel as suggested earlier in this thread.
Also, I prefer to have my product PDF's kept with my images, so if you do the following the extra files will be uploaded to whatever subdirectory of the images folder you have selected in the "Upload to directory" dropdown on the edit product page:
in new_product_preview.php
if ($_POST['file_1_title'] != '') {
$products_file_1 = new upload('file_1');
$products_file_1->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']);
if ($products_file_1->parse() && $products_file_1->save(true)) {
$products_file_1_name = $_POST['img_dir'] . $products_file_1->filename;
} else {
$products_file_1_name = (isset($_POST['previous_file_1']) ? $_POST['previous_file_1'] : '');
}
}
in preview_info.php
<?php echo "<a href='images/" . $products_file_1_name . "'>" . $pInfo->file_1_title . "</a>"; ?>
in main_template_vars_product_type.php
if (!empty($products_file_1_title)) $products_file_1_link = '<a href="' . "images/" . $products_file_1 . '">'. $products_file_1_title . '</a>';
Obviously modify the file2, 3, & 4 bits in the same way :)
-
Re: Product Extra Fields for text, pdfs and flash
You are quite correct about the sql statement and that is included in the next version.
-
Re: Product Extra Fields for text, pdfs and flash
The newest version is now up in the contributions section!
-
Re: Product Extra Fields for text, pdfs and flash
How do I get the uploaded pdf files to be downloadable? btw great addon!
-
Re: Product Extra Fields for text, pdfs and flash
There are a number of ways for anyone to download a pdf - one is to click the save image once the pdf has opened in the browser window. The other is (in some browsers) to right click and save target or something like that. So you don't need to do anything for your customers to save it. You could, of course, put directions on your product page for that.
-
Re: Product Extra Fields for text, pdfs and flash
Seems that I can't get it to work anyway.. "don't have permission to download file" What permission should it be with the product_extra_files?
-
Re: Product Extra Fields for text, pdfs and flash
what's the url of the product?