Stop selling out of stock items

You wont be able to disable button but is possible to use header to display stock level and show message and cancel order when added.
My sugestion before about product tags may not be posible, forgot there isnt an easy way to update from automation.

So you want an on the fly setting you can do and it resets each day?

Not for all products. just those ones you want to do stock for…

If its just for 1 or 2 products you could just use a program setting.

It seems i made something wrong then.

What exactly in program settings you mean?

image

Custom settings.
Value can be called with {SETTING:xxx} where xx is setting name.
Is Local would want to be false making it a global value stored in DB rather than local terminal cache.

1 Like

Oh, thanks a lot. I will definitely try with it.

Dont use increase decrease option, it often doesnt work as expected.
Do a sum so update using current value -1 one like [=TN(’{SETTING:IceCreamStock}’-1]

Is there any time or quantity limit to store settings?

Local are stored in cache and cleared on samba restart. Global (Is Local=False) are stored in database and persistent until updated/cleared.
If related products are predefined you could use custom entity screen to show and update. The setting field for entity screen is for local so would need custom setup. Alternatively you could look at some way to update maybe from an order level automation command.

How that can be implemented? Now, i am using inventory for that and applied action and rules. However, products that are not created in Inventory Items cannot be placed to ticket.
1

If you are using inventory I could check and see if there is different value returned for items which are not set in venventory and those that are.
I would expect no inventory setup may return null vs 0 but never tested.
If that were the case you may be able to allow unconfoguered by adding the same value again and setting is not null for constraint.

That’s the issue, in each case it return null :expressionless:

If they both return null then something else is wrong as how can a valid inventory query return null?
What’s the Russian bit after {NAME}? (Sorry if it not rusian, being a bit presumptive)
I’ve never delved to deep into inventory so not best one to help.

It is warehouse name. Локальный склад-Local warehouse

Run some tests twweking that expression. I would expect it to return something other than null if inventory were setup correctly and expression correct.
There are several name type {} expressions so try some of the others.
Maybe try hardcoding a name.
Also not sure if it would require inventory item to have exact name of product for you example to work. Don’t know if it would resolve inventory from order/product name like that is inventory item is named differently.

My bad, it seems, it is not retorning null. I put new rule constraint {REPORT INVENTORY:{NAME}:Warehouse name} in not null and this rule works, however i cannot see retuned value through show message action.

I have something similar in my experimental setup. It shows a popup message but never really tried cancelling orders though.

Does displaying [:MenuItemName] not work for you?

You have less than 15 on constraint of less than 5? :-p

1 Like