Jump to content

Creating new Attribute?


Recommended Posts

Hi. 

 

I wanted to create an new Attribute using this code

$a = new Attribute();
$a->name = $value;
$a->id_attribute_group = $groupId;
$a->color = $color;
$a->add();

obviously its wrong. But what is the recommend way to create an attribute like another color, if not to fizzle around in the database?

 

I also had a look at this code:

https://stackoverflow.com/questions/28903985/programmatically-creating-combinations-prestashop-1-6

 

But it also seems to crash as soon as "add" get called.

Edited by tharo (see edit history)
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...