diff --git a/src/app/admin/products/[id]/edit/page.tsx b/src/app/admin/products/[id]/edit/page.tsx
index df138a3..a202724 100644
--- a/src/app/admin/products/[id]/edit/page.tsx
+++ b/src/app/admin/products/[id]/edit/page.tsx
@@ -285,6 +285,41 @@ export default async function EditProductPage({ params }: { params: { id: string
+
+
+
+
+
Width of garment/object for ruler reference (optional)
+
+
+
+
+
Height of garment/object for ruler reference (optional)
+
+
+
String(v));
+ const referenceWidthCmInput = String(formData.get('referenceWidthCm') ?? '').trim();
+ const referenceHeightCmInput = String(formData.get('referenceHeightCm') ?? '').trim();
+ const referenceWidthCm = referenceWidthCmInput ? Number(referenceWidthCmInput) : null;
+ const referenceHeightCm = referenceHeightCmInput ? Number(referenceHeightCmInput) : null;
if (!id) throw new Error('Missing product id.');
if (!name || !category || !priceDollars) {
@@ -228,6 +232,8 @@ export async function updateProduct(formData: FormData) {
photoRecolorable: boolean;
showOnPersonalised: boolean;
showOnProducts: boolean;
+ referenceWidthCm: number | null;
+ referenceHeightCm: number | null;
imageUrl?: string;
imageUrlBack?: string;
printArea?: string;
@@ -247,6 +253,8 @@ export async function updateProduct(formData: FormData) {
photoRecolorable,
showOnPersonalised,
showOnProducts,
+ referenceWidthCm,
+ referenceHeightCm,
};
// Only touch the front photo/print area if a new photo was actually uploaded —
diff --git a/src/lib/product.ts b/src/lib/product.ts
index 9b707d7..778d614 100644
--- a/src/lib/product.ts
+++ b/src/lib/product.ts
@@ -21,6 +21,8 @@ export function toProductDTO(p: PrismaProduct, activePromotions: ActivePromotion
printAreaBack: p.printAreaBack ? JSON.parse(p.printAreaBack) : null,
printAreaWidthMm: p.printAreaWidthMm,
printAreaHeightMm: p.printAreaHeightMm,
+ referenceWidthCm: p.referenceWidthCm,
+ referenceHeightCm: p.referenceHeightCm,
imageUrl: p.imageUrl,
imageUrlBack: p.imageUrlBack,
photoRecolorable: p.photoRecolorable,
diff --git a/src/lib/types.ts b/src/lib/types.ts
index 8216760..9eefe24 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -45,6 +45,8 @@ export type ProductDTO = {
printAreaBack: PrintArea | null;
printAreaWidthMm: number;
printAreaHeightMm: number;
+ referenceWidthCm: number | null;
+ referenceHeightCm: number | null;
imageUrl: string | null;
imageUrlBack: string | null;
photoRecolorable: boolean;