-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Cannot programmatically set product stock after product creation in 2.1.0 #5771
Comments
I have the same problem. I am using:
|
I was able to fix my issue like this:
|
Can you show |
It is a custom function on a custom module I created to load the stock of the product. My module is to add stock as a Lot instead of manually. so admin adds a product lot ID with a lot stock and the function looks for all the lots that are attached to the product and returns the total stock of all lots for that product. Basically $stockData is just a qty number. |
I have the same issue when creating a product for the first time programatically. I create the product with its factory and set all the values. For stock I create a ProductExtension object with the stockItem information and set it. It does save all the data, but it does not manage the stock. I use the same values in a json and post it using the api and it works well the problem is programatically doing so. |
Hi @Jrb1x I was just wondering why you closed this as we were having the same issue and were following this issue. Was there a resolution this? Thanks. |
@joesken I showed the solution to the issue above. |
[Pangolins] MFTF 3.0.0 RC4
Preconditions
Steps to reproduce
$product->load(1)
Expected result
Actual result
I'm able to set the products weight and other attributes just fine with similar code, but cannot change its stock data after the product has been created.
The text was updated successfully, but these errors were encountered: