Types
Upsell & Cross-Sell Typescript types
tip
New to Typescript?, check this ;)
Product
models.ts
export interface ServerProduct {
c: string
d: string
f: number
id: string
iso: boolean
l: string
p: string
p_c: string
p_max: string
p_max_c: string
p_min: string
p_min_c: string
p_spl: number
review?: number
reviews_count?: number
s: string
sku: string
skus: string[]
t: string
t2: string
u: string
v_c: number
v: string
vra:any[]
vrc: object
att?: any[]
real_sku?: string
imageID?: string
alt?: any[]
inventory_lvl?: number
}
export type Variants = Variant[]
export type Attribute = [string, AttributeData[]]
export type AttributeData = string[] | string[][]
export interface AlternativeProduct {
color: string,
url: string,
id: string,
variants?: Variants,
s?: string,
price: number
comparePrice: number,
formattedCompare?: string,
formattedPrice?: string,
attributes?: Attribute[] | undefined
}
Upsell & Cross-Sell Sources
models.ts
export type Source =
"related_recent_products"
| "related_purchase"
| "related_views"
| "related_cart"
| "similar_products"
| "related_recently_viewed"
| "similar_products_by_attributes"
| "similar_products_lookalike"
| "related_top_products"
Image Ratios
models.ts
export type ImgRatio = "16:9" | "3:2" | "4:3" | "1:1" | "9:16" | "2:3" | "3:4"