|
|
@@ -10,7 +10,7 @@ class EventServiceProvider extends ServiceProvider
|
|
|
/**
|
|
|
* Bootstrap services.
|
|
|
*/
|
|
|
- public function boot()
|
|
|
+ public function boot(): void
|
|
|
{
|
|
|
// 运费险计算:监听购物车总计收集事件
|
|
|
Event::listen('checkout.cart.collect.totals.after', 'Longyi\ShippingInsurance\Listeners\ShippingInsuranceHandler@applyShippingInsurance');
|
|
|
@@ -24,5 +24,12 @@ class EventServiceProvider extends ServiceProvider
|
|
|
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');
|
|
|
}
|
|
|
}
|