Hi,
We are facing an issue where the 'salable quantity' is stuck on 0 after an item comes back into stock and only increased when we manually run a re index through SSH.
We have an epos / stock management system which pushes stock back up to Magento every 15 mins and updates the 'quantity' field but the 'salable quantity' is staying on 0 meaning the product can't be purchased.
Scenario:
- Product sells out and quantity and salable quantity drop to 0.
- New stock arrives and epos pushes a quantity of 10 up to magento.
- Quantity field now reflects 10 units in stock.
- 'Salable quantity' remains on 0 until we run a full re index through SSH.
See example product below, items in stock is 5, but salable quantity is 0:
Do we need to setup something else to replicate running a manual full re index to update the salable quantity?
This is annoying as we have to login and run an index a couple of times a day at present which isn't sustainable, hopefully this is something simple!
Solved! Go to Solution.
epos has its own module?
or it's using default Magento REST APIs to update the stock?
if it's running its own module then you need to update/override the code & put a reindex for stock.
else the simplest way to set a cron for reindex the stock every 15 mins
to edit current crons
crontab -e
this will open an editor in which you can set up crons
add the following line ( update your path to magento2 )
* * * * * php /var/www/html/magento2/bin/magento indexer:reindex cataloginventory_stock
kindly Accept as a Solution if this works for you and give Kudos
epos has its own module?
or it's using default Magento REST APIs to update the stock?
if it's running its own module then you need to update/override the code & put a reindex for stock.
else the simplest way to set a cron for reindex the stock every 15 mins
to edit current crons
crontab -e
this will open an editor in which you can set up crons
add the following line ( update your path to magento2 )
* * * * * php /var/www/html/magento2/bin/magento indexer:reindex cataloginventory_stock
kindly Accept as a Solution if this works for you and give Kudos
Hi @amitsamsukha, spot on - I added this and set the time to 1 min after the stock update runs and it's working great now - Much appreciated.
I don't think the other cron jobs are running though as the only one I can see updating is this one I've used your code for and set to run every 15 mins.
When I view the status they show as the below (I am assuming the 'X in backlog' isn't a good thing and need clearing down? - How can I do this?):
The cronjobs are setup as below:
As you can see they are all scheduled to run every 15 mins, it's currently 23:59 here, as you can see the only cron job which has ran in the last hour is the inventory one circled in blue which has it's own cron job instance (4th one list on cron list schedule above). No others seem to be running every 15 mins:
The last time the other ran was when I ran a full manual index through SSH at 22:39.
A - Should these show as running every 15 mins on the Magento Index screen like the inventory one does?
and
B - How do I rectify this issue if it is a case that they aren't working for some reason?
Can you advise on this one too as it's confusing me!
Thanks in advance.
crons with
* * * * *
are every minute
to update that to every 15 mins you need to update that to
*/15 * * * *
also, the timezone on the server is mostly UTC and the default timezone is set in Magento so that is the time difference you see.
@salesurmst8ade wrote:Hi,
We are facing an issue where the 'salable quantity' is stuck on 0 after an item comes back into stock and only increased when we manually run a re index through SSH.
We have an epos / stock management system which pushes stock back up to Magento every 15 mins and updates the 'quantity' field but the 'salable quantity' is staying on 0 meaning the product can't be purchased.
Scenario:
- Product sells out and quantity and salable quantity drop to 0.
- New stock arrives and epos pushes a quantity of 10 up to magento.
- Quantity field now reflects 10 units in stock.
- 'Salable quantity' remains on 0 until we run a full re index through SSH.
See example product below, items in stock is 5, but salable quantity is 0:
Do we need to setup something else to replicate running a manual full re index to update the salable quantity?
This is annoying purifier as we have to login and run an index a couple of times a day at present which isn't sustainable, hopefully this is something simple!
Thanks for asking the question i was suffering with the same problem but now i have sorted my issue. But your thread was exactly related to my problem.
Cheers
I still have the same issue even though I have updated the index.
2 questions:
1. Is there a mysql query I can run so that Salable Quantity = Quantity
2. How can I stop this Salable Quantity non sense since I only have one warehouse.
Thx
Solved my issue via this mysql command:
UPDATE `cataloginventory_stock_status` SET `stock_status` = 1
basically you need to change the stock_status to 1.