Jump to content

Webservice Class Category


Recommended Posts

Bonsoir,

 

Lorsque j'utilise le service web, pour lister les catégories comme ceci:

http://localhost/pre...pi/categories/1

 

Ca m'affiche ceci:

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<category>
   <id><![CDATA[1]]></id>
   <id_parent></id_parent>
   <level_depth readonly="true"><![CDATA[0]]></level_depth>
   <nb_products_recursive not_filterable="true" readonly="true"><![CDATA[10]]></nb_products_recursive>
   <active><![CDATA[1]]></active>
   <name><language id="1" xlink:href="http://localhost/prestashop/api/languages/1"><![CDATA[Home]]></language><language id="2" xlink:href="http://localhost/prestashop/api/languages/2"><![CDATA[Accueil]]></language></name>
   <link_rewrite><language id="1" xlink:href="http://localhost/prestashop/api/languages/1"><![CDATA[home]]></language><language id="2" xlink:href="http://localhost/prestashop/api/languages/2"><![CDATA[home]]></language></link_rewrite>
   <meta_title><language id="1" xlink:href="http://localhost/prestashop/api/languages/1"></language><language id="2" xlink:href="http://localhost/prestashop/api/languages/2"></language></meta_title>
   <meta_description><language id="1" xlink:href="http://localhost/prestashop/api/languages/1"></language><language id="2" xlink:href="http://localhost/prestashop/api/languages/2"></language></meta_description>
   <meta_keywords><language id="1" xlink:href="http://localhost/prestashop/api/languages/1"></language><language id="2" xlink:href="http://localhost/prestashop/api/languages/2"></language></meta_keywords>
   <description><language id="1" xlink:href="http://localhost/prestashop/api/languages/1"><![CDATA[]]></language><language id="2" xlink:href="http://localhost/prestashop/api/languages/2"><![CDATA[]]></language></description>
   <date_add readonly="true"><![CDATA[2013-03-22 14:24:30]]></date_add>
   <date_upd readonly="true"><![CDATA[2013-03-22 14:24:30]]></date_upd>
<associations>
<categories node_type="category">
   <category xlink:href="http://localhost/prestashop/api/categories/2">
   <id><![CDATA[2]]></id>
   </category>
   <category xlink:href="http://localhost/prestashop/api/categories/3">
   <id><![CDATA[3]]></id>
   </category>
   <category xlink:href="http://localhost/prestashop/api/categories/4">
   <id><![CDATA[4]]></id>
   </category>
   <category xlink:href="http://localhost/prestashop/api/categories/11">
   <id><![CDATA[11]]></id>
   </category>
   <category xlink:href="http://localhost/prestashop/api/categories/15">
   <id><![CDATA[15]]></id>
   </category>
</categories>
<products node_type="product">
   <product xlink:href="http://localhost/prestashop/api/products/6">
   <id><![CDATA[6]]></id>
   </product>
   <product xlink:href="http://localhost/prestashop/api/products/7">
   <id><![CDATA[7]]></id>
   </product>
</products>
</associations>
</category>
</prestashop>

Ca marche nickel, moi ce qui m'intéresse à ce stade ce sont les informations contenu dans la balise

 

<associations>

...

</associations>

 

En effet je m'apercois que l'on m'affiche bien les autres catégories et les produits qui y sont associés.

Mon but c'est de pouvoir afficher le nom de chaque catégories, sans faire à chaque fois une requête pour avoir les informations la concernant.

 

Ex:

 

<category xlink:href="http://localhost/prestashop/api/categories/2">

<id>2</id>

<name>iPods</name>

</category>

 

Il faut modifier la Class Category mais comment je dois faire?

 

Merci

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...