chore: transfer repo

This commit is contained in:
Danijel
2026-01-19 20:21:14 +01:00
commit 7d2fb0c737
213 changed files with 18085 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
// Function to get a unique identifier for a cart item
export function getUniqueItemKey(item: any, boxGroupId?: string, index?: number): string {
// Start with the merchandise id
let key = item.merchandise.id;
// Add the item's own id if available
if (item.id) {
key = `${key}-${item.id}`;
}
// Add box group id if it's part of a box
if (boxGroupId) {
key = `${boxGroupId}-${key}`;
}
// Add index as fallback to ensure uniqueness
if (index !== undefined) {
key = `${key}-${index}`;
}
return key;
}