Jump to content

Prestashop Webservice (Python) - Change Product Default Image


Recommended Posts

Hi all,

 

I'm currently using prestashop webservice with python.

 

I would like to update my prestashop product default image through webservice.

 

I have managed to upload the new image, i'm not sure how to change the current default image using webservice.

 

lets say my new image id = 66

 

my code:

 

template_data['product'].update({'id_default_image':66})

 

the code is succesful updated to template_data, but whenever it goes to python prestashop lib, the value is revert back to original value.

 

Is it possible? Any helps?

 

Thanks in advance.

Edited by sayaarief (see edit history)
Link to comment
Share on other sites

  • 6 months later...

I've same problem...

 

I'm working with Java and when I update a product via prestashop api all work fine except the id default image...

 

I think this is a readonly value.

 

I tried to upload image with put method but it returns an error...

 

Can anyone help me...

Link to comment
Share on other sites

  • 2 weeks later...

Finally i found a solution. I found out when you delete default image by webservice no image are set as default. if the product hasn't a default picture the first image uploaded became the default image.

 

So i delete the default image, I upload the new one, than if necessary i upload the old default image...

 

it's very expensive so if someone has an alternative solution it would be great!

 

Sorry for my english i hope you can understand...

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...