BlackLemon Posted July 2, 2016 Share Posted July 2, 2016 (edited) Hello, I'm new here and to prestashop My problem is to add combinations with filled Attribute - value pair, like Size, Color,.. so I add many combinations to one product. I'm importing a product like this: $product = new Product(); $product->ean13 = ''; $product->name = array((int)Configuration::get('PS_LANG_DEFAULT') => $name); $product->link_rewrite = array((int)Configuration::get('PS_LANG_DEFAULT') => $this->friendly_url($name)); $product->id_category = 5; $product->id_category_default = 5; $product->redirect_type = '404'; $product->price = (int)$price; $product->quantity = 0; $product->minimal_quantity = 0; $product->show_price = 1; $product->on_sale = 0; $product->online_only = 0; $product->meta_keywords = $name; $product->is_virtual = 0; $product->description_short = array((int)(Configuration::get('PS_LANG_DEFAULT')) => $name); $product->description = array((int)(Configuration::get('PS_LANG_DEFAULT')) => $name); $product->add(); $product->addToCategories(array(2)); and also adding combination as $product->addCombinationEntity(111, 0, 0, 0, 0, 1, array(), 'ref', 0, '0000000000000', false); so the following product is as: $product->getAttributeCombinations((int)Configuration::get('PS_LANG_DEFAULT')); [id_product_attribute] => 106 [id_product] => 5055 [reference] => ref [supplier_reference] => [location] => [ean13] => 0000000000000 [upc] => [wholesale_price] => 111.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 0 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => [is_color_group] => [group_name] => [attribute_name] => [id_attribute] => But how can I fill last 5 values? like id_attribute_group, is_color_group, group_name, attribute_name, id_attribute So the expected result should be like this: as default PS Product(1) [id_attribute_group] => 1 [is_color_group] => 0 [group_name] => Size [attribute_name] => S [id_attribute] => 1 and [id_attribute_group] => 3 [is_color_group] => 1 [group_name] => Color [attribute_name] => Orange [id_attribute] => 13 Thanks for all suggestions! Edited July 2, 2016 by BlackLemon (see edit history) 1 Link to comment Share on other sites More sharing options...
BlackLemon Posted July 5, 2016 Author Share Posted July 5, 2016 bump.... anyone? Link to comment Share on other sites More sharing options...
muynck Posted December 26, 2016 Share Posted December 26, 2016 Did you find a solution for your problem already? 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