feat(shop): move linked fee configuration to product level
All checks were successful
Staging Build / build (push) Successful in 2m52s
All checks were successful
Staging Build / build (push) Successful in 2m52s
This commit is contained in:
@@ -99,12 +99,18 @@ export async function POST(request: Request) {
|
||||
if (item.selections) {
|
||||
for (const catId in item.selections) {
|
||||
const sel = item.selections[catId];
|
||||
sel.moduleIds?.forEach((mId: string) => {
|
||||
for (const p of products) {
|
||||
const mod = p.modules?.find((m: any) => m.id === mId);
|
||||
if (mod && mod.linked_fee_product_id) {
|
||||
feeProductIds.add(mod.linked_fee_product_id);
|
||||
}
|
||||
|
||||
if (sel.productId) {
|
||||
const p = products.find((prod: any) => prod.id === sel.productId);
|
||||
if (p && p.linked_fee_product_id) {
|
||||
feeProductIds.add(p.linked_fee_product_id);
|
||||
}
|
||||
}
|
||||
|
||||
sel.productIds?.forEach((pId: string) => {
|
||||
const p = products.find((prod: any) => prod.id === pId);
|
||||
if (p && p.linked_fee_product_id) {
|
||||
feeProductIds.add(p.linked_fee_product_id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user