Extend it the way you extend WordPress.
The register is built on the same actions and filters as WordPress itself, with more than 30 documented hooks and a JavaScript API for adding screens and features. Our own features use the same hooks yours will.
Register, then hook in
Register your extension, say which API version it needs, and attach your hooks in its boot function. It only runs when the register is compatible.
Training mode, receipt printing and the card reader display are built on these same hooks, the way an extension would be.
add_action( 'woopos_register_extensions', static function () {
woopos_register_extension( 'loyalty', array(
'name' => 'Loyalty points',
'version' => '1.0.0',
'requires_api' => '1.0',
'boot' => static function () {
add_action( 'woopos_order_paid', 'my_loyalty_award', 10, 2 );
},
) );
} );sdk.register.registerReportCard({
extId: 'loyalty',
id: 'points',
order: 10,
component: PointsCard,
});A taste of the hooks
PHP actions
woopos_register_extensions- Register your extension
woopos_order_paid- A sale is fully paid
woopos_order_voided- An unpaid sale is canceled
woopos_before_refund- A return is about to be refunded
woopos_refund_created- A refund exists
woopos_refund_failed- A return didn't go through
PHP filters
woopos_validate_order_items- Check or refuse lines before a sale is created
woopos_order_created- Add to an order once it's saved
woopos_order_array- Add fields the register sees on an order
woopos_catalog_product- Add fields to each product in the catalog
woopos_report_sections- Add sections to reports and Z reports
woopos_printed_receipt- Change a thermal printer receipt
woopos_receipt_email_sections- Add blocks to the emailed receipt
woopos_approval_actions- Add your own supervisor-approved actions
JavaScript registrars
registerRoute- A whole new screen, with its own place in the navigation
registerProductDecorator- Badges on products
registerProductHandler- Take over adding a product, for example with a picker
registerCartLineType- How the cart edits and merges your own kinds of line
registerScanHandler- Claim scanned codes before the register looks them up
registerReceiptSection- Sections on the receipt
registerDoneAction- Buttons on the done screen
registerReportCard- Cards on the Reports screen
registerSettingsSection- Your own settings
registerApprovalAction- Describe your own approval actions in the PIN dialog
What the register promises your code
A broken add-on can't stop a sale
Everything you add renders inside its own error boundary. An add-on that keeps failing is switched off until reload, and managers see a banner.
Security doesn't bend
Add-on code must be served from your own site, and the register's strict content security policy is never relaxed for an extension.
Accessible by contract
Extensions announce through the register, move focus through it, and use its accessible components, so screen reader users never hit a dead end.
A versioned API
Extensions declare the API version they need. Additions bump the minor version, and a replaced hook keeps working for a full minor version, with a notice, before it goes.
Related
- Built on WooCommerceYour products, stock, tax, orders and customers stay in WooCommerce. The register sits on top.
- SecurityThe server prices every sale, approvals cover exactly what was shown, and card data never touches your site.
- AccessibilityDesigned for blind and low-vision staff from the start, for JAWS, NVDA and VoiceOver.
- Cash drawer and reportsFloats, blind counts, Z reports saved at close, sales reports and an audit log nobody can edit.
Ring up a sale yourself.
The live demo is the real register, running in your browser with nothing to install. Turn on your screen reader and try a full sale.