Jump to content

Resolved - Add product option to ALL products using MySQL query


masterunix

Recommended Posts

Hello All,

 

I am new here and i run a very serious webshop that i just migrated from Opencart to Cubecart. I bought the full license and copyright removal and i will buy this for at least 3 or 4 sites. So far so good very happy with Cubecart.

 

However i am missing some features, but most of them not very important and i can hard code them in the templates files. However i am not a great programmer, but i do have ICT experience for more then 13 years and in daily life i am a freelancer based on Linux administrator, Windows enginering and sometimes supporting or management in the ITIL section like change management, so i do understand much.

 

What i really miss is a feature to add one specific product option to ALL products! I have 11.000 products and i just go live with my webshop after migrating and i forgot the product options! Normally all webshops i worked with (different systems) has a add product option to ALL products ... cubecart don't have this? Why?

 

I figured myself out this query:

 

INSERT INTO `CubeCart_options_set_product` (`set_product_id`, `set_id`, `product_id`) VALUES (1, 2, 1);

 

This will add product options to product id 1.

 

If i want to add the product option to product id 2 it will be:

 

INSERT INTO `CubeCart_options_set_product` (`set_product_id`, `set_id`, `product_id`) VALUES (2, 2, 2);
 
If i want to add this on product id 3 it will be:
 
INSERT INTO `CubeCart_options_set_product` (`set_product_id`, `set_id`, `product_id`) VALUES (3, 2, 3);
 
Ok so we get the idea ... now ... how can i do this to ALL of my 11.000 products?
 
Can someone PLEASE share a MYSQL query that will apply this to ALL product IDs? So i can make a cronjob of this activity?
 
Lets say: create product option to product id if not exists. if exists update.
 
Somethin like this.
 
And for you third party developers ... if this is easy for you, please make a module of it in admin i will pay you!
 
I need it URGENTLY, because i am live now and i lose orders, because people can not fill in their sizes or colors.
 
Thank you all.

 

 

Link to comment
Share on other sites

Nevermind i fixed it using excel sheet and execute query to change more then 11.000 products.

 

See example what excel creates for me for as an example for a few products:

 

 

INSERT INTO `CubeCart_options_set_product` (`set_product_id`, `set_id`, `product_id`) VALUES (8316,2,8316), (8317,2,8317), (8318,2,8318), (8319,2,8319), (8320,2,8320), (8321,2,8321), (8322,2,8322);

 

The above can be executed in the admin of cubecart so if you have 20.000 products it will also do ... i know its nott he best option, but i dont have a better solution since i am not an expert on programming.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...