Bukimedia / PrestaSharp

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

Error on category image #386

Open fredoche1810 opened 4 years ago

fredoche1810 commented 4 years ago

Hello, I'm working on prestashop 1.6 I don't have any problem to manage the pictures on the products but I don't know how to solve it with the categories. I know that we have to check if the category has already a picture or not. With this function I can add a picture : imageFactory.AddCategoryImage() With this function I can delete the picture : imageFactory.DeleteCategoryImage();

If i add a picture when the category already have a picture I receive an error. When I try to delete a picture where there isn't any picture I receive an error.

So I understand that I have to check if there is already a picture on my category or not.

I tried with this function imageFactory.GetCategoryImage((long)MyCategory.id, "category_default") but I receive an error in case of null or 0.

So please how can I manage the pictures of the categories by checking if the picture exist or not ?

Thanks in advance