English
price-service.mdRenderBefore.isGetRealPrice
About 162 wordsLess than 1 minute
2026-05-08
Execution Timing
When copying and mapping draft-box data, determine whether the pricing service should be executed
Parameters
| Parameter | Description | Type |
|---|---|---|
| param | Parameter object | Object |
Return Result
| Parameter | Description | Type |
|---|---|---|
| getRealPrice | Whether the pricing service needs to be executed | Boolean |
Notes
- This hook is triggered when copying and mapping draft-box data and is used to determine whether the pricing service needs to be executed.
- It can be used to determine whether to execute the pricing service based on specific business logic.
- When the returned
getRealPriceis true, the system executes the pricing service. - If the returned
getRealPriceis false, the pricing service is skipped.
Code Example
export default class Plugin {
apply() {
return [{
event: "price-service.mdRenderBefore.isGetRealPrice",
functional: this.isGetRealPrice.bind(this)
},
];
}
async isGetRealPrice(context){
let { param } = context;
let needPriceService = true;
// Determine whether pricing is required based on specific conditions in the parameters
if(param) {
// Pricing is required for specific draft types
}
return {
getRealPrice: needPriceService
};
}
}