Jump to content

Adding attributes to product via PHP


Recommended Posts

Hi,

I'm currently developping a script to import products from an external database.

After spending many hours on the subjject, i still cannot find a way to make a product declinable via PHP.

Having the following code
 

$product = new Product( $product_id );

$attribute_group_id = 10 // The "weight" attribute group

$attribute_ids = [10, 12] // The attributes ids, ie: 1kg and 2kg

 

How would i make my product declinaible with those attributes please? I already found this thread, but some functions are deprecated,  the solution is very incomplete, and the functions are undocumented.

Thanks for your help

 

Link to comment
Share on other sites

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...