feat(product): add reusable Product Experience 2.0
Unify product details modules behind config-driven contracts so teams can extend UX without changing runtime architecture or bootstrap flow. Keep backward compatibility with existing product payloads by treating new media/specification/variant/related structures as optional extensions. Improve conversion and content discoverability with reusable actions, typed media rendering, grouped specifications, dynamic variants, and multi-collection related products.
This commit is contained in:
@@ -7,10 +7,12 @@ export interface ProductRatingConfig extends ProductSectionConfig {}
|
||||
export interface ProductReviewsConfig extends ProductSectionConfig {
|
||||
pageSize?: number;
|
||||
showSummary?: boolean;
|
||||
mode?: 'pages' | 'load-more';
|
||||
}
|
||||
|
||||
export interface ProductQuestionsConfig extends ProductSectionConfig {
|
||||
pageSize?: number;
|
||||
allowSubmission?: boolean;
|
||||
}
|
||||
|
||||
export interface ProductTabsConfig extends ProductSectionConfig {
|
||||
@@ -19,12 +21,22 @@ export interface ProductTabsConfig extends ProductSectionConfig {
|
||||
|
||||
export interface ProductRelatedConfig extends ProductSectionConfig {}
|
||||
|
||||
export interface ProductActionsConfig extends ProductSectionConfig {
|
||||
addToCart?: boolean;
|
||||
buyNow?: boolean;
|
||||
wishlist?: boolean;
|
||||
compare?: boolean;
|
||||
share?: boolean;
|
||||
notifyMe?: boolean;
|
||||
}
|
||||
|
||||
export interface ProductPageConfig {
|
||||
rating?: ProductRatingConfig;
|
||||
reviews?: ProductReviewsConfig;
|
||||
questions?: ProductQuestionsConfig;
|
||||
tabs?: ProductTabsConfig;
|
||||
relatedProducts?: ProductRelatedConfig;
|
||||
actions?: ProductActionsConfig;
|
||||
}
|
||||
|
||||
export const DEFAULT_PRODUCT_PAGE_CONFIG: Required<ProductPageConfig> = {
|
||||
@@ -34,11 +46,13 @@ export const DEFAULT_PRODUCT_PAGE_CONFIG: Required<ProductPageConfig> = {
|
||||
reviews: {
|
||||
enabled: true,
|
||||
pageSize: 5,
|
||||
showSummary: true
|
||||
showSummary: true,
|
||||
mode: 'pages'
|
||||
},
|
||||
questions: {
|
||||
enabled: true,
|
||||
pageSize: 5
|
||||
pageSize: 5,
|
||||
allowSubmission: true
|
||||
},
|
||||
tabs: {
|
||||
enabled: true,
|
||||
@@ -46,5 +60,14 @@ export const DEFAULT_PRODUCT_PAGE_CONFIG: Required<ProductPageConfig> = {
|
||||
},
|
||||
relatedProducts: {
|
||||
enabled: true
|
||||
},
|
||||
actions: {
|
||||
enabled: true,
|
||||
addToCart: true,
|
||||
buyNow: true,
|
||||
wishlist: true,
|
||||
compare: true,
|
||||
share: true,
|
||||
notifyMe: true
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user