解決辦法:
找到文件 app/services/order/StoreOrderDeliveryServices.php
在最后加上這段代碼 (最后一個}里)
/**
* 返回訂單商品總重量
* @param int $id
* @return int|string
*/
public function getOrderSumWeight(int $id, $default = false)
{
/** @var StoreOrderCartInfoServices $services */
$services = app()->make(StoreOrderCartInfoServices::class);
$orderGoodInfo = $services->getOrderCartInfo((int)$id);
$weight = 0;
foreach ($orderGoodInfo as $cartInfo) {
$cart = $cartInfo['cart_info'] ?? [];
if ($cart) {
$weight = bcadd((string)$weight, (string)bcmul((string)$cart['cart_num'] ?? '0', (string)$cart['productInfo']['attrInfo']['weight'] ?? '0', 4), 2);
}
}
return $weight ? $weight : ($default === false ? 0 : $default);
}