Jump to content
olivier.mongeot@gmail.com

WebServices for create products with attributes

Recommended Posts

Hello,

I'm trying to create product with multiple attributes with the Prestashop 1.7 API.

Everything is OK to create a simple product, but do you know if there is a documentation or an advised method to create a product with by example a mix of 2 colors and 2 sizes ?

I use this library :
https://github.com/PrestaShop/PrestaShop-webservice-lib

I've check in the official doc here without success, there is no details : https://devdocs.prestashop.com/1.7/development/webservice/tutorials/prestashop-webservice-lib/

I think there is maybe three solutions :

  • post all variations in one time 
  • make a special part in the code for add each variation (4 in my case, 2 colors and 2 sizes)
  • make a home-code for add informations with Php/SQL  

I think about something like this but without success

$product->associations->combinaisons->addChild('combinaison')->addChild('id, $newId');

$product->associations->combinaisons->addChild('combinaison')->addChild('ean13', $newEan13);

Please, maybe someone have an idea or have ever do this ?

Attached, my actual script. 

++

 

add_img.php create_product.php path_auth.php

Edited by olivier.mongeot@gmail.com (see edit history)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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