English
dht.site.cart.getdata.after
About 100 wordsLess than 1 minute
2026-05-18
This event is called after the cart container obtains cart data. It can add, modify, delete, filter, sort, or group cart data.
Parameters
| Parameter | Description | Type |
|---|---|---|
| params | Empty object. No parameters are passed in the current version. | Object |
| pluginService | Common plugin service instance | Object |
Return Value
| Parameter | Description | Type |
|---|---|---|
| formatCartData | Function for formatting cart data. It receives the cart list array and returns the processed list. | Function |
Basic Example
export default class Plugin {
apply() {
return [
{
event: "dht.site.cart.getdata.after",
functional: this.cartGetDataAfter.bind(this)
},
]
}
cartGetDataAfter(params, pluginService) {
return new Promise((resolve, reject) => {
resolve({
formatCartData: (list) => {
return list;
}
});
});
}
}