MrBaseball34 Posted August 5, 2011 Share Posted August 5, 2011 Having difficulty adding combinations in an import script I have. Can anybody point me to code that shows how to programatically add combinations? Link to comment Share on other sites More sharing options...
MrBaseball34 Posted August 17, 2011 Author Share Posted August 17, 2011 Bumping, trying to get an answer. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted August 24, 2011 Author Share Posted August 24, 2011 One more bump. I'm pulling my hair out trying to get this to work. Link to comment Share on other sites More sharing options...
Spechter Posted August 27, 2011 Share Posted August 27, 2011 Hey, try this: public function addCombination() { $attributes = Attribute::getAttributes($id_lang); $this->product = new Product($product_id, true, self::$cookie->id_lang); // list of attribute ids.. $combinationAttributes[] = $attributes[0]['id_attribute']; $combinationAttributes[] = $attributes[1]['id_attribute']; if(!$this->product->productAttributeExists($combinationAttributes)) { $price = 1; $weight = 100; $ecotax = 7; $unit_price_impact; $quantity = 1; $reference = ""; $supplier_reference = ""; $ean13 = ""; $default = false; $idProductAttribute = $this->product->addProductAttribute((float)$price, (float)$weight, $unit_price_impact, (float)$ecotax, (int)$quantity, "", strval($reference), strval($supplier_reference), strval($ean13), $default, NULL, NULL); $this->product->addAttributeCombinaison($idProductAttribute, $combinationAttributes); } } 1 Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 8, 2011 Author Share Posted September 8, 2011 Not exactly what I was looking for but it, at least makes me aware that I need to modify my import script to use PS functions vs. writing my own. That would make it much easier overall. 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