User Hooks are a feature that allows customizing the application in a way that is less invasive and that can be easily disabled for diagnosing problems with the customization. Hooks are code that is conditionally executed by some application packages. The condition is that the hook has to be enabled.
Hook calls are interleaved in some of ASO APIs, mostly on public APIs. There are two types of Hooks:
Pre-processing Hooks: Are hooks that execute (if enabled) before the API does any actual processing. These are good for modifying/adding information so the API can proceed with that change in place. These hooks are of type B (from Before)
Post-processing Hooks: Are hooks that execute (if enabled) after the API did all processing. Post hooks are usually good for cleanup of a pre-hook or for further processing after the vanilla API has finished work. These hooks are of type A (from After).
Below are the Steps to Implement Custom Hooks in ASO .
Requirement for Implementation in my Case - In my example I want to use Freight Terms at the iStore to be used as Qualifier to derive the item price in Shopping Cart in iStore, but Freight Terms is not supported as Qualifier for iStore ,and to fulfilfill this requirement , I have implemented custom hook to used Freight Terms as Qualifier from the iStore.
Implementation Steps