kevingic Posted May 20, 2016 Share Posted May 20, 2016 (edited) Tout est dit dans le titre, je cherche à créer des attributs et des valuers à la volé pour l'instant j'ai sa : public function createAttributeValue($parentId) { $noDownloadable = new Attribute(); $noDownloadable->name[0] = 'no'; $noDownloadable->id_attribute_group = $parentId; $noDownloadable->add(); $yesDownloadable = new Attribute(); $yesDownloadable->name[0] = 'yes'; $yesDownloadable->id_attribute_group = $parentId; $yesDownloadable->add(); } public function createAttributeGroups() { $isDownloadable = new AttributeGroup(); $isDownloadable->fields->name = 'isdownloadable'; $isDownloadable->fields->public_name = 'isdownloadable'; $isDownloadable->fields->group_type = 'test'; $isDownloadable->fields->position = AttributeGroup::getHigherPosition() + 1; $isDownloadable->add(); $this->createAttributeValue($isDownloadable->position); } J'ai aussi testé sa: public function createAttributeGroups() { $isDownloadable = new AttributeGroup(); $isDownloadable->name[0] = 'isdownloadable'; $isDownloadable->public_name[0] = 'isdownloadable'; $isDownloadable->group_type = 'test'; $isDownloadable->position = AttributeGroup::getHigherPosition() + 1; $isDownloadable->add(); $this->createAttributeValue($isDownloadable->position); } L'erreur qui m'est renvoyé par prestashop est la suivante : Property AttributeGroup->group_type is empty je ne vois pas comment résoudre cette erreur. Au secours ^^ Edited May 20, 2016 by kevingic (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now