Exported function
Export the formatter from your entry file under the extension’sfunctionName in napps.config.json. See How App Extensions work. The examples on this page name it formatProducts.
What you can change
Each item received byformatProducts is a ProductListingBaseDataEditor. With it, you can:
- Read the original product data.
- Change the vendor text.
- Set or clear the stamp image.
- Read, replace, add, or remove tags, including removing tags by type or clearing all tags.
- Hide or show the product, and check whether it is visible.
TypeScript types
setVisible(false) removes the product from the formatted list after all product formatter hooks finish running.
ProductTag is a runtime global. @napps/component-extension exports its type only, so construct tags with new ProductTag(...) and do not import ProductTag as a value.