Bukimedia / PrestaSharp

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

Error CData 86 The association "product_option_values" does not exists #357

Open DomingoSerrano opened 5 years ago

DomingoSerrano commented 5 years ago

Hi,

I'm having the error CData86 The association "product_option_values" does not exist when creating or updating a product in prestashop and I do not know how to fix it. I have been looking for information about this error but I have not found anything. I leave here the code that I used to create a new product or update product.

private void button1_Click(object sender, EventArgs e) { var product = new Bukimedia.PrestaSharp.Entities.product(); product.id = 6211; product.active = 1; product.reference = "10007"; product.name.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language(1, "Test 2")); product.link_rewrite.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language(1, "Prueba-95")); product.condition = "new"; //new, used, refurbished product.price = 15000; product.show_price = 1; product.available_for_order = 1;

        product.associations.categories.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.category((long)1));

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

        string t = product.id.ToString();
    }

    private void button2_Click(object sender, EventArgs e)
    {
        ProductFactory produkty = new ProductFactory(BaseUrl, Account, Password);
        product produkt = produkty.Get(6210);
        produkt.price = 12;
        produkt.name.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language(2, "name"));
        produkty.Update(produkt);
    }