diff --git a/beike/Shop/Services/CheckoutService.php b/beike/Shop/Services/CheckoutService.php
index e1a8b6e7..3f14c9f6 100644
--- a/beike/Shop/Services/CheckoutService.php
+++ b/beike/Shop/Services/CheckoutService.php
@@ -40,12 +40,12 @@ class CheckoutService
$this->customer = current_customer();
}
if (empty($this->customer) || !($this->customer instanceof Customer)) {
- throw new \Exception("购物车客户无效");
+ throw new \Exception(trans('shop/carts.invalid_customer'));
}
$this->cart = CartRepo::createCart($this->customer);
$this->selectedProducts = CartRepo::selectedCartProducts($this->customer->id);
if ($this->selectedProducts->count() == 0) {
- throw new \Exception("购物车商品为空");
+ throw new \Exception(trans('shop/carts.empty_selected_products'));
}
}
@@ -113,22 +113,22 @@ class CheckoutService
$shippingAddressId = $current['shipping_address_id'];
if (empty(Address::query()->find($shippingAddressId))) {
- throw new \Exception('配送地址无效');
+ throw new \Exception(trans('shop/carts.invalid_shipping_address'));
}
$paymentAddressId = $current['payment_address_id'];
if (empty(Address::query()->find($paymentAddressId))) {
- throw new \Exception('账单地址无效');
+ throw new \Exception(trans('shop/carts.invalid_payment_address'));
}
$shippingMethodCode = $current['shipping_method_code'];
if (!PluginRepo::shippingEnabled($shippingMethodCode)) {
- throw new \Exception('配送方式不可用');
+ throw new \Exception(trans('shop/carts.invalid_shipping_method'));
}
$paymentMethodCode = $current['payment_method_code'];
if (!PluginRepo::paymentEnabled($paymentMethodCode)) {
- throw new \Exception('支付方式不可用');
+ throw new \Exception(trans('shop/carts.invalid_payment_method'));
}
}
diff --git a/resources/lang/en/shop/carts.php b/resources/lang/en/shop/carts.php
index fad75986..c62deea8 100644
--- a/resources/lang/en/shop/carts.php
+++ b/resources/lang/en/shop/carts.php
@@ -29,5 +29,11 @@ return [
'mini' => 'Your cart',
'delete' => 'Delete',
'check_cart' => 'Check the shopping cart',
- 'subtotal' => 'Subtotal',
+
+ 'invalid_customer' => 'Invalid customer.',
+ 'empty_selected_products' => 'Empty selected products.',
+ 'invalid_shipping_address' => 'Invalid shipping address',
+ 'invalid_payment_address' => 'Invalid payment address.',
+ 'invalid_shipping_method' => 'Invalid shipping method.',
+ 'invalid_payment_method' => 'Invalid payment method.',
];
diff --git a/resources/lang/zh_cn/shop/carts.php b/resources/lang/zh_cn/shop/carts.php
index e104acd1..86fd3f34 100644
--- a/resources/lang/zh_cn/shop/carts.php
+++ b/resources/lang/zh_cn/shop/carts.php
@@ -29,5 +29,11 @@ return [
'mini' => '您的购物车',
'delete' => '删除',
'check_cart' => '查看购物车',
- 'subtotal' => '小计',
+
+ 'invalid_customer' => '购物车客户无效',
+ 'empty_selected_products' => '购物车选中商品为空',
+ 'invalid_shipping_address' => '配送地址无效',
+ 'invalid_payment_address' => '账单地址无效',
+ 'invalid_shipping_method' => '配送方式不可用',
+ 'invalid_payment_method' => '支付方式不可用',
];
diff --git a/themes/default/cart/cart.blade.php b/themes/default/cart/cart.blade.php
index cacb5c49..a469eb74 100644
--- a/themes/default/cart/cart.blade.php
+++ b/themes/default/cart/cart.blade.php
@@ -18,7 +18,7 @@
@if ($errors->has('error'))
-