achitakayoh Posted July 23, 2011 Share Posted July 23, 2011 Hello, I'm trying to create a product by webservice (after a long time I finally succeeded), but I don't understand how to add an image to my product while creating it. $xml = $webService->get(array('resource' => 'products?schema=synopsis')); $resources = $xml->children()->children(); // Champs requis $resources->quantity = $product->getQuantity(); $resources->price = '15.5'; $resources->out_of_stock = '0'; $resources->name->language[1] = $product->getName(); $resources->link_rewrite->language[1] = $product->getEan(); // Meta $resources->meta_keywords->language[1] = $product->getMetaKeywords(); $resources->meta_title->language[1] = $product->getMetaTitle(); $resources->meta_description->language[1] = $product->getMetaDescription(); /// vide // References $resources->ean13 = $product->getEan(); $resources->supplier_reference = $product->getEan(); // Inventaire $resources->active = '1'; $resources->available_for_order = '1'; $resources->condition = 'new'; $resources->show_price = '1'; unset($resources->associations->categories->category); // associer a une categorie $resources->associations->categories->addChild('category')->addChild('id', 2); $xml = $webService->add( array( 'resource' => 'products', 'postXml' => $xml->asXML() ) ); Also, I want to add a description to my product but when I do : $resources->description->language[1] = 'foo'; it works, but when I have : $resources->description->language[1] = '<strong>foo</strong>'; I have an error with code 500. I tried with cdata and/or htmlentities, but I can't make it work. Please help ^^' Thanks P.S. : I'm on 1.4.3 Link to comment Share on other sites More sharing options...
achitakayoh Posted July 26, 2011 Author Share Posted July 26, 2011 Up! I think I will not be the only one to have this problem, and since it's an important feature it would be great if someone had any idea about it Thank you by advance ^^ Link to comment Share on other sites More sharing options...
DavidFlynn Posted July 26, 2011 Share Posted July 26, 2011 You are not the only one to encounter this problem I have encountered it as well and would love help! Link to comment Share on other sites More sharing options...
achitakayoh Posted July 29, 2011 Author Share Posted July 29, 2011 You are not the only one to encounter this problem I have encountered it as well and would love help! Yes, but it seems that me and my clients will have to use magento it's heavier, but at least I can use it the way I need... 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