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

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

Important Information

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