Jump to content

Adding product image title via web api


carbonhoarder
 Share

Recommended Posts

I'm loading each product with its own image in my catalogue using the web api.

What key should I use in the POST array to load a description of the image?

$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:multipart/form-data','Expect:'));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
//curl_setopt($ch, CURLOPT_PUT, true); // Un-commet to edit an image
curl_setopt($ch, CURLOPT_USERPWD, $key.':');
curl_setopt($ch, CURLOPT_POSTFIELDS, array('image' => new \CurlFile($image_path)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);

Does anyone know?

Thanks in advance!

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 4 years later...

Not via API but if you're using the product name as image legend you could use this MySQL query:

UPDATE ps_image_lang AS t1
  INNER JOIN ps_image AS t2 ON t1.id_image = t2.id_image
  INNER JOIN ps_product_lang AS t3 ON t2.id_product = t3.id_product
SET t1.legend = t3.name;

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More