Skip to main content

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

overrideFeatures(params: OverridableFeatures): void

Parameters

Name

Type

Description

params

OverridableFeatures

A key/value pair that represents the feature to override and the strategy

Returns

void

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() 
   }
);