top of page
Logo Boeren Brouwers

BEN JIJ 18 JAAR OF OUDER?

  • Facebook
  • Twitter
  • YouTube
  • Instagram

import wixSiteBackend from 'wix-site-backend'; const DEPOSIT_FEE = 0.15; export async function calculateAdditionalFees(options, context) { const currency = await wixSiteBackend.generalInfo.getPaymentCurrency(); console.log('Currency:', currency); const depositFee = calculateDepositFee(options.lineItems); console.log('Deposit Fee:', depositFee); const additionalFees = []; if (depositFee > 0) { additionalFees.push({ code: 'statiegeld', name: 'Statiegeld', price: depositFee.toFixed(2), taxDetails: { taxable: false } }); } console.log('Additional Fees:', additionalFees); return { currency, additionalFees }; } function calculateDepositFee(lineItems) { let totalDepositFee = 0; lineItems.forEach((item) => { totalDepositFee += item.quantity * DEPOSIT_FEE; }); return totalDepositFee; }

bottom of page