Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Andreas Wagner

Issue with inline edit of location stock and total stock

Hey there,

we are using your plugin for displaying our stock amount from our different stock locations and also the total stock. For editing the location stocks easyily (without going on the product detail page) we would like inline edit the amount of the location stock (for example when a new produced product arrives a location). The problem we have is that the total stock is the sum of all the location stocks. When i edit a location stock in the product detail backend page i need to press update and the total stock gets its value from the sum of the location stock. When i do the same with inline editing it only updates the location stock and the total stock stays the same. I think this is because the function updating the total stock runs on the post update hook. Is it also possible to this for a inline edit?

Here I explained the issue in a screen video:

1 year, 2 months ago

You probably use the custom field column to display the different stock values. Our plugin doesn’t know anything about the context of those custom fields. With inline edit, it just changes the value for that specific custom field with the update_post_meta method.

In order to update the total stock, you’ll need to do the calculation yourself and update the total stock custom field. Or if the plugin you’re using has a method for it, you can use that. This can be done after the value is saved by using this hook:

1 year, 2 months ago

I understand what you’re asking.
But at this moment, we don’t have a way to refresh certain columns based on an inline edit action.
We do have a request for this on our backlog to investigate a way to make certain columns dependent on each other.
You probably don’t want a complete row to refresh after an inline edit action.
So no solution for this at the moment, but I have good faith that we will find a way to make columns dependent on each other and make this possible in the future, it is with an interface or with a hook.

1 year, 1 month ago

You must be logged in to reply to this topic.