Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update a stock_availible #443

Open
ymonnet opened this issue May 19, 2022 · 0 comments
Open

Update a stock_availible #443

ymonnet opened this issue May 19, 2022 · 0 comments

Comments

@ymonnet
Copy link

ymonnet commented May 19, 2022

Please consider making a Pull Request if you are capable of doing so.

If your problem is how to implement anything with PrestaSharp or make a question,
please, refer to our Slack# group with this request link:
https://join.slack.com/t/prestasharp/shared_invite/enQtNTM2OTI1OTg0NzUyLTY4NDdkZDFmY2EwMGE4MTMzZjk5YzZiMTk3MzUwNzUxNTdhMWEwZjFjNDJiZTIyMjI0MDM0NTcwMzIzNGI0Njc

Library Version:

1.x.x

NuGet Package Url:

https://www.nuget.org/packages/PrestaSharp/1.x.x

Prestashop version:

1.7.8

Describe the Bug:

Hi, I have an issue with prestasharp. I can't upate a data into prestasharp without have this error :

stock_availables HttpStatusCode: NotFound
System.Collections.Generic.List1[InterfacePrestashop.Models.StocksAvailible] System.Collections.Generic.List1[Bukimedia.PrestaSharp.Entities.stock_available]

But in my database, i have an id of it. I use an object generate with the row so data are same. Add() doesn't work too.
My code :
`var temp = new stock_available();

                var tmp = GetStockAvailibleByIdProduct(data.id_product.ToString());

                if (tmp != null)
                {
                    tmp.quantity = data.quantity;
                    
                    //stkAvailibleFact.Update(tmp);
                    stkAvailibleFact.Update(tmp);
                }
                else
                {
                    temp.id_product = data.id_product;
                    temp.id = id;
                    temp.depends_on_stock = data.depends_on_stock;
                    temp.id_product_attribute = data.id_product_attribute;
                    temp.id_shop = data.id_shop;
                    temp.id_shop_group = data.id_shop_group;
                    temp.out_of_stock = data.out_of_stock;
                    temp.quantity = data.quantity;
                    id++;
                    stocksBulkAvailibles.Add(temp);
                }

            }
            stkAvailibleFact.AddList(stocksBulkAvailibles);`

To Reproduce:

  1. juste do an update on this table

Expected Behavior:

something i can do to bypass or correct code behind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant