Bukimedia / PrestaSharp

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

New Product not inserting in prestashop and the request returns null and id = 1 #302

Closed jgonzal1873 closed 5 years ago

jgonzal1873 commented 6 years ago

I'm trying to insert a product using the latest prestasharp version to a prestashop version 1.6.1.17. Some how when I add the product, it returns the id_product of a product that is already created in the database. I doesn't apply auto_increment, and as a result the product is not created.

I put the code

   var product = new Bukimedia.PrestaSharp.Entities.product();
    product.id = 10007;
    product.active = 1;
    product.reference = "10007";
    product.name.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language(4, "Test 2"));
    product.condition = "new"; //new, used, refurbished
    product.price = 15000;
    product.show_price = 1;
    product.available_for_order = 1;

    ProductFactory pf = new ProductFactory(BaseUrl, Account, Password);
    product = pf.Add(product);

    string t = product.id.ToString();

The id of the product is not created and it returns a 1 which is the id of the product that is already in the database.

Any help would be appreciated.

Johnny

mowcixo commented 5 years ago

Hello @jgonzal1873, lately we were fixing some bugs related to that, could you try again and let us know?

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.