I need help adding a new attribute to the Product DTO in Spartacus. I followed the documentation and created a new TS file with the following code:
declare module '@spartacus/core' {
export interface Product {
unit?: string;
}
}
However, when trying to reference this in my HTML, I encounter an error saying "Property 'unit' does not exist on type 'Product'."
Do I need to do anything else to make this work effectively?
If I modify it as displayed below, it works:
export interface CustomProduct extends Product {
unit?: string;
}
But by making this change, I have to replace instances of 'Product' with 'CustomProduct' throughout the entire codebase.
This issue arises on both the PDP and Cart Page. Do I need to override any Normalizer for this?