修复默认运费

This commit is contained in:
Edward Yang 2022-12-29 12:00:36 +08:00
parent fb02010079
commit c2b82b4bee
1 changed files with 2 additions and 1 deletions

View File

@ -39,10 +39,11 @@ class CartRepo
if (empty($cart)) {
$shippingMethod = PluginRepo::getShippingMethods()->first();
$paymentMethod = PluginRepo::getPaymentMethods()->first();
$shippingMethodCode = $shippingMethod->code ?? '';
$cart = Cart::query()->create([
'customer_id' => $customerId,
'shipping_address_id' => $defaultAddressId,
'shipping_method_code' => $shippingMethod->code ?? '',
'shipping_method_code' => $shippingMethodCode ? $shippingMethodCode . '.0' : '',
'payment_address_id' => $defaultAddressId,
'payment_method_code' => $paymentMethod->code ?? ''
]);