Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Extra Product Fields 1.0


Mrstech

Recommended Posts

Extra Product Fields 1.0

 

First of all, thanks a bunch to “wdepot” for this great contribution! This is exactly what I am looking for.

 

After carefully following the installations procedures I encountered a mayor problem which I hope someone can help me get around:

 

When I click “Create New Extra Field” under the Extra Product Fields nothing happens at all.

 

I went through the installation procedure twice under two different environment thinking that maybe with a fresh installed osCommerce would work but not luck.

 

Any ideas please??

 

Thanks in advance!

 

Mrstech.

 

P.S.: Here is the link to the contribution: http://addons.oscommerce.com/info/6856

Link to comment
Share on other sites

I also have the same problem, did you manage to sort it?

 

Please help some one.

 

I have been through the files and I don't seem to see where the problem is. I must say that I am not too experience with PHP. I hope some one hears our plead.

 

Help here please!

 

Thanks in advance.

Link to comment
Share on other sites

Did you upload the sql file to your database? Does the Product extra fields button appear in the admin under catalog? If so when you click the button, you are taken to a page that has Field Name Sort Order Language and then a button named Add Field. Just fill in the boxes and then copen a product in the admin/catalog or create a new product and the new field should show in the new product form.

Link to comment
Share on other sites

Did you upload the sql file to your database? Does the Product extra fields button appear in the admin under catalog? If so when you click the button, you are taken to a page that has Field Name Sort Order Language and then a button named Add Field. Just fill in the boxes and then copen a product in the admin/catalog or create a new product and the new field should show in the new product form.

 

