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

Product Extra Fields for text, pdfs and flash

Views: 74,446

Results 201 to 220 of 381
28 May 2011, 2:59 PM
#201
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Product Extra Fields for text, pdfs and flash

jill8026

your sites seem to achieve what I am after. would you care to share or point me in the right direction. Very much appreciate the help.

Thank you

5 Jun 2011, 12:24 PM
#202
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

wizer:

Thanks for this mod. I just installed it and it seems to be working.

Does the Extra Text Field have to be a large text box? I actually need to enter a 2nd Model Number (Part Number). So just need a short text input box. Is this possible?

Also, would there be a way to link to YouTube videos instead of uploading flash? I know I can cut and paste the embed code, but I would rather have it entered as a field.

You can use that extra text field anyway you want. It still will just list the info on the product page.

I created that field for youtube videos initially. Cut and paste the code into there. But then there is only one field for that kind of use in the mod. The request that lead me to doing this mod was more about attaching pdfs and embedding flash that anything so I only put in one extra generic field. I will add more in the next version - whenever that should be.

5 Jun 2011, 12:37 PM
#203
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

MikeyG:

I wish to use the extra text field for suggested age for my product....Childrens products - eg age 3.

How do I get the advance search to pick up this field and allow a search by age similar to the search by price?

You would have to alter the search function - /includes/modules/pages/advanced_search_result/ header_php.php and then add code for the age searching. Not a small thing.

There are some instructions in this thread: http://www.zen-cart.com/forum/showthread.php?t=131143

5 Jun 2011, 5:43 PM
#204
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

delia,

thank you for the heads up. Not really a php programmer so it is going to keep me busy for a while. ;-)

7 Jul 2011, 2:56 PM
#205
evelt avatar

evelt

Zen Follower

Join Date:
Nov 2009
Location:
In beautyful New York
Posts:
170
Plugin Contributions:
1

Re: Product Extra Fields for text, pdfs and flash

I found some issue and i have a temporary workaround
ZC 1.3.9h

If you link a product to a different category and you decide to delete it form being linked you will not be able to edit the product anymore in the master category.

you will see it in the admin, but when you click to edit the product, no information will be viable.

in the error you will get something like this

[07-Jul-2011 09:50:04] PHP Warning: reset() expects parameter 1 to be array, null given in /home/xxxx/public_html/admin/includes/classes/object_info.php on line 29

[07-Jul-2011 09:50:04] PHP Warning: Variable passed to each() is not an array or object in /home/xxxx/public_html/admin/includes/classes/object_info.php on line 30

because the admin/includes/module/delete_product_confirm.php will delete the information from both the MASTER and the LINK thus breaking the array.

:clap:WORKAROUND #1: Do not override the
admin/includes/module/delete_product_confirm.php
nothing bad can happen, only the additional fields will stay in the DB

BTW: it is good practices not to delete any products. disable them or move them when they are no more needed, saving you the product ID

:no:WORKAROUND #2 NOT RECOMMENDED for people like you..., remove the product from being linked via phpMYadmin

find the product to category table and delete the record of the link

7 Jul 2011, 3:15 PM
#206
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

eek, no one has reported that before. Has anyone else run into this? That sounds more like a bug introduced from something else and not this mod but it's possible it's my bug.

25 Jul 2011, 6:59 PM
#207
labcomputer avatar

labcomputer

New Zenner

Join Date:
Jan 2011
Posts:
30
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

Hi Della,
After installing this patch I am getting the following SQL error when I try to import into DB:

An SQL error has occured. Please check your input data for tabs within fields and delete these. If this error continues, please forward your error log to the Easy Populate maintainer

Your help is appreciated

25 Jul 2011, 7:04 PM
#208
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

Did you use sql patch facility or the easy populate import? I've never seen that message about the easy populate maintainer so you may have some mods installed (not the normal easy populate mod) that are creating the problem.

25 Jul 2011, 9:04 PM
#209
labcomputer avatar

labcomputer

New Zenner

Join Date:
Jan 2011
Posts:
30
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

