Home > widget-integration > FilterAPI > handleCurrencyMetadata
FilterAPI.handleCurrencyMetadata() method
Handles currency metadata from API response.
This method updates shop currency settings (money_format, money_format_with_currency, currency) based on metadata returned from the API. Override this method to customize currency handling or apply shop-specific currency transformations.
Signature:
protected handleCurrencyMetadata(meta: {
money_format?: string;
money_format_with_currency?: string;
currency?: string;
}): void;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
meta |
{ money_format?: string; money_format_with_currency?: string; currency?: string; } |
Metadata from API response containing currency information |
Returns:
void
Example
Extend to add custom currency formatting:
window.boostWidgetIntegration.extend('FilterAPI', (FilterAPI) => {
return class CustomFilterAPI extends FilterAPI {
protected handleCurrencyMetadata(meta) {
super.handleCurrencyMetadata(meta);
// Apply shop-specific currency rounding rules
if (this.appService.TAEAppConfig.shop) {
this.appService.TAEAppConfig.shop.round_prices = true;
}
}
};
});