The ability to show a button on the order edit screen has been added
Tags:
Starting from V7Preview5, the plugin will have the ability to add a custom button to the bottom panel of the order edit screen (except for deliveries).
A method AddButtonToOrderEditScreen has been added with the following parameters:
caption— button text,iconGeometry— icon in Path Markup format (can be without an icon),callback— button click handler, where dialog windows can be shown and changes can be made to the order.
Current version limitations:
- The method must be called in advance, before navigating to the order edit screen, for example, when the plugin is launched. Once added, the button will be displayed during any visit to the edit screen throughout the session, until the plugin removes the button by calling
Disposeon the object returned from the method. If the order edit screen is already open at the time of adding or removing the button, the change will not take effect immediately, but will apply on the next transition to that screen. Thus, the button can currently only be added once for all orders. In future versions, changes will be applied on the fly, including to the current screen, allowing the button to be shown according to the current state of a specific order. - Depending on the settings, a different number of standard buttons may be displayed in the bottom panel of the order edit screen, but only one button from plugins is currently shown, even if there is space for more. If there are multiple plugin buttons, a general “Additions” button will be displayed, which, when clicked, will open a dialog to select a specific plugin button. This will be fixed in future versions — buttons will occupy all available space, and the selection dialog will only be needed if there are still buttons that cannot fit.
- Currently, the button can only be added to the order edit screen in restaurants and fast food. The delivery order edit screen differs in that it does not save changes until the user completes editing by clicking “Save”; accordingly, the plugin does not see the intermediate unsaved state and cannot make changes to it. A plugin button without the ability to change a delivery order makes no sense, which is why it is not present on the delivery screen.
Additionally, buttons can already be added to the following screens:
AddButtonToPluginsMenu— “Additions” menu of the main screenAddButtonToClosedOrderScreen— closed order screen, icons are now also supported hereAddButtonToProductsReturnScreen— screen for returning products from an order closed in one of the previous cash shifts