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

Product Extra Fields for text, pdfs and flash

Results 1 to 20 of 381
17 May 2009, 16:51
#1
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

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


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.
18 May 2009, 11:04
#2
amit001 avatar

amit001

New Zenner

Join Date:
Jul 2008
Posts:
46
Plugin Contributions:
0

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.
20 May 2009, 10:56
#3
keyboardcook avatar

keyboardcook

New Zenner

Join Date:
May 2009
Posts:
5
Plugin Contributions:
0

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.
01 Jun 2009, 06:16
#4
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

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
01 Jun 2009, 11:44
#5
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

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.
01 Jun 2009, 11:48
#6
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

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.
01 Jun 2009, 20:54
#7
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

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?
01 Jun 2009, 21:41
#8
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

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.
02 Jun 2009, 18:15
#9
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

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?main_page=product_contrib_info&products_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]<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>[/PHP]
02 Jun 2009, 20:19
#10
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

You're fast to contribute. That's very nice from you.

Elli
03 Jun 2009, 10:22
#11
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

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
03 Jun 2009, 12:10
#12
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

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]
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
// do nothing
}
else {
if(isset($extra_field)) {
echo '<li>'.$extra_field . '</li>';
}
}
[/PHP]
03 Jun 2009, 12:51
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

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]
if ($_SESSION['customer_id']) {//logged in
//do something
}[/php]
03 Jun 2009, 13:10
#14
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

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.
03 Jun 2009, 13:20
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

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.
03 Jun 2009, 13:43
#16
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

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.
10 Jun 2009, 08:53
#18
keyboardcook avatar

keyboardcook

New Zenner

Join Date:
May 2009
Posts:
5
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

ThanksDelia,

Look froward to installing it.
07 Jul 2009, 08:15
#19
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

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
07 Jul 2009, 11:28
#20
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

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.