Yes, uploading the sql file to the database was the first thing I did for both installations. The button does appear in the admin under catalog but when I click it nothing happens at all! :(

 

Any other idea. The way you write it is how I would like it to work.

 

Thanks,

 

Mrstech

Edited by Mrstech
Link to comment
Share on other sites

Please make sure that you have made all the changes as shown in the revisions except the last one dated Jul 3 by wdepot. Double check all your file changes per the install directions. I assume you are using a file compare tool to find the required changes. If not please download winmerge and check to see if you placed the changes in the correct syntax.

 

Also, please let me know what version, author and download date you used.

Link to comment
Share on other sites

Please make sure that you have made all the changes as shown in the revisions except the last one dated Jul 3 by wdepot. Double check all your file changes per the install directions. I assume you are using a file compare tool to find the required changes. If not please download winmerge and check to see if you placed the changes in the correct syntax.

 

Also, please let me know what version, author and download date you used.

 

 

Hi,

So I had to back off from Extra Product Fields 1.0 and install the previous one like you suggested. To be honest I had to use a littler bit from most of the contributions to get it working write:

 

extra_fields_v2_0j

extra_fields_v2_0j_1_2

extra_fields_v2_0j_1_2_3

advanced_search_result_1_2_3_4

 

But the great search feature that the constribution “Extra Product Fields 1.0” offers is gone which was working great :-(

 

Extra Product Fields creates its new fields in the products_descriptions database file which makes searching multiple fields easier, especially when searching using multiple terms that may be divided among several fields

 

I do hope that someone gets Extra Product Fields 1.0 working.

 

Mrstech

Link to comment
Share on other sites

:huh: I'm afraid I'm not sure what the problem might be. I extensively tested the contribution before I ever posted it online. I used the standard tep_href_link function to create the link around the Create New Extra Field button so the link should work properly no matter where you have your admin folder. Just a thought: double check to make sure you followed step 14 in the instructions and make sure you did it on the right filenames.php file. You need to modify the ADMIN/includes/filenames.php file and not the catalog/includes/filenames.php.

 

You may want to check the link by running the extra_fields.php file and then View Source Code in your browser. Scroll the source down to the beginning of the body_text. It should look something like this:

 

<!-- body_text //-->

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading">Extra Product Fields</td>

<td class="pageHeading" align="right"><img src="images/pixel_trans.gif" border="0" alt="" width="57" height="40"></td>

</tr>

<tr>

<td colspan=2 align="right"><a href="http://PATH_TO_YOUR_ADMIN_SITE/extra_fields.php?action=new"><input type="button" name="new" value="Create New Extra Field"></a>  </td>

</tr>

 

Check the href in the <A> tag and make sure that it is correct for your web site. In particular make sure that it is showing the correct path and that the file name and action are as shown above. If you use search engine friendly links it might show as "/extra_fields.php/action/new" instead (I'm not sure if osCommerce does this on the admin side or not). If the link is correct then the contribution SHOULD work as intended. If this still doesn't work you might try replacing the tep_draw_input_field('new', BUTTON_NEW, '', false, 'button') on line 328 of the extra_fields.php file with just BUTTON_NEW instead and see what happens. If the source code shown by your browser is correct but the link around the button doesn't work then I suppose the problem might be that your browser doesn't allow links to contain buttons.

 

Extra Product Fields 1.0

 

First of all, thanks a bunch to “wdepot” for this great contribution! This is exactly what I am looking for.

 

After carefully following the installations procedures I encountered a major problem which I hope someone can help me get around:

 

When I click “Create New Extra Field” under the Extra Product Fields nothing happens at all.

 

I went through the installation procedure twice under two different environment thinking that maybe with a fresh installed osCommerce would work but not luck.

 

Any ideas please??

 

Thanks in advance!

 

Mrstech.

 

P.S.: Here is the link to the contribution: http://addons.oscommerce.com/info/6856

Link to comment
Share on other sites

Okay, I've determined that the problem lies with Internet Explorer (or at least with version 8). The button works properly under Safari and Firefox. I'll see if I can figure out how to code it so that it will work properly under Internet Explorer as well and post an update, but for now you can get around the problem by replacing any tep_draw_input_field inside an <a> tag that has the last two parameters as "false, 'button'" with just the value of the second parameter. To give an example, for the Create New Extra Field button, on line 328 of extra_fields.php replace

 

tep_draw_input_field('new', BUTTON_NEW, '', false, 'button')

 

with

 

BUTTON_NEW

 

It won't look as nice as the button but at least you will be able to use the contribution.

 

:huh: I'm afraid I'm not sure what the problem might be. I extensively tested the contribution before I ever posted it online. I used the standard tep_href_link function to create the link around the Create New Extra Field button so the link should work properly no matter where you have your admin folder. Just a thought: double check to make sure you followed step 14 in the instructions and make sure you did it on the right filenames.php file. You need to modify the ADMIN/includes/filenames.php file and not the catalog/includes/filenames.php.

 

You may want to check the link by running the extra_fields.php file and then View Source Code in your browser. Scroll the source down to the beginning of the body_text. It should look something like this:

 

<!-- body_text //-->

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading">Extra Product Fields</td>

<td class="pageHeading" align="right"><img src="images/pixel_trans.gif" border="0" alt="" width="57" height="40"></td>

</tr>

<tr>

<td colspan=2 align="right"><a href="http://PATH_TO_YOUR_ADMIN_SITE/extra_fields.php?action=new"><input type="button" name="new" value="Create New Extra Field"></a>  </td>

</tr>

 

Check the href in the <A> tag and make sure that it is correct for your web site. In particular make sure that it is showing the correct path and that the file name and action are as shown above. If you use search engine friendly links it might show as "/extra_fields.php/action/new" instead (I'm not sure if osCommerce does this on the admin side or not). If the link is correct then the contribution SHOULD work as intended. If this still doesn't work you might try replacing the tep_draw_input_field('new', BUTTON_NEW, '', false, 'button') on line 328 of the extra_fields.php file with just BUTTON_NEW instead and see what happens. If the source code shown by your browser is correct but the link around the button doesn't work then I suppose the problem might be that your browser doesn't allow links to contain buttons.

Link to comment
Share on other sites

Hooray! I found the solution to the buttons not working in Internet Explorer. I've posted the updated and now working version to the contributions. You can download it at:

http://addons.oscommerce.com/info/6856

Those who have already installed Extra Product Fields 1.0 need only replace the admin/extra_fields.php and admin/extra_values.php files. Everything else is the same. As a freebie I fixed a bug that I discovered when testing the new delete extra field value confirmation buttons.

 

Okay, I've determined that the problem lies with Internet Explorer (or at least with version 8). The button works properly under Safari and Firefox. I'll see if I can figure out how to code it so that it will work properly under Internet Explorer as well and post an update,
Link to comment
Share on other sites

Oops, got the wrong type of link. The contribution is found at:

http://addons.oscommerce.com/info/6856

Hooray! I found the solution to the buttons not working in Internet Explorer. I've posted the updated and now working version to the contributions. You can download it at:

http://addons.oscommerce.com/info/6856

Those who have already installed Extra Product Fields 1.0 need only replace the admin/extra_fields.php and admin/extra_values.php files. Everything else is the same. As a freebie I fixed a bug that I discovered when testing the new delete extra field value confirmation buttons.

Link to comment
Share on other sites

GREAT WDEPOT, IT WORK!!!!

 

Thanks sooooooooo much for this/your contribution!!

 

Now I will see how I can "easy populate" my 3K or something articles values into my new Extra Fields... ;) If this work I just need to take care of the visual presentation and I am done!

 

 

Mrstech

Link to comment
Share on other sites

Hi all,

thanks wdepot for this contribution - version 1.1

after create a new field successfully and try to insert the Extra field values i'm having this error:

 

Warning: Missing argument 2 for tep_build_epf_pulldown(), called in C:\xampp\htdocs\imomontado2\admin\extra_values.php on line 238 and defined in C:\xampp\htdocs\imomontado2\admin\includes\functions\general.php on line 1371

This drop down list of values will look like this:

:blink:

My admin\includes\functions\general.php (with the changes) look like this:

 

//for Extra Product Fields

 

function tep_get_extra_field_list_value($value_id, $show_chain = false) {

 

$sql = tep_db_query("select epf_value, parent_id from " . TABLE_EPF_VALUES . " where value_id = " . (int)$value_id);

$value = tep_db_fetch_array($sql);

if ($show_chain && ($value['parent_id'] > 0)) {

return tep_get_extra_field_list_value($value['parent_id'], true) . ' | ' . $value['epf_value'];

} else {

return $value['epf_value'];

}

}

function tep_list_epf_children($parent_id) {

$sql = tep_db_query("select value_id from " . TABLE_EPF_VALUES . " where parent_id = " . (int)$parent_id);

$list = '';

while ($i = tep_db_fetch_array($sql)) {

$list .= ', ' . $i['value_id'] . tep_list_epf_children($i['value_id']);

}

return $list;

}

function tep_build_epf_pulldown($epf_id, $languages_id, $value_array = '', $parent_id = 0, $indent = '') {

if (!is_array($value_array)) $value_array = array();

$sql = tep_db_query("select epf_value, value_id from " . TABLE_EPF_VALUES . " where epf_id = " . (int)$epf_id . " and languages_id = " . (int)$languages_id . " and parent_id = " . (int)$parent_id . " order by sort_order, epf_value");

while ($v = tep_db_fetch_array($sql)) {

$value_array[] = array('id' => $v['value_id'], 'text' => $indent . $v['epf_value']);

$value_array = tep_build_epf_pulldown($epf_id, $languages_id, $value_array, $v['value_id'], $indent . '·');

}

return $value_array;

}

function tep_get_product_extra_value($epf_id, $product_id, $language_id) {

$epf_query = tep_db_query("select epf_id, epf_uses_value_list from " . TABLE_EPF . " where epf_id = " . (int)$epf_id);

$e = tep_db_fetch_array($epf_query);

$field = "extra_value" . ($e['epf_uses_value_list'] ? '_id' : '') . $e['epf_id'];

$product_query = tep_db_query("select " . $field . " from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");

$product = tep_db_fetch_array($product_query);

return $product[$field];

}

?>

 

Line 1371 is: function tep_build_epf_pulldown($epf_id, $languages_id, $value_array = '', $parent_id = 0, $indent = '') {

NOTE: 2 changes in this file

Link to comment
Share on other sites

Hi all,

thanks wdepot for this contribution - version 1.1

after create a new field successfully and try to insert the Extra field values i'm having this error:

 

Warning: Missing argument 2 for tep_build_epf_pulldown(), called in C:\xampp\htdocs\imomontado2\admin\extra_values.php on line 238 and defined in C:\xampp\htdocs\imomontado2\admin\includes\functions\general.php on line 1371

This drop down list of values will look like this:

:blink:

My admin\includes\functions\general.php (with the changes) look like this:

 

//for Extra Product Fields

 

function tep_get_extra_field_list_value($value_id, $show_chain = false) {

 

$sql = tep_db_query("select epf_value, parent_id from " . TABLE_EPF_VALUES . " where value_id = " . (int)$value_id);

$value = tep_db_fetch_array($sql);

if ($show_chain && ($value['parent_id'] > 0)) {

return tep_get_extra_field_list_value($value['parent_id'], true) . ' | ' . $value['epf_value'];

} else {

return $value['epf_value'];

}

}

function tep_list_epf_children($parent_id) {

$sql = tep_db_query("select value_id from " . TABLE_EPF_VALUES . " where parent_id = " . (int)$parent_id);

$list = '';

while ($i = tep_db_fetch_array($sql)) {

$list .= ', ' . $i['value_id'] . tep_list_epf_children($i['value_id']);

}

return $list;

}

function tep_build_epf_pulldown($epf_id, $languages_id, $value_array = '', $parent_id = 0, $indent = '') {

if (!is_array($value_array)) $value_array = array();

$sql = tep_db_query("select epf_value, value_id from " . TABLE_EPF_VALUES . " where epf_id = " . (int)$epf_id . " and languages_id = " . (int)$languages_id . " and parent_id = " . (int)$parent_id . " order by sort_order, epf_value");

while ($v = tep_db_fetch_array($sql)) {

$value_array[] = array('id' => $v['value_id'], 'text' => $indent . $v['epf_value']);

$value_array = tep_build_epf_pulldown($epf_id, $languages_id, $value_array, $v['value_id'], $indent . '·');

}

return $value_array;

}

function tep_get_product_extra_value($epf_id, $product_id, $language_id) {

$epf_query = tep_db_query("select epf_id, epf_uses_value_list from " . TABLE_EPF . " where epf_id = " . (int)$epf_id);

$e = tep_db_fetch_array($epf_query);

$field = "extra_value" . ($e['epf_uses_value_list'] ? '_id' : '') . $e['epf_id'];

$product_query = tep_db_query("select " . $field . " from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");

$product = tep_db_fetch_array($product_query);

return $product[$field];

}

?>

 

Line 1371 is: function tep_build_epf_pulldown($epf_id, $languages_id, $value_array = '', $parent_id = 0, $indent = '') {

NOTE: 2 changes in this file

 

 

this is a usefull and a great contribution!!

thank you wdepot for new version v1.11

that's good now

:lol:

 

wedpot is it possible to show news field in products_new.php and modules/new_products.php ?

 

thanks again

regards

Link to comment
Share on other sites

  • 4 weeks later...

Thx alot for a great contribution, however, i have a question.

 

Is there possible to add a description to the admin-page?

For exampel, when you are adding a new product, there will be a small text to the right side of the box, which will be a description on how it is supposed to be filled out.

 

Measurement: [bOX] (Description: Add the measurement of the item here)

Date: [bOX] (Description: DD/MM/YYY)

 

Hope anyone can help :)

Link to comment
Share on other sites

Does anyone know if this works with Easy Populate? I'm guessing it won't since it uses it's own SQL tables but I thought I would ask...it looks like an excellent contribution but I need it to work with Easy Populate.

 

Dan

Link to comment
Share on other sites

  • 3 weeks later...

i just done a complete new install of OSC standard

 

then did this contribution Extra Product Fields 1.12bugfix

 

 

added mysql tables with phpmyadmin

 

and did the modifications

 

 

in the admin i can setup the fields, and i can setup the values for these fields, the admin part seems ok

 

but when trying to browse the product from the main site, i get this error

 

1146 - Table 'plugger_oscommerce.TABLE_EPF' doesn't exist

 

select e.epf_id, e.epf_uses_value_list, e.epf_show_parent_chain, e.epf_use_as_meta_keyword, l.epf_label from TABLE_EPF e join TABLE_EPF_LABELS l where e.epf_status and (e.epf_id = l.epf_id) and (l.languages_id = 1) and l.epf_active_for_language order by epf_order

 

[TEP STOP]

 

 

 

went back and re checked the instructions, still the same.. is there something i am missing here

If it don't fit - Get a bigger hammer

Link to comment
Share on other sites

  • 4 months later...

Hello,

 

I am using this contribution along side another similar one, i.e. Customer Extra Fields Extended V1.3

 

The problem I am having is these two contributions wont play happily together as they both have a script which for each one is completely different, but shares the same name, extra_fields.php is the offending script.

 

Has anyone else had anything like this and how easy is it to rename the script for one or both contributions?

 

Thanks!

Link to comment
Share on other sites

  • 1 year later...

Hello,

 

I have the same question as I note others have asked.

 

We've just realised that users cannot perform an Advanced Search on more than one extra field at a time. After searching the contributions, I found this Extra Product Fields 1.0 add-on which specifically addresses this.

 

However, I don't want to be unable to use EasyPopulate which is frankly a GODSEND in making it possible to upload thousands of titles.

 

Do you know whether or not Extra Products Fields 1.0 works with EasyPopulate?

Link to comment
Share on other sites

  • 2 months later...

i just done a complete new install of OSC standard

 

then did this contribution Extra Product Fields 1.12bugfix

 

 

added mysql tables with phpmyadmin

 

and did the modifications

 

 

in the admin i can setup the fields, and i can setup the values for these fields, the admin part seems ok

 

but when trying to browse the product from the main site, i get this error

 

1146 - Table 'plugger_oscommerce.TABLE_EPF' doesn't exist

 

select e.epf_id, e.epf_uses_value_list, e.epf_show_parent_chain, e.epf_use_as_meta_keyword, l.epf_label from TABLE_EPF e join TABLE_EPF_LABELS l where e.epf_status and (e.epf_id = l.epf_id) and (l.languages_id = 1) and l.epf_active_for_language order by epf_order

 

[TEP STOP]

 

 

 

went back and re checked the instructions, still the same.. is there something i am missing here

 

I know this is an old post but the information might help someone else, check to make sure is phpadmin for you database that you have the correct field name.

Knowledge is useless, unless transferred.

Link to comment
Share on other sites

Does anyone know if this works with Easy Populate? I'm guessing it won't since it uses it's own SQL tables but I thought I would ask...it looks like an excellent contribution but I need it to work with Easy Populate.

 

Dan

I have it working with Easy Populate the problem I am having is getting more than one extra value field in my excel document. Also does anyone have a fix for the products_to_categories not adding the values from products table?

Knowledge is useless, unless transferred.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...