Bukimedia / PrestaSharp

CSharp .Net client library for the PrestaShop API via web service
GNU General Public License v3.0
155 stars 152 forks source link

Getting product description #296

Closed wh1337 closed 6 years ago

wh1337 commented 6 years ago

How can I get the product description? I've tried everything that I can think of.

LuisDavidR commented 6 years ago

Hi,

product.description is a list of languages:

public List<Entities.AuxEntities.language> description { get; set; }

because you can have one description for each language.

So to access all the descriptions of that product in all languages, you have to do something like this:

foreach (language lang in langfactory.GetAll())
{
     //to add a description to every language
     product.description.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)lang.id, "Description You Want"));

     //to read the description
     productDescriptionList.Add(product.description[lang.id]).Value;
}
wh1337 commented 6 years ago

Thank you!

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.