:(Actually easypopulate works fine before instaslling product extrafield

25 Jul 2011, 9:08 PM
#210
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

Sorry, I thought you meant the mod didn't work.

Easy populate can't import or export these extra fields so if you trying to do that you are out of luck. Easy populate only works on the default database tables. Any changes will stop easy populate from working.

25 Jul 2011, 9:20 PM
#211
labcomputer avatar

labcomputer

New Zenner

Join Date:
Jan 2011
Posts:
30
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

not good, is there anyway to add an extra field call Item Condition to ep?

25 Jul 2011, 9:24 PM
#212
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

not that I would even think about tackling, no. However, the folks at apsona.com would probably agree to add that (for a fee) into their store manager - It's much better than ezpopulate for working with the database. pm me if you want more info

12 Nov 2011, 1:43 AM
#213
george avatar

george

New Zenner

Join Date:
Nov 2011
Posts:
2
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

Hi Delia, Thank you for all your hard work. I am having trouble getting the link to display on the product page. The fields are in the admin area to add the additional files and links. After I upload the file it is visible on the next admin screen. However it is not called on the rendered page. Any thoughts?

Thanks again for your hard work.

George

12 Nov 2011, 1:01 PM
#214
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

Check to be sure that you put the template in the right place. They are in a folder called your template so if you just uploaded the includes folder, they won't show up.

13 Nov 2011, 6:19 AM
#215
george avatar

george

New Zenner

Join Date:
Nov 2011
Posts:
2
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

Delia, Thank you for the quick reply. However, I am still having touble getting the extra file to appear on the produce pages.

I have all th files in their proper directories (at least I think so). Template file is in my custom template area.

I can see the section to add extra files on the product attributes page. I also logged into PHP MyAdmin and can see the new table set up for: product_extra_fields.

I can add/upload files from admin and the colored bar at the top of the admin page tells me the files successfully loaded.

However, the file link does not appear.

Inside the new extra files section on the tpl_product_info_display.php there is a div area labeled "files."
When I look at the source code from the rendered page, this area is totally empty.

Here is a link to the page: http://www.trudysdresses.com/index.php?main_page=product_info&cPath=69&products_id=199

Any thoughts as what I am doing wrong?

Thanks again for your assistance.
George

13 Nov 2011, 1:37 PM
#216
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

Did you change the permissions on the files folder to allow upload?

12 Dec 2011, 7:54 AM
#217
maxmizer avatar

maxmizer

New Zenner

Join Date:
Dec 2011
Posts:
11
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

Hi Delia, Thank you for all your hard work.
Hello everyone, I would like to convert this form into a multi-language module, but I'm not a programmer.
I wonder if you helpme, because this module is perfect for me, but I have the problem that the files that the user must download: brochures, manuals, accessories ... are different depending on the language ...

I started to enter into the database and change language_id functios_product_extra_field:

function zen_copy_products_extra_fields($products_id_from, $products_id_to) {
  global $db;


  
// get extra fields to copy from
    $products_copy_from= $db->Execute("select * from " . TABLE_PRODUCT_EXTRA_FIELDS . " where products_id='" . $products_id_from . "'" );

 
          // New attribute - insert it
          $db->Execute("insert into " . TABLE_PRODUCT_EXTRA_FIELDS . " (products_id, language_id, extra_field, file_1, file_2, file_3, file_4, file_1_title, file_2_title, file_3_title, file_4_title, video, video_title, height, width,) values ('" . $products_id_to . "',
		  '" . $products_copy_from->fields['language_id'] . "',
          '" . $products_copy_from->fields['extra_field'] . "',
          '" . $products_copy_from->fields['file_1'] . "',
          '" . $products_copy_from->fields['file_2'] . "',
          '" . $products_copy_from->fields['file_3'] . "',
          '" . $products_copy_from->fields['file_4'] . "',
          '" . $products_copy_from->fields['file_1_title'] . "',
          '" . $products_copy_from->fields['file_2_title'] . "',
          '" . $products_copy_from->fields['file_3_title'] . "',
          '" . $products_copy_from->fields['file_4_title'] . "',
          '" . $products_copy_from->fields['video'] . "',
          '" . $products_copy_from->fields['video_title'] . "',
          '" . $products_copy_from->fields['height'] . "',
          '" . $products_copy_from->fields['width'] . "')");
          

} // eof: zen_copy_extra_fields

in collect_info:

 //  <?php // eof extra fields mod // ?>-->


<?php
    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>          
<tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
                 <tr>
            <td class="main"><?php  if ($i == 0) echo TEXT_PRODUCTS_EXTRA_TEXT_FIELD; ?></td>
            <td class="main"><?php echo zen_draw_textarea_field('extra field', 'soft', '100%', '30', stripslashes($pInfo->extra_field, $languages[$i]['id']));
			
			zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('extra_field',$pInfo->extra_field, $languages[$i]['id'], 'class="noEditor"') ?></td>
          </tr>    
 <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
		  	<td><?php if ($i == 0) echo TEXT_PRODUCTS_VIDEO; ?></td>
          	<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('video') .  ' '. TEXT_VIDEO_FILE_DESCRIPTION . ' ' . zen_draw_input_field('video_title', $pInfo->video_title, $languages[$i]['id']) .  zen_draw_hidden_field('previous_video', $pInfo->video, $languages[$i]['id']). ' '.$pInfo->video, $languages[$i]['id']; ?>
			  </td>
			  </tr>
			  <tr>
			  <td></td>
			  <td class="main" ><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . TEXT_VIDEO_FILE_WIDTH .' '. zen_draw_input_field('width', $pInfo->width, $languages[$i]['id']), $pInfo->width .TEXT_VIDEO_FILE_HEIGHT. ' '.  zen_draw_input_field('height', $pInfo->height, $languages[$i]['id']); ?>
			  </td>
		</tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION_FILE; ?></td>
            <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('file_1') .  ' '. TEXT_PRODUCTS_FILE_DESCRIPTION . ' ' . zen_draw_input_field('file_1_title', $pInfo->file_1_title, $languages[$i]['id']) . zen_draw_hidden_field('previous_file_1', $pInfo->file_1, $languages[$i]['id']).' '.$pInfo->file_1; ?></td>
          </tr>
          <tr>
            <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION_FILE; ?></td>
            <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('file_2') .  ' '. TEXT_PRODUCTS_FILE_DESCRIPTION . ' ' . zen_draw_input_field('file_2_title', $pInfo->file_2_title) . zen_draw_hidden_field('previous_file_2', $pInfo->file_2, $languages[$i]['id']).' '.$pInfo->file_2; ?></td>
          </tr>
          <tr>
            <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION_FILE; ?></td>
            <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('file_3') .  ' '. TEXT_PRODUCTS_FILE_DESCRIPTION . ' ' . zen_draw_input_field('file_3_title', $pInfo->file_3_title) . zen_draw_hidden_field('previous_file_3', $pInfo->file_3, $languages[$i]['id']).' '.$pInfo->file_3; ?></td>
          </tr>
          <tr>
            <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION_FILE; ?></td>
            <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('file_4') .  ' '. TEXT_PRODUCTS_FILE_DESCRIPTION . ' ' . zen_draw_input_field('file_4_title', $pInfo->file_4_title) . zen_draw_hidden_field('previous_file_4', $pInfo->file_4, $languages[$i]['id']).' '.$pInfo->file_4 ; ?></td>
          </tr>
          
<?php
    }
