joeyjgarcia Posted June 23, 2004 Posted June 23, 2004 (edited) 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 --". You can find this contribution at: http://www.oscommerce.com/community/contributions,2201 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. Edited June 23, 2004 by joeyjgarcia Quote
wishx Posted June 23, 2004 Posted June 23, 2004 Can you post some screen captures so we can see what it looks like before installing it? Quote
joeyjgarcia Posted June 23, 2004 Author Posted June 23, 2004 Yes I will. I'll get those out tonight. Joey Quote
donthecat Posted June 23, 2004 Posted June 23, 2004 Hey Joey Good to see the contrib online man. It's really useful and thanks for asking me to test it out while you were playing around with the codes B) You probably made a 10% programmer outta me :D Cheese Quote --- DontheCat --- Obviously the truth is what's so Not so obviously, it's also so what.
joeyjgarcia Posted June 23, 2004 Author Posted June 23, 2004 You were a great help! Thank you. Joey Quote
Guest Posted June 23, 2004 Posted June 23, 2004 Parse error: parse error, unexpected T_ELSEIF in /mnt/web_g/d47/s36/b01f2394/www/store/nfoscomm/catalog/admin/categories.php on line 646 lines 640 to 650 </tr> <tr> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td> </tr> </table></form> <?php } elseif ($action == 'new_product_preview') { if (tep_not_null($HTTP_POST_VARS)) { $pInfo = new objectInfo($HTTP_POST_VARS); $products_name = $HTTP_POST_VARS['products_name']; $products_description = $HTTP_POST_VARS['products_description']; Where did I go wrong.... Please help! Quote
imac_jim Posted June 24, 2004 Posted June 24, 2004 I have managed to install this update. Ok so where is the delete attribute set button? I put in a test one and now I want to delete it! What if I make a set with 3 options in it but later on I want to change it to 5? What if I want to go beyond the initial 10? Quote
joeyjgarcia Posted June 24, 2004 Author Posted June 24, 2004 (edited) :blink: Good question! I didn't add in that feature (shoot!, just when I thought I was done. :( ). I'll have to think about that one and add it in, just give me some time to get it done. Keep the feedback coming and I'll see what I can add in version 1.1 when it comes out. Joey Edited June 24, 2004 by joeyjgarcia Quote
joeyjgarcia Posted June 24, 2004 Author Posted June 24, 2004 (edited) The easiest way would be to select that row in the database's table for products_attributes_sets and select that row and click the "Delete" link to remove that Attribute Set. Also, if you want a drop-down list that has many options then you may have to make your products_attributes_sets_value field in the products_attributes_sets table larger than varchar(100), otherwise it will chop off the end of the products_attributes_sets_value string. Also, to add more values other than 10, you could do 2 things: 1) Make the Drop-Down list larger or 2) make it a text box. If you want to see what I mean when I refer to the products_attributes_sets_value see the link of the screenshots which has a picture of my table. Joey Edited June 24, 2004 by joeyjgarcia Quote
joeyjgarcia Posted June 24, 2004 Author Posted June 24, 2004 Here is the link to the screenshots. http://www.goodnewsclothing.com/screenshots.htm Joey Quote
Guest Posted June 24, 2004 Posted June 24, 2004 Now I'm getting the same error but on line 648. As well, my products are getting errors as well, but I'm assuming that it's due to the parse error that I'm getting..... I hope I can get this all fixed! Quote
Guest Posted June 24, 2004 Posted June 24, 2004 Most of my attributes will be for birthstones, how can I make it work for the 12 months? I know that Joey explained it, but I'm totally script dumb & I'm not sure what I need to modify to make it work. I'm assuming that it's rather simple & this is why I can't figure it out! I hope someone can help me out rather quickly! Thanks a lot! Quote
Guest Posted June 25, 2004 Posted June 25, 2004 Thanks for Joey's help, I've been able to get everything figured out! I think this is a great contribution wish will help me out greatly!!!! Thanks Joey! Quote
joeyjgarcia Posted June 25, 2004 Author Posted June 25, 2004 I submitted a version 1.1 that replaces the Set Size field from a drop down list to a text box, and I increased a field in the products_attributes_sets table from a varchar(100) to varchar(255) which is as large as a varchar can get. Each drop down list option requires 8 characters in the products_attributes_sets_values field. Therefore, a list with 5 items in the list will require at least 40 characters (8x5=40), thus 255 characters should be ample for most cases. Joey Quote
Guest Posted June 25, 2004 Posted June 25, 2004 I am planning on installing this but so I don't waste alot of time..... Does it affect product attributes that are already set? I have hundreds that I don't want to do over.. Also you can still increase the price of some options with this? Ex: +2 dollars for XXL Quote
joeyjgarcia Posted June 25, 2004 Author Posted June 25, 2004 That is a very good question! No, it doesn't effect your current products and their attributes, except if you edit a product and leave the Attribtue Set drop-down list set to "--none--". Therefore, when you edit a product set the Attribute Sets to whichever Attibute Set that product would normally use. When you add new products then you will need to set their attributes once when you initially insert the product. Yes, you can add extra cost, and I suppose subtract costs too. All this does it it inserts the needed rows in the Product Attributes table for that product, so whatever that table does with that information is still the same, I don't touch the product_info.php page. I hear your concern, I was my own guinea pig and installed it in my site when I already had a lot of products that I didn't want to re-insert. Quote
saicco Posted June 28, 2004 Posted June 28, 2004 How do you add the tables in step 1 of the instructions? I'm new to this stuff. Quote
saicco Posted June 28, 2004 Posted June 28, 2004 Please someone help with above post. I'm stuck until I create the tables. Thanks. Quote
Guest Posted June 28, 2004 Posted June 28, 2004 All you need to do is drop the sql file into your sql program. I use myphpadmin. Once you do that, the tables are automatically created. Quote
Guest Posted June 28, 2004 Posted June 28, 2004 I have a quick question - my date selection has disappeared, being replaced by the attributes section. I was wondering if anyone else is having this problem & if they have fixed it. Thanks a lot! Quote
saicco Posted June 29, 2004 Posted June 29, 2004 Thanks for the help. I finally got everything installed and everything is working properly. Great contribution. Saves a lot of time. Thanks again!!! Quote
Guest Posted June 30, 2004 Posted June 30, 2004 Does anyone know how I can my date selection box back? It was replced by the attributes drop down box. Thanks as always! Quote
joeyjgarcia Posted June 30, 2004 Author Posted June 30, 2004 Added an update today. Description: 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. Quote
janwim Posted July 2, 2004 Posted July 2, 2004 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 "at line 3 SELECT count(DISTINCT options_id)as count FROM products_attributes WHERE products_id = This what I get when I want to edit a product after installing this contribution, and I don't have a clue wher to search for the cause of this error. Can anybody help. Quote
joeyjgarcia Posted July 3, 2004 Author Posted July 3, 2004 It might the missing spaces. You posted: SELECT count(DISTINCT options_id)as count FROM products_attributes WHERE products_id = My contribution has it like this: $getOptionsCount_query = tep_db_query('SELECT count( DISTINCT options_id ) as count FROM '. TABLE_PRODUCTS_ATTRIBUTES .' WHERE `products_id` ='.$pInfo->products_id); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.