소스 검색

运费险修改固定金额以美元为准

llp 1 주 전
부모
커밋
8912a45116
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      packages/Longyi/ShippingInsurance/src/Listeners/ShippingInsuranceHandler.php

+ 2 - 1
packages/Longyi/ShippingInsurance/src/Listeners/ShippingInsuranceHandler.php

@@ -59,7 +59,8 @@ class ShippingInsuranceHandler
         if ($type === 'percentage') {
             $insuranceAmount = round($cart->sub_total * ($value / 100), 2);
         } else {
-            $insuranceAmount = $value;
+            // Fixed amount is defined in USD (base currency), convert to current currency
+            $insuranceAmount = round((float) core()->convertPrice($value), 2);
         }
 
         // Convert to base currency for base fields