JuliusB Posted March 14, 2019 Share Posted March 14, 2019 Prestashop 1.6 Hello everyone, I tried to create combination with homemade script. Problem is with the id_images use in addCombinationEntity method. I tried to send an array of image ID but no image is assign to the combination. // created image id echo (int)$image->id; // Display 2 for example $id_image[] = (int)$image->id; $id_product_attribute = $product->addCombinationEntity(15.5, 0, 0, 0, 0, 1, $id_image, "", 0, 0, false); Combination is created but images are not assign to it. I tried to insert image ID directly into database with no result : foreach($id_images as $image_id) { Db::getInstance()->execute('INSERT INTO `ps_product_attribute_image` VALUES ('.$id_product_attribute.' '.$image_id.')'); } Can someone help me please ? Thank you ! Link to comment Share on other sites More sharing options...
JuliusB Posted March 14, 2019 Author Share Posted March 14, 2019 Okay I found solution by myself. I used setImages method from combination class : // Right after addCombinationEntity $combination->setImages($id_images); 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