Home > widget-integration > CartModule > setupBlockListener

CartModule.setupBlockListener() method

Sets up the TAE App block listener for cart blocks. Override this method to customize block registration logic or support additional block types.

Signature:

protected setupBlockListener(): void;

Returns:

void

Example

// Add support for custom cart block types
protected setupBlockListener() {
  this.appService.TAEApp.addRegistryBlockListener((block) => {
    if (block.blockType === 'cart' || block.blockType === 'mini-cart') {
      this.onInitBlock(block);
    }
  });
}