|
@@ -251,7 +251,7 @@ class Index
|
|
|
if (!$stateHtml) {
|
|
|
$stateHtml = '<input id="state" name="billing[state]" value="'.$state.'" title="State" class="address_state input-text" style="" type="text">';
|
|
|
} else {
|
|
|
- $stateHtml = '<select id="address:state" class="address_state validate-select" title="State" name="billing[state]">
|
|
|
+ $stateHtml = '<select id="address:state" class="address_state validate-select" title="State" name="billing[state]">
|
|
|
<option value="">Please select region, state or province</option>'
|
|
|
.$stateHtml.'</select>';
|
|
|
}
|
|
@@ -360,11 +360,16 @@ class Index
|
|
|
$region = $this->_state;
|
|
|
}
|
|
|
$cartProductInfo = Yii::$service->cart->quoteItem->getCartProductInfo();
|
|
|
- $product_weight = $cartProductInfo['product_weight'];
|
|
|
+ if($cartProductInfo['product_weight'] == '0'){
|
|
|
+ $product_weight = 1;
|
|
|
+ }else{
|
|
|
+ $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_final_weight);
|
|
|
$this->_shipping_method = $current_shipping_method;
|
|
|
// 得到所有,有效的shipping method
|
|
@@ -531,7 +536,11 @@ class Index
|
|
|
* 的信息计算。
|
|
|
*/
|
|
|
$quoteItem = Yii::$service->cart->quoteItem->getCartProductInfo();
|
|
|
- $product_weight = $quoteItem['product_weight'];
|
|
|
+ if($quoteItem['product_weight'] == '0'){
|
|
|
+ $product_weight = 1;
|
|
|
+ }else{
|
|
|
+ $product_weight = $quoteItem['product_weight'];
|
|
|
+ }
|
|
|
// 计算运费。
|
|
|
$avaiable_method = Yii::$service->shipping->getAvailableShippingMethods($country,$region,$product_weight);
|
|
|
$shippingInfo = $avaiable_method[$shipping_method];
|