Contributions
Product Extra Fields
This contribution is my attempt at extending the product information that can be applied. I run an
Anime store, so I needed fields like "Region", "Author", etc. I could only find instructions on how to manually enter new fields, but this is a bit tedious for the average store owner. This contribution allows people to add fields labeled the way they want, and then display them in the product page of the catalog. I've grabbed enough contributions, so i figured I owe the community this one.
After this is added you can access the Product Extra Fields form in the Catalog section of the Admin area.
Capabilities:
- Add | Update | Remove custom fields in the database
- Allow each product to have a unique value for each new field (text field is automatically added to add product page in admin)
- Allow extra fields to be turned on and off without deleting them
- Allow for the removal of custom fields from the database, plus remove all entries made for products (I mean it! If you remove a custom field, and have added entries for products, you WILL LOSE ALL CUSTOM INFORMATION)
- Allow for extra fields to not be displayed when empty
Expand All / Collapse All
After discovering that the way Product Extra Fields was written prevents searching multiple fields for multiple search terms I wrote my own contribution which will do everything that Product Extra Fields does and more. You may find this new contribution at:
http://addons.oscommerce.com/info/6856
Included in the package is a file that converts all of your old Product Extra Fields into the new format used by my contribution so you can convert without losing the data you have already entered.
The attachment here is just a copy of the user guide for my contribution and is here only because a file is required to post this note.
An update to the earlier version, with numerous improvements and bugfixes.
Not a complete package, only the files for this contribution are included!
this worked for me after few modifications.
AS PER ANY MOD TO OSC PLEASE BACK UP
includes/modules/product_listings.php
FIND
$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';
}
break;
REPLACE WITH
//PRODUCT EXTRA FIELDS IN PRODUCT LISTING - BEGINING
// $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a> ';
// }
// break;
$extra_fields_text = '';
$extra_fields_query = tep_db_query("
SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
ON ptf.products_extra_fields_id=pef.products_extra_fields_id
WHERE ptf.products_id=". (int) $listing[$x]['products_id'] ." and ptf.products_extra_fields_value<>''
ORDER BY products_extra_fields_order");
while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
if (! $extra_fields['status'])
continue;
$extra_fields_text = $extra_fields_text.
'<font color="#000000">'.$extra_fields['name'].': </font>' .
'<font color="#006600">' .$extra_fields['value'].'<BR></font>';
}
$lc_text = ' <b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></b><br> ' . $extra_fields_text . '<br>';
}
break;
// PRODUCT EXTRA FIELDS IN PRODUCT LISTING - END
Attached is the advanced_search_result.php file that solves the "Unknown column 'p2pef.manufacturers_id' in 'on clause' " error on line 252
Relevant Fields in Categories
This contribution is the work of my ex-colleague, errata. All credits go to him, I just made this little guide
and uploaded it to contribs. It's pretty simple and very handy if you work with lots of fields, like I do in my
shop at www.portware.eu. It allows you to specify which fields belong to which products or categories, by using
the product and category ids. These will be shown before each item in the products page in admin for simplicity.
I hope you'll find these useful!
NOT FULL PACKAGE, ONLY FIX!
MYSQL QUERY ERROR REPORT
---------------------------------------
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languag' at line 1
product_info.php
$extra_fields_query = tep_db_query("
SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
ON ptf.products_extra_fields_id=pef.products_extra_fields_id
WHERE ptf.products_id=". (int)$HTTP_GET_VARS['products_id'] ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".(int)$languages_id."')
ORDER BY products_extra_fields_order");
Replace the following
$extra_fields_query = tep_db_query("
SELECT pef.products_extra_fields_order, pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
ON ptf.products_extra_fields_id=pef.products_extra_fields_id
WHERE ptf.products_id=". (int)$HTTP_GET_VARS['products_id'] ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".(int)$languages_id."')
ORDER BY pef.products_extra_fields_order");
dutch translation of the admin pages
If after doing the ammendments you still can't get proper search results, change the field type to a text field in the products to products extra fields table
There was a small mistake in the instructions regarding the advanced_search.php file. A line of code was duplicated by accident causing the advanced search to crash. This is the corrected instructions file only.
Ignore the posting from 6-12-2008 since I discovered that I didn't get the updated installation instructions included in the package and I also goofed and deleted the non-English language files. This package has the correct files.
Complete package less the files that are not new to this contribution since anyone with other contributions installed would need to manually modify them anyway.
Primary change is that the installation instructions have been updated to include changes necessary for the apostrophe fix and the patch file for advanced search has been converted to manual install instructions and corrections to it have been made so that it will work properly (as written the advanced search patch would only work with extra fields that were available to all languages).
Complete package less the files that are not new to this contribution since anyone with other contributions installed would need to manually modify them anyway.
Primary change is that the installation instructions have been updated to include changes necessary for the apostrophe fix and the patch file for advanced search has been converted to manual install instructions and corrections to it have been made so that it will work properly (as written the advanced search patch would only work with extra fields that were available to all languages).
In:
$extra_fields_query = tep_db_query("
SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
ON ptf.products_extra_fields_id=pef.products_extra_fields_id
WHERE ptf.products_id=". (int) $listing['products_id'] ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
ORDER BY products_extra_fields_order");
Find:
ORDER BY products_extra_fields_order");
After products_extra_fields_order and before " put: DESC LIMIT 5
Where 5 = no. of extra fields to show
Enjoy this has been a headache for many people
I got a little annoyed that the extra fields didn't show up as options in the "advanced search" feature. So I fixed that. Use the patch to make changes to advanced_search.php and advanced_search_results.php
(copy the patch into your catalog folder, then
gunzip pef_search_fields.patch.gz
patch -p1 pef_search_fields.patch
)
Many of the previous "full packages" provide modified versions of the necessary files, such as product_info.php. Unfortunately, I have no idea what versions were used as a base. Looking at the headers, it looks like something from 2003. These files are missing some important security fixes, and are probably not advisable to use in my opinion. I have taken the v2.0j and the advanced search fix below, and created a .patch file that contains only the PEF changes. This can be applied to a current version (i.e. rc2a), so that you get the security and feature benefits of having up to date base files as well as PEF. Those on a linux system can simply start with a vanilla, up-to-date osCommerce installation, place this file in their catalog directory, and issue the commands
gunzip pef.patch.gz
patch -p1 <pef.patch
to have all of the files updated to include the PEF updates. (You still need to run the SQL file). This way, you get 2.2 rc-2a + PEF instead of ancient version + PEF.
the title says it all. shows the product extra fields in the list where the the products are listed
PS: where is the forum for this contribution?
Please remove "?", so the line will look like this:
echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords=' . $extra_fields['value']) . '">' . '<font size="1" color="#666666">' .$extra_fields['value'].'<BR></font> </tr>
For those who wants to have clickable "extra filed value" please change the line in "product_info" or any place you place a code:
echo '<font size="1" color="#666666">' .$extra_fields['value'].'<BR></font> </tr>
to:
echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '?keywords=' . $extra_fields['value']) . '">' . '<font size="1" color="#666666">' .$extra_fields['value'].'<BR></font> </tr>
It works using search option, so clicking on the "value" will result not only "value" itself , also all products, where this "name (value)" is written.
I am not a programmer, please correct me. But it works!!
Como acer en Advanced Search para agregar checkbox,selects y mas de los Extra Fields y filtrarlos en el Advanced Search Result
Ejemplo http://www.carone.com.ar/carone-0km.php o http://www.wizardscupboard.com/advanced_search.php
I just got a Apostrophe FIX, that works pretty neat...
here what you need to do:
in admin/categories.php:
find:
if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
if (isset($extra_product_entry[$key])) { // an entry exists
if ($val == '') tep_db_query("DELETE FROM " . products_to_products_extra_fields . " where products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key);
else tep_db_query("UPDATE " . products_to_products_extra_fields . " SET products_extra_fields_value = '" . tep_db_prepare_input($val) . "' WHERE products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key);
}
else { // an entry does not exist
if ($val != '') tep_db_query("INSERT INTO " . products_to_products_extra_fields . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_prepare_input($val) . "')");
}
}
}
and replace with:
if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
if (isset($extra_product_entry[$key])) { // an entry exists
if ($val == '') tep_db_query("DELETE FROM " . products_to_products_extra_fields . " where products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key);
else tep_db_query("UPDATE " . products_to_products_extra_fields . " SET products_extra_fields_value = '" . tep_db_input($val) . "' WHERE products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key);
}
else { // an entry does not exist
if ($val != '') tep_db_query("INSERT INTO " . products_to_products_extra_fields . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_input($val) . "')");
}
}
}
(I replaced tep_db_prepare_input($val) to tep_db_input($val))
And then in catalog/product_info.php
find:
$extra_fields['value']
and replace with:
stripslashes($extra_fields['value'])
-the last one is needed to get rid of the slashes, that your data are stored with in the database.
(this also a fix for 1064 error, which I was getting when trying to add some data with slashes).
Should work fine... :)
ps. the uploaded file is the above text only. not a contribution.
There a fix for the apostrophe problem.
Instead of typing "A Bug's Life", type "A Bug's Life". That's it;-)
Hope it helps. cu, michelle - www.paranoiaparadise.com
PS: the download file contains the same text.
Found that the alterations needed to make the Advanced Search work with the extra fields clashed with the Muti Store contribution in use on my site.
This is the solution I found, hope it helps. Feel free to improve on it if necessary.
I wanted to enter more information into an extra field, so I changed the input type to a text area. I also has to make a small change to the database.
There's still a problem where you can't use an apostrophe or the ascii code for it. However, now you can use double-quotes.
Maybe someone can help clean this up so it works more like the regular product description?
I just add a French version to this great contribution. Thank you.
Here all the files
Buna cotribuitia dar pe unele servere cand urcam siteu nu imi aparea nici un camp desi in admin totul e ok.
Faza e ca dupa ce am modificat un pic acum functioneza si Search-Engine Safe URLs deci se poate activa desi am auzit ca e de cacao. (scuze expresia :))). deci daca e asa astept un e-mail
Aceasta corectare see poate face si pentru category fields
Sory for my bad English , this is a great contribution and when i use this on local server all work
but when i upload on the net the contribuition disapear even if in admin section all fields apear.
When i activate Search-Engine Safe URLs again another problems, now all works for me.
I'm a beginer and i don't know if this thing is good for you but for me works.
I add this: . (int)$HTTP_GET_VARS['products_id'] .
This fix working for category fields to
Working search file (modified advaced_search_result.php file from OSC 2.2ms2 release 060817)
This contribution is used in conjunction with the Product Extra Fields package. It only makes product extra fields to be used with an STS template. I used it on an old version of STS (version 2) so I don't know if it works with a new version.
I have:
Added the fixes below
Made it work with MYSQL 5
Fixed the file product_extra_fields.php in admin work. (it would not show the fields as it had <? instead of <?php.
This is a full file will all updates.
I received a SQL error when using both searches. In the catalog/advanced_search_results.php file it looks as if the SQL defines the tables in two places resulting in this incorrect SQL query:
SELECT count( DISTINCT p.products_id ) AS total
FROM (
products p
LEFT JOIN products_to_products_extra_fields p2pef ON p.products_id = p2pef.products_id
)
LEFT JOIN manufacturers m ON m.manufacturers_id = p.manufacturers_id, products_description pd
LEFT JOIN specials s ON p.products_id = s.products_id, categories c, products_to_categories p2c, products_extra_fields pef, products_description pd, categories c, products_to_categories p2c
WHERE p.products_status = '1'
AND p.products_id = pd.products_id
AND pd.language_id = '1'
AND p.products_id = p2c.products_id
AND p2c.categories_id = c.categories_id
AND pef.products_extra_fields_id = p2pef.products_extra_fields_id
AND (
(
pd.products_name LIKE '%benz%'
OR p.products_model LIKE '%benz%'
OR m.manufacturers_name LIKE '%benz%'
OR pef.products_extra_fields_name LIKE '%benz%'
OR p2pef.products_extra_fields_value LIKE '%benz%'
)
)
This should actually be:
SELECT count( DISTINCT p.products_id ) AS total
FROM (
products p
LEFT JOIN products_to_products_extra_fields p2pef ON p.products_id = p2pef.products_id
)
LEFT JOIN manufacturers m ON m.manufacturers_id = p.manufacturers_id, products_description pd
LEFT JOIN specials s ON p.products_id = s.products_id, categories c, products_to_categories p2c, products_extra_fields pef
WHERE p.products_status = '1'
AND p.products_id = pd.products_id
AND pd.language_id = '1'
AND p.products_id = p2c.products_id
AND p2c.categories_id = c.categories_id
AND pef.products_extra_fields_id = p2pef.products_extra_fields_id
AND (
(
pd.products_name LIKE '%%'
OR p.products_model LIKE '%1968%'
OR m.manufacturers_name LIKE '%1968z%'
OR pef.products_extra_fields_name LIKE '%1968%'
OR p2pef.products_extra_fields_value LIKE '%1968%'
)
)
You'll need to comment out this line (approximately number 235) in the advanced_search_result.php file:
$from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
changing it to:
// $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
I've attached the updated advanced_search_result.php file.
The bug fix didn't worked for me :
// START: Extra Fields Contribution
list($products_id_clean) = split('{', $products_id);
$extra_fields_query = tep_db_query("
SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value ,pef.products_extra_fields_status as status
FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
ON ptf.products_extra_fields_id=pef.products_extra_fields_id
WHERE ptf.products_id=".$products_id_clean." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
ORDER BY products_extra_fields_order");
while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
if (! $extra_fields['status']) // show only enabled extra field
continue;
echo '<tr>
<td>
<table border="0" width="50%" cellspacing="0" cellpadding="2px"><tr>
<td class="main" align="left" vallign="middle"><b><font size="1" color="#666666">'.$extra_fields['name'].': </b></font>';
echo '<font size="1" color="#666666">' .$extra_fields['value'].'<BR></font> </tr>
</table>
</td>
</tr>';
}
// END: Extra Fields Contribution
But this did :
// START: Extra Fields Contribution v2.0i with fix
list($products_id_clean) = split('{', $product_info['products_id']);
$extra_fields_query = tep_db_query("
SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value, pef.products_extra_fields_status as status
FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
ON ptf.products_extra_fields_id=pef.products_extra_fields_id
WHERE ptf.products_id=". $products_id_clean ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')");
while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
if (! $extra_fields['status']) // show only enabled extra field
continue;
echo '<tr>
<td>
<table border="0" width="50%" cellspacing="0" cellpadding="2px"><tr>
<td class="main" align="left" vallign="middle"><b><font size="1" color="#666666">'.$extra_fields['name'].': </b></font>';
echo '<font size="1" color="#666666">' .$extra_fields['value'].'<BR></font> </tr>
</table>
</td>
</tr>';
}
// END: Extra Fields Contribution
What's the diffrence :
Change this :
list($products_id_clean) = split('{', $products_id);
To this :
list($products_id_clean) = split('{', $product_info['products_id']);
No file attached, all credit goes to the writer(s) of this mod.
New advanced_search_result.php and bugfix from majidmx
Extra: Example for 4 fields in search
This is the combination of : Extra field v2_0h_1.zip and extrafieldsbugfix.zip . now :
Extra Fields now display beneath Product Name instead of above the name.
They now look as if they are meant to be there instead of stuck on top afterwards.
and the the tiny problem with viewing cart is sloved .
Say you have Product attributes assigned to a product and you add that item to a cart. When you view your cart, and click on that item.. A nice little SQL error will pop up. This only happens when viewing products from the cart that have these additional attributes.
Full package 2.0H with minor change to products_info.php
Extra Fields now display beneath Product Name instead of above the name.
They now look as if they are meant to be there instead of stuck on top afterwards.
- Bug removed: sql error when going to product info page from shopping cart for products having an attribute defined. This has been solved long time ago but somehow managed to get back.
- Deleted text files related to older versions.
- Removed ACA modules from the package as it is an option. Module to be downloaded separately.
This is a full package
- Rigadin
Okay, This is the final - i swear :)
i just spent 3 hours using it in my site. So, its set and ready to roll.
Forgot to update a line in the text file. Sorry.
This contribution is used in conjunction with the Product Extra Fields package. I installed the extra field package but needed some of the new text fields to be mandatory. This package
makes certain fields required on a Product Attributes level. JavaScript is used as a validator.
I have STS template installed also.
This is my first contribution -- so pardon the sloppiness and such.
This is the same as 2.0f, except that I included the sql instructions, which had been left out of the previous version. No changes from earlier, just better packaging.
All of the patches were combined into a single easy to apply patch, including detailed installation instructions. Also includes a copy of all the edited files as well.
I tried all the belowmentioned bugs and fixes but it did not work for me. I had a problem with the code itself looking for the table. I keep getting table does not exist.
THIS IS NOT THE ENTIRE CONTRIBUTION!! IT IS ONLY A FIX FOR AN ISSUE WITH THE PRODUCTS EXTRA FIELDS IN EMAILS ADDITION BY BUTTROAST.
If a product did not have any product attributes, but did have products extra fields, it would not print the products extra fields. This fix takes care of the problem. I hope this helps anyone who was having issues with my addition. Once again, I apologize for not packaging everything together with the original contribution. I did not have the time.
mintpeel post a solution for this problem.
I use a more simply solution which works for me.
-->for me, the bug is little different : the code appear instead of product extra fields in product info page
In fact, I just add php open/closers to the Original instructions
Many people complained that their Extra Fields were not showing in their product info page.
This is a very simple and quick edit to solve this problem, this is not the complete package, install from below first and if you have the problem try this fix.
This bug fix prevents backslashes from being displayed in front of inch marks (straight quote character ") entered into a product extra field. For instance, say you have a product extra field named Dimensions and you enter into it the value 1" x 2" x 3" this might end up being displayed as 1" x 2" x 3" depending on the master PHP settings for your server.
This will print out all product extra fields name & value pairs in the order email that gets sent to the customer. They will be below the product attributes under each product. They will appear in the same order that they appear on the product_info.php page.
If you want to have your Extra Fields listed below your Products Description, just make the change in your catalog/product.info.php file as indicated in the attached file.
Show only enabled extra field in product_info.php
Attached only text info how to improve it.
The same as before, but *.zip used instead of *.tgz
Show only enabled extra field in product_info.php
Attached only text info how to improve it.
Italian Language File and Buttons for OS-Commerce-Contribution "Product Extra Fields", Version 2.0 (!)
THIS IS NOT THE COMPLETE CONTRIBUTION-PACKAGE!
German language file and buttons for OS-Commerce-Contribution "Product Extra Fields", Version 2.0 (!)
THIS IS NOT THE COMPLETE CONTRIBUTION-PACKAGE!
Spanish translations: text and buttons.
It's no the full package. ONLY new files and changes to translate to spanish.
When testing the system i noticed a slight problem with the "Search-Engine Safe URLs" enabled which made the Extra Fields unfunctional in product_info.php.
The problem occurs in the query function (step 6.):
WHERE ptf.products_id=".(int)$products_id." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
Replace: (int)$products_id
With: $HTTP_GET_VARS['products_id']
Now you should be able to use it with the function enabled/disabled.
I have included the changed step 6 (modified from 2.0a), and also a whole new installation guide of 2.0a with the fixture.
In catalog/product_info.php: the WHERE clause of the query must be with (int):
WHERE ptf.products_id=".(int)$products_id."
Was giving problem with products having options, when going to product_info from the shopping cart.
Full package.
Products Extra Fields v2.0
Finally it came, this version supports multi-languages extra fields!
Each extra field can be set to display in all languages (like in prior versions) or only for a selected one.
Easy update. This package contains all files, instructions ans the ACA module.
(If you have not installed this contribution at all, you can compare it first with contrib 2612 which does the same)
Products Extra Fields module for Advanced Categories Admin (ACA) v1.x and Product Extra Fields contribution v1.3 (and probably
older revisions too, but not tested).
You need to have ACA (contribution 2611) installed to use this module.
Installation instructions updated:
- Line to find not existing in categories.php. Corrected.
- product_info.php does not display anything with v1.3, v1.3a and v1.3b due to... oops I badly copied some lines => now corrected chapter 6.
The v1.3a did not work for me. This new version do same as v1.3a by commenting only 3 lines (of v1.3).
Instruction file: updated chapter 1.5
The v1.3a did not work for me. This new version do same as v1.3a by commenting only 3 lines (of v1.3).
Instruction file: updated chapter 1.5
Fixed the HiHiHi display bug in read only preview.
(Amends step 1.5 to work *correctly*).
L. Sheed
Version 1.3
Modified admin/categories.php: $action is now a GET parameter for all actions, and function tep_image_submit can be used (more standard way to submit forms in osC).
Bug fix: deleting a category and its products was not deleting the extra fields for these products. Simplified the queries in catalog/product_info.php: 2 queries replaced by only 1.
All credits to the author(s) of this contrib.
Fixed a bug in admin/categories.php:
When extra fields of a product were modified, they were correctly shown on the Preview page but were overwritten by the database values if the Back (to editor) button was pressed.
Changed sql-statement to make new extra field of status active in file product_extra_fields.sql.
Changed description of the advanced search to reflect some wishes in the forum (I discovered the forum because of Vincent, thanks).
Small bug fixes to Thomas' code which corrects the update bug. Braces were missing. Added to the instructions here.
Also fixed error which occured because of the '@' in the require statement in the 'product_extra_fields.php' field as mentioned in the forum.
Added functionality for advanced search and corrected an update bug
The Internet Explorer form submit error is corrected. Also, the text instructions have been updated to be more accurate.
This contribution is my attempt at extending the product information that can be applied. I run an
Anime store, so I needed fields like "Region", "Author", etc. I could only find instructions on how to manually enter new fields, but this is a bit tedious for the average store owner. This contribution allows people to add fields labeled the way they want, and then display them in the product page of the catalog. I've grabbed enough contributions, so i figured I owe the community this one.
After this is added you can access the Product Extra Fields form in the Catalog section of the Admin area.
Capabilities:
- Add | Update | Remove custom fields in the database
- Allow each product to have a unique value for each new field (text field is automatically added to add product page in admin)
- Allow extra fields to be turned on and off without deleting them
- Allow for the removal of custom fields from the database, plus remove all entries made for products (I mean it! If you remove a custom field, and have added entries for products, you WILL LOSE ALL CUSTOM INFORMATION)
- Allow for extra fields to not be displayed when empty
Note: Contributions are used at own risk.