Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Having a tough time with product attributes, help please?


jrconsultations

Recommended Posts

Hi guys, I am running a clothing store. As you all know clothing has many attributes like - Colors & Sizes. The normal attributes section of OsCommerce i dont think was built to enter hundreds of attributes. Does anyone of a contribution that can help me easily edit, delete, & create attributes for products?

 

Thanks.

Link to comment
Share on other sites

Hi guys, I am running a clothing store. As you all know clothing has many attributes like - Colors & Sizes. The normal attributes section of OsCommerce i dont think was built to enter hundreds of attributes. Does anyone of a contribution that can help me easily edit, delete, & create attributes for products?

 

Thanks.

 

i too have found the entry of attibutes via the admin panel to be painfully tedious. my approach was to figure out how to do it with phpMyAdmin using SQL commands. i keep a little notepad entry with the pertinent SQL on it, and just run it for each product. would be relatively easy to generate the necessary code for multiple entries all at one time. back up your database first, of course.

 

cheers,

rj

Link to comment
Share on other sites

i too have found the entry of attibutes via the admin panel to be painfully tedious. my approach was to figure out how to do it with phpMyAdmin using SQL commands. i keep a little notepad entry with the pertinent SQL on it, and just run it for each product. would be relatively easy to generate the necessary code for multiple entries all at one time. back up your database first, of course.

 

cheers,

rj

 

 

Hey RJ -

 

I was thinking exactly the same if there was no contribution for this.

 

What is the code you are using? Can you show me an example? I don't want ot trial an error and mess things up :)

 

thanks so much.

Link to comment
Share on other sites

Hi guys, I am running a clothing store. As you all know clothing has many attributes like - Colors & Sizes. The normal attributes section of OsCommerce i dont think was built to enter hundreds of attributes. Does anyone of a contribution that can help me easily edit, delete, & create attributes for products?

 

Thanks.

 

 

The best contribution for this is the master products. You assign a master product (ie: levi 501s size 8, colour blue) and slaves to this product (ie: the same item in size 10, 12, 14, etc with various colours if you like)

 

Get this contribution from HERE

Link to comment
Share on other sites

Hey RJ -

 

I was thinking exactly the same if there was no contribution for this.

 

What is the code you are using? Can you show me an example? I don't want ot trial an error and mess things up smile.gif

 

thanks so much.

 

sorry for the delay in replying...

 

well, my code is probably not going to help you very much, as it will be specific to what i'm doing. but it will give you the idea and i'll give it to you later.

 

the best approach is to play with the admin panel and set up the attributes for one product, then check out the database tables with phpMyAdmin and figure out what you need to do.

 

the pertinent tables and fields are:

Table: products_attributes:

products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix

 

Table: products_options:

products_options_id, language_id, products_options_name (eg Size)

Table: products_options_values:

products_options_values_id, language_id, products_options_values_name (eg. Small)

 

Table: products_options_values_to_products_options

products_options_values_to_products_options_id, products_options_id, products_options_values_id

 

if you set up one product with attributes, you can see what get put into each of these fields.

 

the first field in each table is just an arbitrary index key. it is always named with the table name with "_id" appended. whenever you are inserting things, leave this field blank, and the table will automatically assign a number to it (the field is set to "auto-increment")

 

here's the example for my particular case. i sell drums, and each drum comes with a choice of accessories, either a strap, or a cover, or both for $15 extra. i set up this option (Accessories), with 3 option values (Strap, Cover, Both) for one drum. this was not too painful. the painful part comes from adding those three option values to every single product, so my options and option values are already set up. i just use the SQL to give each product to appropriate attributes.

 

so, first i look at the products_options table, and note that the row for "Accessories" has a product_options_id = '4'.

 

then i look at the products_options_values table and note that the rows for "Cover", "Strap", and "Both" have the products_options_values_id = 10,11, and 12, respectively.

 

now i look at the table products_attributes and note that there are three rows, all of them have products_id = '36', which is the id for the drum that i set up with the attributes. all three rows have options_id = '4', and options_values_id = 10, 11, and 12 respectively. and that the options_values_price = 0, 0, and 15, repsectively, and price_prefix = '+' for all three.

 

the pertinent SQL to generate this would be:

INSERT INTO `products_attributes` ( `products_attributes_id` , `products_id` , `options_id` , `options_values_id` , `options_values_price` , `price_prefix` )
VALUES (NULL , '36', '4', '11', '0.0000', '+'),(NULL , '36', '4', '10', '0.0000', '+'),(NULL , '36', '4', '12', '15.0000', '+');

note the order is not 10, 11, 12, because i wanted the pull down to list them with strap first (11), then cover (10) then both (12)

also note the null for products_attributes_id, which allows it to auto-increment.

 

so whenever i add a new drum, i make note of the product_id, then run that SQL command, after replacing the '36' with whatever the new drum's prod_id is. that adds the little pull down titled "Accessories" with three options (strap, cover, both).

 

if i had to do this for many drums all at one time, i would use a spread sheet to generate the SQL and replace the '36' with the appropriate product_id which i would hope are numerically sequential, or at least organized in blocks that are numerically sequential.

 

if you also have hundreds of options and/or option_values, you can also set them up with SQL, using the same syntax of INSERT INTO...VALUES. for the tables product_options, and products_options_values. you will also have to insert the appropriate rows into the table products_options_values_to_products_options, which clearly ties the two table together.

 

hope this helps

 

rj

 

ps. the more i use osC, the less i use the admin panel and the more i do things with phpMyAdmin and SQL commands.

Link to comment
Share on other sites

just install the contribution I posted, it's build on ajax which means you don't need to refresh site everytime you insert attribute, I inserted over 1000 atts and no problems

 

 

ErollorD -

 

I installed this contribution, its GREAT!

 

HOWEVER - does anyone know how i can put QUANTITY per an option? like i have 100 Small 300 Medium and 40 Large pants to sell. How can this be done without adding the product 3 times?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...