?>
<?php // eof extra fields mod // ?> 

thank you
12 Dec 2011, 1:33 PM
#218
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

I've never coded one for more than one language and I'm not an advanced programmer. Not only that but I don't even have time to look at that right now. Sorry!

14 Dec 2011, 8:31 AM
#219
maxmizer avatar

maxmizer

New Zenner

Join Date:
Dec 2011
Posts:
11
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

delia:

I've never coded one for more than one language and I'm not an advanced programmer. Not only that but I don't even have time to look at that right now. Sorry!

I understand you
but bit by bit you can do ... if there are others who want to make their contribution.

you agree Delia!

i have insert language_id on database image in attachment...

and first mod collect_info to read extra_field and language_id:

<?php
    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>          
<tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?>
            <br/>
            <br/></td>
          </tr>
                 <tr>
            <td class="main" valign="top" ><?php  echo TEXT_PRODUCTS_EXTRA_TEXT_FIELD . ' '; ?></td>
            <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>
                <td class="main" width="100%"><?php echo zen_draw_textarea_field('extra field[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', stripslashes($pInfo->extra_field));
			 zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('extra_field',$pInfo->extra_field, 'class="noEditor"') ?> 
        </td>
              </tr>
            </table></td>
          </tr>    
 <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
		  	<td><?php  echo TEXT_PRODUCTS_VIDEO; ?></td>
          	<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('video') .  ' '. TEXT_VIDEO_FILE_DESCRIPTION . ' ' . zen_draw_input_field('video_title[' . $languages[$i]['id'] . ']', $pInfo->video_title) .  zen_draw_hidden_field('previous_video', $pInfo->video). ' '.$pInfo->video; ?>
			  </td>
			  </tr>
			  <tr>
			  <td></td>
			  <td class="main" ><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . TEXT_VIDEO_FILE_WIDTH .' '. zen_draw_input_field('width', $pInfo->width, $languages[$i]['id']), $pInfo->width .TEXT_VIDEO_FILE_HEIGHT. ' '.  zen_draw_input_field('height', $pInfo->height, $languages[$i]['id']); ?>
			  </td>
		</tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td class="main"><?php  echo TEXT_PRODUCTS_DESCRIPTION_FILE; ?></td>
            <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('file_1') .  ' '. TEXT_PRODUCTS_FILE_DESCRIPTION . ' ' . zen_draw_input_field('file_1_title[' . $languages[$i]['id'] . ']', $pInfo->file_1_title, $languages[$i]['id']) . zen_draw_hidden_field('previous_file_1', $pInfo->file_1, $languages[$i]['id']).' '.$pInfo->file_1; ?></td>
          </tr>
          <tr>
            <td class="main"><?php  echo TEXT_PRODUCTS_DESCRIPTION_FILE; ?></td>
            <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('file_2') .  ' '. TEXT_PRODUCTS_FILE_DESCRIPTION . ' ' . zen_draw_input_field('file_2_title[' . $languages[$i]['id'] . ']', $pInfo->file_2_title, $languages[$i]['id']) . zen_draw_hidden_field('previous_file_2', $pInfo->file_2, $languages[$i]['id']).' '.$pInfo->file_2; ?></td>
          </tr>
          <tr>
            <td class="main"><?php  echo TEXT_PRODUCTS_DESCRIPTION_FILE; ?></td>
            <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('file_3') .  ' '. TEXT_PRODUCTS_FILE_DESCRIPTION . ' ' . zen_draw_input_field('file_3_title[' . $languages[$i]['id'] . ']', $pInfo->file_3_title) . zen_draw_hidden_field('previous_file_3', $pInfo->file_3, $languages[$i]['id']).' '.$pInfo->file_3; ?></td>
          </tr>
          <tr>
            <td class="main"><?php  echo TEXT_PRODUCTS_DESCRIPTION_FILE; ?></td>
            <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('file_4') .  ' '. TEXT_PRODUCTS_FILE_DESCRIPTION . ' ' . zen_draw_input_field('file_4_title[' . $languages[$i]['id'] . ']', $pInfo->file_4_title) . zen_draw_hidden_field('previous_file_4', $pInfo->file_4, $languages[$i]['id']).' '.$pInfo->file_4 ; ?></td>
          </tr>
          
