Jump to content

C# PrestaSharp not updating Quantities


Ryan.Mitchell

Recommended Posts

Hello,

We're using this current code to add quantities to a product when it is created. It creates the product in the backend OK but does not appear.

If you manually type the id of the product in the URL and update the quantity manually - it then shows.

 

var stockAvailableFactory = new StockAvailableFactory(baseUrl, accountKey, string.Empty);
                stockAvailableFactory.Update(
                    new Bukimedia.PrestaSharp.Entities.stock_available
                    {
                        id = product.associations.stock_availables[0]
                            .id,
                        id_product = product.id,
                        id_product_attribute = 0,
                        id_shop = shopId,
                        id_shop_group = 0,
                        quantity = 1,
                        depends_on_stock = 0,
                        out_of_stock = 1,
                    });

Link to comment
Share on other sites

  • 4 weeks later...

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