Anyone who has imported options on mass will know once you have them in and with stock tracking enabled it’s a bit of a pain to change them (on mass that is). Even if you change them one at a time you need to “rebuild” them. And if like me you have 2000 products setup with options stock tracking and then change your mind and want them all without options what do you do ?
Well you can either spend the rest of you life changing them one at a time or you can use this ugly way I’m going to show you now. Importing new options simple adds another option also.
Here I’ll delete all the options for a full category.
- You’ll need the product ID of every product. The simple way to get this is to go into a category list all the products and choose export to get them in a csv file.
- Now we need the url cs-cart uses to delete an option from a product. So go into one of the products with the option you want to remove and click options. Then hover your pointer of status - DELETE and right-click selecting copy shortcut.
- Copy this shortcut into a spreadsheet, it should look a bit like this;
YOURSITE/admin.php?dispatch=product_options.delete&option_id=[color=#ff0000]14[/color]&product_id=[color=#ff0000]2503[/color]
14 = the option ID
2503 = the product Id
- Remove the product id from the end after pasting the shortcut in the spreadsheet. Open your exported product csv file and copy all the product ids (normally the last coloumn). Now copy that into the next column after the already copied shortcut in the shortcut spreadsheet.
- Then copy all the data into a text editor, use search and replace to remove the space left between the “&prduct_id=” and “somenumber” - Now you have a complete list of all the urls needed to delete all the options from all the products.
- All you have to do is open each on in the browser. To do that I used http://www.urlopener.com - copy your list in the box and hit submit. Hit submit again to open each url. A new tab will open for each url so be warned that your browser may stop responding if you do too many. I was in a hurry and so did 2000 took about 30 minuites with a few “this script has stopped responding” - keep running.
I’m sure some cleaver bod could do a addon for this or a better script that closes the tab each time. But till then I hope this helps some one, I’ve also used this meathod to rebuild options.