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

Product Extra Fields for text, pdfs and flash

Views: 74,656

Results 21 to 40 of 381
7 Jul 2009, 11:39 AM
#21
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

7 Jul 2009, 12:05 PM
#22
ellivir avatar

ellivir

Zen Follower

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

Re: Product Extra Fields for text, pdfs and flash

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?

I may be blond but at least I found Zen.

7 Jul 2009, 1:10 PM
#23
ellivir avatar

ellivir

Zen Follower

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

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.

I may be blond but at least I found Zen.

11 Jul 2009, 8:29 AM
#24
ellivir avatar

ellivir

Zen Follower

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

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

I may be blond but at least I found Zen.

11 Jul 2009, 1:03 PM
#25
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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!

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

13 Jul 2009, 3:22 PM
#26
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

13 Jul 2009, 4:11 PM
#27
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

thanks Glenn. There's definitely an error there somewhere in his code. Please check it!

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

14 Jul 2009, 1:56 AM
#28
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Product Extra Fields for text, pdfs and flash

Looking at the posted code with PHP highlighting...```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>'; } ?> ```
14 Jul 2009, 2:15 AM
#29
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

<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 ?>
15 Jul 2009, 10:02 PM
#30
ellivir avatar

ellivir

Zen Follower

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

Re: Product Extra Fields for text, pdfs and flash

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! :)

I may be blond but at least I found Zen.

12 Aug 2009, 11:33 AM
#31
mikebackhouse avatar

mikebackhouse

New Zenner

Join Date:
Jan 2008
Posts:
37
Plugin Contributions:
0

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

12 Aug 2009, 2:00 PM
#32
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

13 Aug 2009, 10:39 AM
#33
mikebackhouse avatar

mikebackhouse

New Zenner

Join Date:
Jan 2008
Posts:
37
Plugin Contributions:
0

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:

18 Aug 2009, 12:17 PM
#34
jezjones29 avatar

jezjones29

New Zenner

Join Date:
Sep 2006
Posts:
22
Plugin Contributions:
0

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

19 Aug 2009, 9:31 AM
#35
patrickuzu avatar

patrickuzu

New Zenner

Join Date:
Aug 2009
Posts:
6
Plugin Contributions:
1

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

19 Aug 2009, 11:52 AM
#36
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

27 Aug 2009, 7:59 PM
#37
ellivir avatar

ellivir

Zen Follower

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

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

I may be blond but at least I found Zen.

27 Aug 2009, 8:01 PM
#38
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

27 Aug 2009, 8:24 PM
#39
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 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).

I may be blond but at least I found Zen.

27 Aug 2009, 8:49 PM
#40
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

can be coded, yes, but it would not simple.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo