addTemplate('shippinginsurance::components.shipping-insurance-cartsummary'); }); // 结账页面:在 tax 之后、grand total 之前显示运费险 Event::listen('bagisto.shop.checkout.onepage.summary.tax.after', function ($viewRenderEventManager) { $viewRenderEventManager->addTemplate('shippinginsurance::components.shipping-insurance-cartsummary'); }); // 后台订单详情:在 discount 之后、grand total 之前显示运费险金额 // 参考礼品卡的 OrderViewHandler 方式:从路由获取订单后 echo 渲染组件 Event::listen('bagisto.admin.sales.order.view.discount.after', 'Longyi\ShippingInsurance\Listeners\OrderViewHandler@renderShippingInsurance'); // 前台会员中心订单详情:在 discount 之后、grand total 之前显示运费险金额 Event::listen('bagisto.shop.customers.account.orders.view.information.discount.after', 'Longyi\ShippingInsurance\Listeners\OrderViewHandler@renderShippingInsurance'); // 将运费险金额映射进 Apple Pay breakdown Event::listen(CollectingAmountBreakdown::class, 'Longyi\ShippingInsurance\Listeners\ApplepayBreakdownHandler@collect'); } }