Jump to content

[Solved] Automatic creation of product features


Amadek

Recommended Posts

I need to create a product attribute such as “Product weight (grams)” and “Weight including packaging (grams).” I want to automatically create values for this trait from 1 to 10000.
There is no way to create something like this manually because it is too much work. I need to write a script that will add such values to the database automatically. Do you have any ideas? To which table in the database should I add this?

Edited by Amadek (see edit history)
Link to comment
Share on other sites

I found solution:

#include <stdio.h>
int main()
{
    int i=1;
    while(i<=1000)
    printf("INSERT INTO `feature_value`(`id_feature_value`, `id_feature`, `custom`) VALUES ('%d','3','0');\n",i++);
}


int main()
{
    int beton=1;  
    int i=1;
    while(i<=10000)
    printf("INSERT INTO `feature_value_lang`(`id_feature_value`, `id_lang`, `value`) VALUES ('%d','1','%d');\n",i++,beton++);
}

Enjoy :)

Link to comment
Share on other sites

  • Amadek changed the title to [Solved] Automatic creation of product features

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...