/** * @param SimpleXMLElement $element * @param Catalog_Model_Products $product * @return SimpleXMLElement */ public function addProductXml(SimpleXMLElement $element, Catalog_Model_Products $product) { $element->addAttribute('id', $product->getid()); $element->addChild('title', $product->getName())->addAttribute('sku', $product->getSku()); $element->addChild('image', $product->getImage()); $draftImages = unserialize($product->getAImages()); $draft = !empty($draftImages) ? $draftImages[0] : null; $element->addChild('image', $draft); $element->addChild('description', $product->getDescription()); $element->addChild('note', $product->getNote()); $properties = $element->addChild('properties'); $this->addPropertiesProductXml($properties, $product); $modifications = $element->addChild('modificationsTable'); $this->addModificationTableXml($modifications, $product); return $element; }