提交 d6d18eb6 编写于 作者: T Terry

将apphtml5,appserver端,重量计算更新,和appfront一样,订单重量 = max(产品实际重量,产品体积重量)

上级 6e893ecc
......@@ -352,13 +352,15 @@ class Index
$cartProductInfo = Yii::$service->cart->quoteItem->getCartProductInfo();
//echo $country ;
$product_weight = $cartProductInfo['product_weight'];
$product_volume_weight = $cartProductInfo['product_volume_weight'];
$product_final_weight = max($product_weight, $product_volume_weight);
$cartShippingMethod = $this->_cart_info['shipping_method'];
//echo "$custom_shipping_method,$cartShippingMethod";
$current_shipping_method = Yii::$service->shipping->getCurrentShippingMethod($custom_shipping_method, $cartShippingMethod, $country, $region, $product_weight);
$current_shipping_method = Yii::$service->shipping->getCurrentShippingMethod($custom_shipping_method, $cartShippingMethod, $country, $region, $product_final_weight);
$this->_shipping_method = $current_shipping_method;
// 得到所有,有效的shipping method
$shippingArr = $this->getShippingArr($product_weight, $current_shipping_method, $country, $region);
$shippingArr = $this->getShippingArr($product_final_weight, $current_shipping_method, $country, $region);
return $shippingArr;
}
......
......@@ -162,7 +162,11 @@ class CartController extends AppfrontController
}
$error_arr = Yii::$service->helper->errors->get(true);
if (!empty($error_arr)) {
$error_str = implode(',', $error_arr);
if (is_array($error_arr)) {
$error_str = implode(',', $error_arr);
} else {
$error_str = $error_arr;
}
echo json_encode([
'status' => 'fail',
'content'=> $error_str,
......
......@@ -304,6 +304,8 @@ class Review
$cartProductInfo = Yii::$service->cart->quoteItem->getCartProductInfo();
//echo $country ;
$product_weight = $cartProductInfo['product_weight'];
$product_volume_weight = $cartProductInfo['product_volume_weight'];
$product_final_weight = max($product_weight, $product_volume_weight);
// 传递当前的货运方式,这个需要从cart中选取,
// 如果cart中没有shipping_method,那么该值为空
//var_dump($this->_cart_info);
......@@ -312,7 +314,7 @@ class Review
$current_shipping_method = Yii::$service->shipping->getCurrentShippingMethod($custom_shipping_method, $cartShippingMethod);
$this->_shipping_method = $current_shipping_method;
$shippingArr = $this->getShippingArr($product_weight, $current_shipping_method, $country, $region);
$shippingArr = $this->getShippingArr($product_final_weight, $current_shipping_method, $country, $region);
return $shippingArr;
}
......
......@@ -381,12 +381,14 @@ class Index
}
$cartProductInfo = Yii::$service->cart->quoteItem->getCartProductInfo();
$product_weight = $cartProductInfo['product_weight'];
$product_volume_weight = $cartProductInfo['product_volume_weight'];
$product_final_weight = max($product_weight, $product_volume_weight);
$cartShippingMethod = $this->_cart_info['shipping_method'];
// 当前的货运方式
$current_shipping_method = Yii::$service->shipping->getCurrentShippingMethod($custom_shipping_method, $cartShippingMethod, $country, $region, $product_weight);
$current_shipping_method = Yii::$service->shipping->getCurrentShippingMethod($custom_shipping_method, $cartShippingMethod, $country, $region, $product_final_weight);
$this->_shipping_method = $current_shipping_method;
// 得到所有,有效的shipping method
$shippingArr = $this->getShippingArr($product_weight, $current_shipping_method, $country, $region = '*');
$shippingArr = $this->getShippingArr($product_final_weight, $current_shipping_method, $country, $region = '*');
return $shippingArr;
}
......
......@@ -280,7 +280,11 @@ class CartController extends AppserverController
}
$error_arr = Yii::$service->helper->errors->get(true);
if (!empty($error_arr)) {
$error_str = implode(',', $error_arr);
if (is_array($error_arr)) {
$error_str = implode(',', $error_arr);
} else {
$error_str = $error_arr;
}
$innerTransaction->rollBack();
$code = Yii::$service->helper->appserver->cart_coupon_invalid;
$data = [
......
......@@ -327,6 +327,8 @@ class Review
$cartProductInfo = Yii::$service->cart->quoteItem->getCartProductInfo();
//echo $country ;
$product_weight = $cartProductInfo['product_weight'];
$product_volume_weight = $cartProductInfo['product_volume_weight'];
$product_final_weight = max($product_weight, $product_volume_weight);
// 传递当前的货运方式,这个需要从cart中选取,
// 如果cart中没有shipping_method,那么该值为空
//var_dump($this->_cart_info);
......@@ -335,7 +337,7 @@ class Review
$current_shipping_method = Yii::$service->shipping->getCurrentShippingMethod($custom_shipping_method, $cartShippingMethod);
$this->_shipping_method = $current_shipping_method;
$shippingArr = $this->getShippingArr($product_weight, $current_shipping_method, $country, $region);
$shippingArr = $this->getShippingArr($product_final_weight, $current_shipping_method, $country, $region);
return $shippingArr;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册