Contributions
Multiple Categories per product quick entry
I think some users need to have easier and quicker way to create/update products that related
to several categories.<br>
Now on the page where you create/update products you will have multiple select box,
and you can select multiple categories for product. Quick and easy.<br>
NOTE: The preview feature will be disabled due to its limits.<br>
Expand All / Collapse All
Multiple Categories per product quick entry (FULL)
+1.3 Fix to correctly display "Top" as a category option and offer option (must be hardcoded into admin/categories.php) to list categories as checkboxes instead of multi-select menu.
Jon Adams
iluminada.com
For support of this contribution, please post all comments here:
http://forums.oscommerce.com/index.php?showtopic=224276
Full Package included in this file for download.
This is a combination of all fixes shown below into one full package.
Tested and works with OSC MS2 Installations.
All credits goto the authors shown below.
All files are left as unchanged with original author comments.
By default, if a product is entered at the top level (i.e. uncategorized) in OSCommerce,
a line is added to the products_to_categories table with the product id and a category id of 0.
By adding a listbox to the product update form, an issue arrises when someone wants to enter an
uncategorized product. When nothing is chosen in the listbox, no entries are added to the table,
and the product essentially 'disappears' from the admin panels and front-end, even though the data
is written to the products tables.
The following code will fix this problem by adding the necessary link when no categories are chosen.
You need to change:
catalog/admin/includes/html_output.php
Add the contents of this file to the bottom of it.
Also, I am not sure what the changes to index.php do, it just broke with an SQL error. I left it out and it seems to work fine.
The original mod that this is built onto is here:
http://www.oscommerce.com/community/contributions,1537/
Small update for installMS2.txt file
R Calders's modification described below is inserted into MS2 install text file.
Replace this file with original .txt file in the package or carefully read previous description.
This is a new version 1.2 for Multiple Categories per product quick entry.
It includes Categories displayed with subdirectories in a tree. Special thanks to Rick Calder.
You can ad a simple fix to old versions to get new functionality.
REPLACE ALL 5 LINES
$categories_query = tep_db_query("select categories_id, categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where language_id = ". $language_id ." order by categories_name");
while ($categories = tep_db_fetch_array($categories_query)) {
$categories_array[] = array('id' => $categories['categories_id'],
'text' => $categories['categories_name']);
}
WITH
$categories_array = tep_get_category_tree();
Please visit www.algozone.com for osCommerce templates and more contributions
Here is a new version 1.1 of package that has a fix for image uploads.
New package also includes support for 2.2ms2
I think some users need to have easier and quicker way to create/update products that related
to several categories.<br>
Now on the page where you create/update products you will have multiple select box,
and you can select multiple categories for product. Quick and easy.<br>
NOTE: The preview feature will be disabled due to its limits.<br>
For more contributions please visit <a href = "http://www.Algozone.com">http://www.Algozone.com</a>
Note: Contributions are used at own risk.