NoteStar 5 years ago
parent
commit
aa7669f2ee

+ 2 - 6
common/config/fecshop_local_services/Shipping.php

@@ -15,18 +15,14 @@ return [
         'shippingConfig' => [
             'free_shipping'=> [  // 免运费
                 'label'=> 'Free shipping( 10-20 work days)',
-                'name' => 'HKBRAM',
+                'name' => ' Via Chinapost、Epacket、USPS',
                 'formula' => '0',  // 这里填写公式,该值代表免邮。
                 // 国家限制,当国家限制不满足,则该物流不可用 (如果没有国家限制可以去掉)
                 // 重量限制,当重量超出这个范围,该物流将不可用 (如果没有重量限制可以去掉)
-                'weight' => [
-                    'min' => 0,
-                    'max' => 100,
-                ],
             ],
             'fast_shipping'=> [
                 'label'=> 'Fast Shipping( 3-12 work days)',
-                'name' => 'HKDHL',
+                'name' => 'Via UPS、Fedex、DHL',
                 'formula' => 'csv', // 请将文件名字的命名写入,譬如: fast_shipping.csv
                 'csv_content' => '', // 这个由shipping动态从文件中获取内容
                 // 对于国家和重量限制,如果没有,则不用填写,如果有,参考上面的样式填写

+ 3 - 209
common/config/shipping/fast_shipping.csv

@@ -1,210 +1,4 @@
 Country,Region/State,"Zip/Postal Code","Weight (and above)","Shipping Price"
-AU,*,*,0.0000,19.9000
-AU,*,*,0.5100,22.9000
-AU,*,*,1.0100,25.9000
-AU,*,*,1.5100,28.9000
-AU,*,*,2.0100,31.9000
-AU,*,*,2.5100,34.9000
-AU,*,*,3.0100,37.9000
-AU,*,*,3.5100,40.9000
-AU,*,*,4.0100,43.9000
-AU,*,*,4.5100,46.9000
-AU,*,*,5.0100,49.9000
-AU,*,*,5.5100,52.9000
-AU,*,*,6.0100,55.9000
-AU,*,*,6.5100,58.9000
-AU,*,*,7.0100,61.9000
-AU,*,*,7.5100,64.9000
-AU,*,*,8.0100,67.9000
-AU,*,*,8.5100,70.9000
-AU,*,*,9.0100,73.9000
-CA,*,*,0.0000,19.9000
-CA,*,*,0.5100,22.9000
-CA,*,*,1.0100,25.9000
-CA,*,*,1.5100,28.9000
-CA,*,*,2.0100,31.9000
-CA,*,*,2.5100,34.9000
-CA,*,*,3.0100,37.9000
-CA,*,*,3.5100,40.9000
-CA,*,*,4.0100,43.9000
-CA,*,*,4.5100,46.9000
-CA,*,*,5.0100,49.9000
-CA,*,*,5.5100,52.9000
-CA,*,*,6.0100,55.9000
-CA,*,*,6.5100,58.9000
-CA,*,*,7.0100,61.9000
-CA,*,*,7.5100,64.9000
-CA,*,*,8.0100,67.9000
-CA,*,*,8.5100,70.9000
-CA,*,*,9.0100,73.9000
-DE,*,*,0.0000,119.9000
-DE,*,*,0.5100,122.9000
-DE,*,*,1.0100,125.9000
-DE,*,*,1.5100,128.9000
-DE,*,*,2.0100,131.9000
-DE,*,*,2.5100,134.9000
-DE,*,*,3.0100,137.9000
-DE,*,*,3.5100,140.9000
-DE,*,*,4.0100,143.9000
-DE,*,*,4.5100,146.9000
-DE,*,*,5.0100,149.9000
-DE,*,*,5.5100,152.9000
-DE,*,*,6.0100,155.9000
-DE,*,*,6.5100,158.9000
-DE,*,*,7.0100,161.9000
-DE,*,*,7.5100,164.9000
-DE,*,*,8.0100,167.9000
-DE,*,*,8.5100,170.9000
-DE,*,*,9.0100,173.9000
-ES,*,*,0.0000,24.9000
-ES,*,*,0.5100,27.9000
-ES,*,*,1.0100,30.9000
-ES,*,*,1.5100,33.9000
-ES,*,*,2.0100,36.9000
-ES,*,*,2.5100,39.9000
-ES,*,*,3.0100,42.9000
-ES,*,*,3.5100,45.9000
-ES,*,*,4.0100,48.9000
-ES,*,*,4.5100,51.9000
-ES,*,*,5.0100,54.9000
-ES,*,*,5.5100,57.9000
-ES,*,*,6.0100,60.9000
-ES,*,*,6.5100,63.9000
-ES,*,*,7.0100,66.9000
-ES,*,*,7.5100,69.9000
-ES,*,*,8.0100,72.9000
-ES,*,*,8.5100,75.9000
-ES,*,*,9.0100,78.9000
-FR,*,*,0.0000,19.9000
-FR,*,*,0.5100,22.9000
-FR,*,*,1.0100,25.9000
-FR,*,*,1.5100,28.9000
-FR,*,*,2.0100,31.9000
-FR,*,*,2.5100,34.9000
-FR,*,*,3.0100,37.9000
-FR,*,*,3.5100,40.9000
-FR,*,*,4.0100,43.9000
-FR,*,*,4.5100,46.9000
-FR,*,*,5.0100,49.9000
-FR,*,*,5.5100,52.9000
-FR,*,*,6.0100,55.9000
-FR,*,*,6.5100,58.9000
-FR,*,*,7.0100,61.9000
-FR,*,*,7.5100,64.9000
-FR,*,*,8.0100,67.9000
-FR,*,*,8.5100,70.9000
-FR,*,*,9.0100,73.9000
-GB,*,*,0.0000,19.9000
-GB,*,*,0.5100,22.9000
-GB,*,*,1.0100,25.9000
-GB,*,*,1.5100,28.9000
-GB,*,*,2.0100,31.9000
-GB,*,*,2.5100,34.9000
-GB,*,*,3.0100,37.9000
-GB,*,*,3.5100,40.9000
-GB,*,*,4.0100,43.9000
-GB,*,*,4.5100,46.9000
-GB,*,*,5.0100,49.9000
-GB,*,*,5.5100,52.9000
-GB,*,*,6.0100,55.9000
-GB,*,*,6.5100,58.9000
-GB,*,*,7.0100,61.9000
-GB,*,*,7.5100,64.9000
-GB,*,*,8.0100,67.9000
-GB,*,*,8.5100,70.9000
-GB,*,*,9.0100,73.9000
-IR,*,*,0.0000,19.9000
-IR,*,*,0.5100,22.9000
-IR,*,*,1.0100,25.9000
-IR,*,*,1.5100,28.9000
-IR,*,*,2.0100,31.9000
-IR,*,*,2.5100,34.9000
-IR,*,*,3.0100,37.9000
-IR,*,*,3.5100,40.9000
-IR,*,*,4.0100,43.9000
-IR,*,*,4.5100,46.9000
-IR,*,*,5.0100,49.9000
-IR,*,*,5.5100,52.9000
-IR,*,*,6.0100,55.9000
-IR,*,*,6.5100,58.9000
-IR,*,*,7.0100,61.9000
-IR,*,*,7.5100,64.9000
-IR,*,*,8.0100,67.9000
-IR,*,*,8.5100,70.9000
-IR,*,*,9.0100,73.9000
-IT,*,*,0.0000,19.9000
-IT,*,*,0.5100,22.9000
-IT,*,*,1.0100,25.9000
-IT,*,*,1.5100,28.9000
-IT,*,*,2.0100,31.9000
-IT,*,*,2.5100,34.9000
-IT,*,*,3.0100,37.9000
-IT,*,*,3.5100,40.9000
-IT,*,*,4.0100,43.9000
-IT,*,*,4.5100,46.9000
-IT,*,*,5.0100,49.9000
-IT,*,*,5.5100,52.9000
-IT,*,*,6.0100,55.9000
-IT,*,*,6.5100,58.9000
-IT,*,*,7.0100,61.9000
-IT,*,*,7.5100,64.9000
-IT,*,*,8.0100,67.9000
-IT,*,*,8.5100,70.9000
-IT,*,*,9.0100,73.9000
-KO,*,*,0.0000,19.9000
-KO,*,*,0.5100,22.9000
-KO,*,*,1.0100,25.9000
-KO,*,*,1.5100,28.9000
-KO,*,*,2.0100,31.9000
-KO,*,*,2.5100,34.9000
-KO,*,*,3.0100,37.9000
-KO,*,*,3.5100,40.9000
-KO,*,*,4.0100,43.9000
-KO,*,*,4.5100,46.9000
-KO,*,*,5.0100,49.9000
-KO,*,*,5.5100,52.9000
-KO,*,*,6.0100,55.9000
-KO,*,*,6.5100,58.9000
-KO,*,*,7.0100,61.9000
-KO,*,*,7.5100,64.9000
-KO,*,*,8.0100,67.9000
-KO,*,*,8.5100,70.9000
-KO,*,*,9.0100,73.9000
-RE,*,*,0.0000,29.9000
-RE,*,*,0.5100,32.9000
-RE,*,*,1.0100,35.9000
-RE,*,*,1.5100,38.9000
-RE,*,*,2.0100,41.9000
-RE,*,*,2.5100,44.9000
-RE,*,*,3.0100,47.9000
-RE,*,*,3.5100,50.9000
-RE,*,*,4.0100,53.9000
-RE,*,*,4.5100,56.9000
-RE,*,*,5.0100,59.9000
-RE,*,*,5.5100,62.9000
-RE,*,*,6.0100,65.9000
-RE,*,*,6.5100,68.9000
-RE,*,*,7.0100,71.9000
-RE,*,*,7.5100,74.9000
-RE,*,*,8.0100,77.9000
-RE,*,*,8.5100,80.9000
-RE,*,*,9.0100,83.9000
-US,*,*,0.0000,19.9000
-US,*,*,0.5100,22.9000
-US,*,*,1.0100,25.9000
-US,*,*,1.5100,28.9000
-US,*,*,2.0100,31.9000
-US,*,*,2.5100,34.9000
-US,*,*,3.0100,37.9000
-US,*,*,3.5100,40.9000
-US,*,*,4.0100,43.9000
-US,*,*,4.5100,46.9000
-US,*,*,5.0100,49.9000
-US,*,*,5.5100,52.9000
-US,*,*,6.0100,55.9000
-US,*,*,6.5100,58.9000
-US,*,*,7.0100,61.9000
-US,*,*,7.5100,64.9000
-US,*,*,8.0100,67.9000
-US,*,*,8.5100,70.9000
-US,*,*,9.0100,73.9000
+*,*,*,99.0000,25.0000
+US,*,*,99.0000,10.0000
+CA,*,*,99.0000,10.0000

+ 12 - 3
vendor/fancyecommerce/fecshop/app/appfront/modules/Checkout/block/onepage/Index.php

@@ -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];