Override Features
The Override Features API (api.override) provides the ability to override some of the POS functionality (features).
overrideFeatures
Allows the Plugin to override specific POS features with a custom strategy/implementation.
Method |
| ||||||
Parameters |
| ||||||
Returns |
|
Example
Override print order receipt feature:
// Implement IPrintOrder interface
// Creates strategy for a custom print order
class CustomPrintOrder {
async apply(order, extraPrintData) {
// POS calls this method each time it prints an order receipt.
console.log('Printing receipts in the console:', order);
return { extraPrintData };
}
}
// Register the custom strategy for print order
api.override.overrideFeatures({
printOrder: new CustomPrintOrder()
}
);