Contributions
Alternative Attribute Handling
Updated version for 25-Jun-2002 CVS
Expand All / Collapse All
The file attached fixes an error in the file I posted previously.
When updating or inserting rows the option_value_id is assumed by incrementation. This simple fix corrects this and reads the correct option_value_id from the database.
Updated file attached, or you can simply change the line given below.
Find the line (near 271):
------------------------------------------
while ($values = tep_db_fetch_array($values_query)) {
$rows ++;
------------------------------------------
Replace "$rows ++;" with the following:
------------------------------------------
$rows = $values[ "products_options_values_id" ];
------------------------------------------
Instead of having all the attribute values list in a mess here is what you need to change from the original code inside admin/categories.php
Contribution Alternate Attributes Sort the tables
Find this:
_________________
$values_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " .
TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where
pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" .
$options['products_options_id'] . "' and pov.language_id = '" . $languages_id . "'");
Replace with this:
_____________________________
$values_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " .
TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where
pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" .
$options['products_options_id'] . "' and pov.language_id = '" . $languages_id . "' order by
pov.products_options_values_name desc");
Find this:
_________________
$attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " .
TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $pInfo->products_id . "' and options_id = '" .
$options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "'");
Replace with this:
_____________________________
$attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " .
TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $pInfo->products_id . "' and options_id = '" .
$options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "' order
by products_attributes_id desc");
if you dont like desc change it to ascending at the end of each "order by".
Also you might be interested in the following fix for product_info.php in the catalog dir.
Find this:
_________________
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name,
pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " .
TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and
pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id =
pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
Replace with this:
_____________________________
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name,
pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " .
TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and
pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id =
pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by
pov.products_options_values_name");
----------same file as before just as a zip------------
alternative_attribute_handling update for 2.2 Milestone 2 Paul Hart 12 Nov 2004
New categories.php and diff file based on the 2.2 MS2 file with mods taken from the original alternative attribute handling contribution.
I'm not a programmer - the attributes code has not been changed other than moving it to the correct places inside the MS2 categories.php file so it works. The credit still belongs to the original author David Garcia Watkins.
New categories.php and diff file based on the 2.2 MS2 file with mods taken from the original alternative attribute handling contribution.
I'm not a programmer - the attributes code has not been changed other than moving it to the correct places inside the MS2 categories.php file so it works. The credit still belongs to the original author David Garcia Watkins.
This contribution *only* contains the file catalogadmincategories.php (MS2.2) to work with
- family products (1429)
- alternative_attribute_handling-6 (174)
Modifications to contributions:
- you will find a drop-down-list with all existing families, just select and javascript will copy it to the family-field
- works with alternative attribute handling. modification: '+/-' is now selectable (dropdown list)
Update changes made to the original file.
Fixed a small bug in the previous version
An alternative to product_attributes.
A grid is displayed below the product data with checkboxes to select desired attributes.
Added a .diff file to the package, so you can merge this contribution with others easily.
Updated version for 25-Jun-2002 CVS
This works with todays CVS (Apr 7 2002) and it does not contemplate the new "Downloadable Product" features.
Its an alternative product attribute handling method for the Administration Tool.
It basically removes products attributes from the products attribute page, and creates a grid for easy adding/deleting/editing of attributes within the products edit screen.
The products_attributes screen is used only to define options and values.
Replace the files in the package with the ones in your Administration Tool (CVS Apr 7 2002).
Note: Contributions are used at own risk.