<?php
    }
?>
<?php // eof extra fields mod // ?> 

thank you and all

15 Dec 2011, 1:00 PM
#220
maxmizer avatar

maxmizer

New Zenner

Join Date:
Dec 2011
Posts:
11
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

Update sql

-- SQL for product extra fields 
-- Delia Wilson Lunsford
-- Table structure for table `product_extra_fields`
--
DROP TABLE IF EXISTS `product_extra_fields`;
CREATE TABLE `product_extra_fields` (
  `products_id` int(11) NOT NULL default '0',
  `language_id` int(11) NOT NULL default '0',
  `extra_field` text default '',
  `file_1` varchar(50) default NULL,
  `file_2` varchar(50) default NULL,
  `file_3` varchar(50) default NULL,
  `file_4` varchar(50) default NULL,
  `file_1_title` varchar(100) default NULL,
  `file_2_title` varchar(100) default NULL,
  `file_3_title` varchar(100) default NULL,
  `file_4_title` varchar(100) default NULL,
  `video` varchar(150) default NULL,
  `video_title` varchar(50) default NULL,
  `height` smallint(6) default NULL,
  `width` smallint(6) default NULL,
  PRIMARY KEY  (`products_id`,`language_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `product_extra_fields` (`products_id`,`language_id`)
SELECT `products_id`,`language_id` FROM `products_description`  LEFT JOIN  `product`  USING (products_id) WHERE `products_type` = 1;