diff --git a/beike/Repositories/CartRepo.php b/beike/Repositories/CartRepo.php index 55cbe048..d55cdae1 100644 --- a/beike/Repositories/CartRepo.php +++ b/beike/Repositories/CartRepo.php @@ -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 ?? '' ]);