Adding product global options???

How can I add Global Options to every product on my site… Nearly 20,000 products… (IE, Sizes, Colors) Every product has the same set of attributes…

Ahh, I was just looking for the answer to this question myself. If you’re using the 2.1.? version then I believe the only way to accomplish this is to…



Go to Catalog->Global Options->you will see a “add to products” link just below the available global options that have been created. Note: If you haven’t created any global options yet, then you probably won’t have the link. Suggesting that you have this option you will then proceed to the “apply to products” screen. From this screen you can check off the products that you would like to apply the global options. (I don’t think a selection exists to apply to all) However, you can click the “total items” link and adjust it to 100 products, then check off the first box to apply to all 100. So I guess Apply to 100 at a time is the correct answer to your question.



You will also note the “choose options” check box below your products list. You need to scroll down the page below the products in-order to see the available global options. Also, don’t forget to hit the apply button.



Just so you know…You probably will want to check off the “Apply as link” before hitting the apply button. This way if you decide to add an additional variant to your global option at a later date, then it will apply the change to all of your products at the same time. Essentially keeping you from needing to add the newly formed variant manually for every product.



Hope this helps. If another way exists then I’d like to hear it too.



Stu

Ah, I was just looking for the answer to this question myself. If you’re using the 2.1.? version then I believe the only way to accomplish this is to…



Go to Catalog->Global Options->you will see a “add to products” link just below the available global options that have been created. Note: If you haven’t created any global options yet, then you probably won’t have the link. Suggesting that you have this option you will then proceed to the “apply to products” screen. From this screen you can check off the products that you would like to apply the global options. (I don’t think a selection exists to apply to all) However, you can click the “total items” link and adjust it to 100 products, then check off the first box to apply to all 100. So I guess Apply to 100 at a time is the correct answer to your question.



You will also note the “choose options” check box below your products list. You need to scroll down the page below the products in-order to see the available global options. Also, don’t forget to hit the apply button.



Just so you know…You probably will want to check off the “Apply as link” before hitting the apply button. This way if you decide to add an additional variant to your global option at a later date, then it will apply the change to all of your products at the same time. Essentially keeping you from needing to add the newly formed variant manually for every product.



Hope this helps. If another way exists then I’d like to hear it too.



Stu

I think he’s wanting to update 20K products with the same global options.



I don’t believe there is a reasonable way to do this via the admin interface and that many products would probably fail in an import.



You can look at the table cscart_product_globlal_option_links.



It is a simple mapping of product_id to option_id so once you know the option_id of the global option, you can update the table pretty easily with a single SQL statement.

[quote name=‘tbirnseth’]I think he’s wanting to update 20K products with the same global options.



I don’t believe there is a reasonable way to do this via the admin interface and that many products would probably fail in an import.



You can look at the table cscart_product_globlal_option_links.



It is a simple mapping of product_id to option_id so once you know the option_id of the global option, you can update the table pretty easily with a single SQL statement.[/QUOTE]



Exactly what I wanted… Figured I could easily do it thru SQL… Just wanted to make sure I couldn’t do it in Admin before I went that route… Thanks…

I dbe interested how you do it if you let me know when your done



Thanks

John

Overall it was pretty easy… I built all my “Global Option Sets”… Then applied them to one product… Then go into mysql take a look at your data base.



1.) Click on your cart_products table. Now your just looking at your product_id… You need to know the starting and ending ID… Write it down…



2.)Click on cart_product_global_option_links… You should see the one product you added the global options to it… Export that table out to excel…



3.) Open it in excel. You will have two columns… option_id and product_id



4.)The option_id is each set of global options you created… Now build you excel .csv file… Every product_id has to have every option_id



So basically all said and done. Note option_id just repeats and product_id list all your product ID’s…



(just an example of the data file your going to import back into your database table)

option_id,product_id

736,29778

737,29778

738,29778

739,29778

736,29779

737,29779

738,29779

739,29779

736,29780

737,29780

738,29780

739,29780



Hope this makes sense…

Another option is as follows. You need to know the option_id of the option you want applied to all products. Then the following (untested) should work (replacing with the numeric value):


INSERT INTO cscart_global_option_links SELECT '', product_id FROM cscart_products WHERE status='A';




This will create rows with the option_id set to a fixed value and the product_id being those products that are Active. If you want all products regardless of their status, just remove the WHERE clause.



If you want 3 global options, then simply run it 3 times with a different .

Great, thanks guys,



:smiley:

[quote name=‘tbirnseth’]Another option is as follows. You need to know the option_id of the option you want applied to all products. Then the following (untested) should work (replacing with the numeric value):


INSERT INTO cscart_global_option_links SELECT '', product_id FROM cscart_products WHERE status='A';




This will create rows with the option_id set to a fixed value and the product_id being those products that are Active. If you want all products regardless of their status, just remove the WHERE clause.



If you want 3 global options, then simply run it 3 times with a different .[/QUOTE]



Well, that was the easy way… lol… I guess I’m no SQL master yet… Thanks for that…