Contributions
Attribute Sets
Tired of adding each Attribute for each Option Drop Down List? Yeah, me too! This is why I created this contribution.
Here is how it works:
Create an Attribute Set by clicking "Attribute Sets" in the Catalog are of your osCommerce Administration. Select an Option Name (e.g., Sizes, Colors, Memory, etc...). Then select how many item in the Option Drop Down list you need (e.g. if you list is for Sizes you may need a list size of 3 for Small, Medium, Large). Then you click Ok. The next page you will have three attribute rows that you can set values for, then give this Attribute Set a name. That's it.
Now when you edit an existing product or when you create a new product you just select which set you want this product to have.
You will have to create your own Options and Option Values, but you will never have to ever use that Product Attribute page again. :-)
All this contribution does is insert rows into the products_attributes table, so it is compatiable with your site now. The only thing you'll have to do is when you edit a product, set it to use an Attribute Set, if it needs a drop-down list in the online catalog, otherwise leave it set to "-- none --".
Support Thread: http://forums.oscommerce.com/index.php?act=ST&f=7&t=99077
I developed this contribution with osCommerce 2.2 MS2.
I only use 1 language, English so I don't know how it would work with other languages but I'd be willing to work with someone if they want to improve on this first version to make it multi-language compatiable.
Expand All / Collapse All
This version has been supersceded by Attributes Sets Plus. The new vrsion is a re-write of the original and has the same functionality without any of the buggy issues associated with the original.
The original version is no longer supported as Joey is too busy these days, so go and download the new one which can be found here:
http://www.oscommerce.com/community/contributions,3610/category,3/search,attributes+sets+plus
The attributes set works well, but when you modify an attribute set etc. it deletes all the attributes for the given product.
This is really annoying when you have other attributes, not in attribute sets (such as text attributes).
This little mod fixes that.
Please use this text file instead of the previous post. Copying and pasting code does strange things. There was an extra linebreak and space in my post.
When editing and saving attribute sets, there is a serious bug that deletes all the OTHER attribute sets assigned to any item with the AS being edited.
This cost me a LOT of time. Please use this patch:
In catalog/admin/products_attributes_sets.php, around line 231, find this:
jjg_db_attributeSets( $arr_ProductsAttributeSetsIDs, $products_ids['products_id'], "update_product" );
and CHANGE it to this:
$arr_NewProductsAttributeSetsIDs = array();
$products_attributes_sets_query_sql = "select products_attributes_sets_id from ".TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS."
where products_
id =".$products_ids['products_id'];
$products_attributes_sets_query = tep_db_query($products_attributes_sets_query_sql);
$newcount = 0;
while($fixed_products_attributes = tep_db_fetch_array($products_attributes_sets_query)) {
$arr_NewProductsAttributeSetsIDs[$newcount] = $fixed_products_attributes['products_attributes_sets_id'];
$newcount++;
}
jjg_db_attributeSets( $arr_NewProductsAttributeSetsIDs, $products_ids['products_id'], "update_product" );
Thats it. If there are lingering problems after this, please let me know. I'd rather debug more code and make this contrib better. Beats having my attributes
messed up again.
One small change.
1) Added the product id to the "Return To Catalog" link on the products_attributes_sets_edit.php page. This will highlight the product when displaying the category.
- Upgraders just replace the products_attributes_sets_edit.php page.
Joey
A couple of changes:
1) Added a "Cancel" button to the products_attributes_sets_edit.php file.
- Upgraders Note: You can just replace the older file with this newer one.
2) Modified Installation step 7.4b to include the $cPath variable.
- Upgraders Note: Step 7.4b change is:
From this:
'pID='.$pID
To this:
'pID='.$_GET['pID'].'&cPath='.$_GET['cPath']
I also did a quick explanation of register_globals in the install.txt file.
I am using my own contribution now so you may see newer version more frequently because I'll be catching them too.
Enjoy.
Joey
Fixed a few more register_globals="no" possible issues and one case where it should have been a $_POST instead of a $_GET (Step 7.1b).
I found a few more $cPath variables that I changed to $_GET['cPath']. If you settings are register_globals="yes" then this doesn't effect you.
The change in Step 7.1b might make a difference to everyone though.
Two simple fixes.
Fix #1) I found a variable that was not registered_globals = "no" compatiable, so I fixed it by changing $cPath to $_GET['cPath']. This was only found in the products_attributes_sets_edit file.
Fix #2) Changed "[Click To Add And A.S.]" to "[Click To Add An A.S.]".
If you upgrading from version 5.1 to 5.2 you can just replace the file in Fix #1. For the syntax change in Fix #2 do a search in the /admin/categories.php file.
Small bug fix related to the register_globals being set to "off".
I hope I caught everything, but there is always something.
Enjoy,
Joey
This version 5 adds the following features and fixes the mentioned bugs:
1) Bug - Removed any reference to 'tep_get_products_model'
2) Allows user to add all their attribute sets in one edit session rather than a bunch of sessions that only adds one attribute set per session. If you have a lot of attribute sets, you'll like this feature.
3) The two main Attribute Sets management pages should work with register_globals="off" and register_globals="on" . osCommerce handles some variables, such as $action but I modified the variables I added to also work with register_globals="off".
4) Cleaner interface for the "Edit Existing Product" page, makes adding, removing and viewing the Attribute Sets much easier.
had a problem with this contrib - couldnt find the function 'tep_get_products_model'
which is referenced in this contrib so ive created it myself.
see attached txt file.
This version 4 addes the following features:
1) You can now modify an Attribute Set.
- Keep inmind that when you modify an Attribute Set that it DOESN'T automatically modify all the products using this modified Attribute Set, you'll have to re-apply the modified Attribute Set by editting the products using this modified Attribute Set. This is not a bug (see previous post by "Dan").
2) Sort Order was added to the Sets, so now you can set the Sort Order of the product attibutes.
*** THIS IS A COMPLETE PACKAGE, IT DOESN'T REQUIRE YOU TO INSTALL THE PREVIOUS VERSION! ***.
***** VERSION 3 IS NOT SUPPORTED BY ME AND IS FULL OF BUGS (HENCE WHY IT ISN'T SUPPORTED)! *****
There is a support thread for this contribution, I would suggest starting around page 11 of the whole thread to pick up on version 4 dialog.
Enjoy.
Sets get buggy when you edit a product with multiple atribute sets. They switch order, and some sets go backwards order instead of foreward. When updating sets, you need to update all the products as well manually. Anyone know a fix?
pardon, I forget to add one main file. now all update files should be complete.
this is always good, if you don't know this package
Nejat Philip Eryigit; http://fast-it.net Modul Attribute Sets 3.0. update.
Origin concept and version from the author Joey Garcia; Contribution 2201
-------------------------------------------------------------------------------
This is an update of the admin part. You have to installl the previous version first and update it with this. Maybe it looks like small changes, but it tooks me a lot of time besides normal work. For lack of time, I couldn't write a full install instructions. Maybe later... or perhaps you'll do ;)
How to install?
- First install previous 2.0.1 version
- open 'AttributeSets_npe_update_v3.txt' and follow instructions in the end of each comment line (.catalog/admin/....php #add or #change)
- copy (and replace) according to directories below 'catalog' within this packet
What's new?
- edit, add and delete multiple options in a set
- full multi-lingual support in the admin area; now set names can be defined or not to make a set visible to each language
- completely redesigned
- added language support for german and turkish
TO DO
- a function to copy (& change Attribute Sets)
- possibility for combining multiple different attributes to a set.
This version doesn't change any code, only the install instructions and I provide total replacements for the two main modified files. The database.php file and categories.php file. These two replacement files are taken from osCommerce 2.2 MS2 and shouldn't be used unless these files have never been modified by you or should be used as a reference for the installation instructions, if for nothing else to note the actual line numbers of the modifications.
Please remember to back up your files always.
Joey
This version shows a list of all the Attribute Sets you've created and allows you to easily delete any of them. I think many people have requested this and I finally found a pocket of time to code it up.
Jumped to version 2.0 because this change is a big deal to many people already using this contribution, but only 2 files were changes, so it is an easy upgrade if you have an older version.
Remember to back up your files - you know who I'm talking to ;-)
Enjoy
Made Step 5 of the installation instructions a bit more clear, nothing else was changed.
Joey
ITNetwork Designs
IceTheNet
Contribution
Nice Contribution
But these items seem to be missing just to make it easy add these:
As near as could figure these were missing
If someone wants to make for additional languages
Edit this file for spanish.php german.php french.php or what ever language you could add.
I would like to see multiple sets per product.
I don’t have the time but if someone creates that it would be great
admin/includes/language/english.php
// text for product_attributes_sets.php
define('IMAGE_CREATE_ATTRIBUTE_SET', 'Create Set');
define('HEADING_TITLE', 'Attribute Sets');
define('TEXT_SELECT_OPTION', 'Select Atributes');
define('TEXT_CHOOSE_OPTION', 'Choose an Option');
define('TEXT_CHOOSE_SET_SIZE', 'Set Size');
File: ***only contains this text***
When editting a product that was added before this contribution the Attribute Set will be set to '--none--' because I used the original osCommerce method to make the product's attributes and if I forgot to set the Attribute Sets to some value I would end up losing the product's attributes, so I added a reminder message in the product preview so I wouldn't forget to set this value.
Changes from version 1.1:
Step 6 is the only new change from the previous version. This step adds a pink Warning at the top of the page when previewing a product if there is an Attribute Set left set to '--none--'. This message will also show the total number of Attribute Sets used for the current product.
(Still) TODO:
1) I will be adding a Delete Set feature next.
2) I will eventually add a modify, but it is less of a priority since it is just as easy to deleted the set and just create it again.
Changes from version 1.0:
1) Increased a field size from varchar(100) to varchar(255) (this is as larger as varchars can get). This should accomodate larger set sizes.
2) I changed the way to set the Attribute Set size, it is now a text box rather than a drop down list from 1 - 10. There is not form field validation on this text box, so if enter something other than a number, you'll get an error.
TODO:
1) I will be adding a Delete Set feature next.
2) I will eventually add a modify, but it is less of a priority since it is just as easy to deleted the set and just create it again.
Tired of adding each Attribute for each Option Drop Down List? Yeah, me too! This is why I created this contribution.
Here is how it works:
Create an Attribute Set by clicking "Attribute Sets" in the Catalog are of your osCommerce Administration. Select an Option Name (e.g., Sizes, Colors, Memory, etc...). Then select how many item in the Option Drop Down list you need (e.g. if you list is for Sizes you may need a list size of 3 for Small, Medium, Large). Then you click Ok. The next page you will have three attribute rows that you can set values for, then give this Attribute Set a name. That's it.
Now when you edit an existing product or when you create a new product you just select which set you want this product to have.
You will have to create your own Options and Option Values, but you will never have to ever use that Product Attribute page again. :-)
All this contribution does is insert rows into the products_attributes table, so it is compatiable with your site now. The only thing you'll have to do is when you edit a product, set it to use an Attribute Set, if it needs a drop-down list in the online catalog, otherwise leave it set to "-- none --".
Support Thread: http://forums.oscommerce.com/index.php?act=ST&f=7&t=99077
I developed this contribution with osCommerce 2.2 MS2.
I only use 1 language, English so I don't know how it would work with other languages but I'd be willing to work with someone if they want to improve on this first version to make it multi-language compatiable.
Note: Contributions are used at own risk.