Add Product Option via MySQL

  • Howard Theriot
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 11 months ago #113541 by Howard Theriot
Add Product Option via MySQL was created by Howard Theriot
I have about 2000 products that need a product option added. The option is already set up and applied to some products. Is there any way I can add to other products with a MySQL operation?

I have successfully updated existing option values using a simple find/replace like this…
Code:
UPDATE `table_name` SET `field_name` = replace(same_field_name, 'unwanted_text', 'wanted_text')

But, I cannot figure out how to add a product option to products in a similar way. Any advice?

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Away
  • Administrator
  • Administrator
More
5 years 11 months ago #113779 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Add Product Option via MySQL
Hello Howard,

EShop has already supported the feature to allow you to add/duplicate options from a product to other products.

Please go to the back-end of your site, then go to EShop -> System -> Configuration -> Option tab, at "Assign same options" choose Yes, then Save.

Go to edit a product now, under Option tab, you will see the option to choose products to have the same options with the current product.

Hope that you can use that features for what you want.

Sincerely, Giang

Please Log in or Create an account to join the conversation.

  • Howard Theriot
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 11 months ago #113809 by Howard Theriot
Replied by Howard Theriot on topic Add Product Option via MySQL
Yes, but I need to edit 2000 products and it would take for too long to do each one individually. I was looking for a way to do it with a DB operation.

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Away
  • Administrator
  • Administrator
More
5 years 11 months ago #113842 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Add Product Option via MySQL
No Howard,

You just need to edit a product, then save to copy all of options to same other products.

Have you tried it yet?

Sincerely, Giang

Please Log in or Create an account to join the conversation.

  • Howard Theriot
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 11 months ago #113861 by Howard Theriot
Replied by Howard Theriot on topic Add Product Option via MySQL
That would be faster than editing each product, but I have to add 2000 separate items to the list individually. I am speaking with someone who might be able to do it via MySQL.

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Away
  • Administrator
  • Administrator
More
5 years 11 months ago #113883 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Add Product Option via MySQL
Hello Howard,

I am not sure what you want exactly. Hope that someone else can take the time and help you on this.

Sincerely, Giang

Please Log in or Create an account to join the conversation.

Moderators: Giang Dinh Truong