(() => { ShopbySkin.EventManager.on('QUERY_CART_DETAIL', (sb) => { try { const { deliveryGroups = [], price: { buyAmt = 0 }, } = sb; if (deliveryGroups.length > 0) { const productNos = deliveryGroups.flatMap(({ orderProducts }) => orderProducts.map(({ productNo }) => String(productNo)) ); fbq('track', 'AddToCart', { content_ids: productNos, content_type: 'product', value: buyAmt, currency: 'KRW', }); } } catch (error) { console.error('An error occurred:', error); } }) })();