{"id":60987,"date":"2025-04-26T10:28:55","date_gmt":"2025-04-26T02:28:55","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60987\/"},"modified":"2025-04-26T10:28:55","modified_gmt":"2025-04-26T02:28:55","slug":"zen-cart%e8%87%aa%e5%ae%9a%e4%b9%89%e8%bf%90%e8%b4%b9%e6%a8%a1%e5%9d%97-china-post","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60987\/","title":{"rendered":"Zen-cart\u81ea\u5b9a\u4e49\u8fd0\u8d39\u6a21\u5757-China Post"},"content":{"rendered":"<p> \u4e2d\u56fd\u90ae\u653f\u5c0f\u5305\u6709\u6302\u53f7\u548c\u5e73\u90ae\uff0c\u8fd9\u91cc\u8bf4\u7684\u662f\u6302\u53f7\u56fd\u5bb6\u90ae\u653f\u5c0f\u5305\u3002\u8fd9\u4e2a\u8fd0\u8f93\u65b9\u5f0f\u628a\u56fd\u5bb6\u5206\u621010\u4e2a\u533a\uff0c\u6bcf\u4e2a\u533a\u5bf9\u5e94\u4e0d\u540c\u7684\u8d39\u7387\uff08\u6bcf\u516c\u65a4\u591a\u5c11\u94b1\uff09\u3002<br \/> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AS4J010-34536.jpg\" class=\"aligncenter\" title=\"Zen-cart\u81ea\u5b9a\u4e49\u8fd0\u8d39\u6a21\u5757-China Post\u63d2\u56fe\" alt=\"Zen-cart\u81ea\u5b9a\u4e49\u8fd0\u8d39\u6a21\u5757-China Post\u63d2\u56fe\" \/><\/p>\n<p> \u7531\u4e8e\u9488\u5bf9\u4e0d\u540c\u56fd\u5bb6\u53ef\u80fd\u5bf9\u5e94\u4e86\u4e0d\u540c\u8d39\u7387\uff0c\u6240\u6709\u5b9e\u73b0\u8fd9\u4e2a\u63d2\u4ef6\u5e76\u6ca1\u6709\u90a3\u4e48\u7b80\u5355\uff0c\u4ee5\u4e0a\u56fe\u7247\u5c55\u793a\u7684\u53ea\u662f\u4e00\u4e9b\u57fa\u672c\u53c2\u6570\uff0c\u5b9e\u9645\u7684\u56fd\u5bb6\u5206\u533a\u8d39\u7387\u8868\u9700\u8981\u5bfc\u5165\u5230\u6570\u636e\u5e93\u4e2d\uff0c\u800c\u8fd9\u4e9bZen-cart\u5e76\u6ca1\u6709\u5b9e\u73b0\u3002<\/p>\n<p> \u8fd9\u4e9b\u5de5\u4f5c\u91cf\u662f\u6709\u70b9\u5927\u7684\uff0c\u6bd4\u5982\u4e3a\u4e86\u80fd\u4f7f\u7528\u56fd\u5bb6\u5bf9\u5e94\u7684\u4e2d\u6587\u540d\u79f0\u5305\u56fd\u5bb6\u5bfc\u5165\u5230\u5206\u533a\u8868\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u6269\u5c55countries\u8868\uff0c\u628a\u6bcf\u4e2a\u56fd\u5bb6\u7684\u4e2d\u6587\u540d\u5bf9\u5e94\u4e0a\u53bb\u3002\u8fd9\u4e2a\u6b65\u9aa4\u53ef\u4ee5\u5199\u4e00\u6bb5\u7a0b\u5e8f\u6279\u91cf\u5bfc\u5165\uff0c\u8fd9\u91cc\u8df3\u8fc7\u4e86\u3002<\/p>\n<p> \u63a5\u4e0b\u6765\u662f\u5efa\u7acb\u5206\u533a\uff0c\u8fd9\u91cc\u91cd\u590d\u5229\u7528Zen-cart\u9ed8\u8ba4\u7684geo_zone<\/p>\n<p> \u8981\u5bfc\u5165\u7684\u8868\uff1a<br \/> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AS4N330-4Y20.jpg\" class=\"aligncenter\" title=\"Zen-cart\u81ea\u5b9a\u4e49\u8fd0\u8d39\u6a21\u5757-China Post\u63d2\u56fe1\" alt=\"Zen-cart\u81ea\u5b9a\u4e49\u8fd0\u8d39\u6a21\u5757-China Post\u63d2\u56fe1\" \/><\/p>\n<p> \u4e0d\u8fc7\u4e3a\u4e86\u8ba9\u6bcf\u4e2ageo_zone\u5bf9\u5e94\u8d39\u7387\uff0c\u9700\u8981\u5bf9geo_zone\u8fdb\u884c\u6269\u5c55\uff08\u6dfb\u52a0cost\u5b57\u6bb5\uff09<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td>  1  <\/td>\n<td>   ALTER TABLE `geo_zones` ADD `cost` VARCHAR( 64 ) NULL DEFAULT &#8216;0&#8217;   <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u8fd9\u6837\u5206\u533a\u5bf9\u5e94\u7684\u56fd\u5bb6\u7684\u5bf9\u5e94\u5173\u7cfb\u5c31\u5efa\u7acb\u8d77\u6765\u4e86\uff0c\u6bcf\u4e2a\u5206\u533a\u7528cost\u5b57\u6bb5\u8bb0\u5f55\u4e86\u8fd9\u4e2a\u5206\u533a\u7684\u8d39\u7387\u3002<\/p>\n<p> \u90a3\u4e48China Post\u8fd0\u8d39\u6a21\u5757\u7684quote\u65b9\u6cd5\uff1a<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td>  1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   26   27   28   29   30   31   32   33   34   35   36   37   38   39   40   41   42   43   44   45   46  <\/td>\n<td>   \/\/ class methods   function quote($method = &#8221;) {   &nbsp;&nbsp;&nbsp;&nbsp;global $order,$shipping_weight,$shipping_num_boxes,$db,$currencies;   &nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;$total_weight = $shipping_weight * $shipping_num_boxes;   &nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;if($total_weight &gt; (int)MODULE_SHIPPING_CHINA_POST_MAX_WEIGHT){   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;}   &nbsp;&nbsp;&nbsp;&nbsp;\/\/package weight   &nbsp;&nbsp;&nbsp;&nbsp;$total_weight += (int)MODULE_SHIPPING_CHINA_POST_PACKAGE_WEIGHT;   &nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;$cost = $db-&gt;Execute(&#8220;select gz.geo_zone_name, gz.cost, ztgz.zone_id from geo_zones gz, zones_to_geo_zones ztgz where gz.geo_zone_id = ztgz.geo_zone_id and ztgz.zone_country_id = &#8220;.(int)$order-&gt;delivery[&#8216;country&#8217;][&#8216;id&#8217;].&#8221; and ztgz.zone_id = 0 and gz.geo_zone_name like &#8216;ChinaPost_%'&#8221;);   &nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;if($cost-&gt;RecordCount() &gt; 0){   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$first = round((float)MODULE_SHIPPING_CHINA_POST_COST,2);   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$continue = round($cost-&gt;fields[&#8216;cost&#8217;],2);   &nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rate = (float)$currencies-&gt;currencies[&#8216;CNY&#8217;][&#8216;value&#8217;];   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($rate &lt;= 0){   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rate = 1;   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$disc = (float)MODULE_SHIPPING_CHINA_POST_RATE;   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($disc &lt;= 0){   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$disc = 1;   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ttl = round($disc*($first+$continue*ceil($total_weight\/10)\/100)\/$rate,2);   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;quotes = array(&#8216;id&#8217; =&gt; $this-&gt;code,   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8216;module&#8217; =&gt; MODULE_SHIPPING_CHINA_POST_TEXT_TITLE,   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8216;methods&#8217; =&gt; array(array(&#8216;id&#8217; =&gt; $this-&gt;code,   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8216;title&#8217; =&gt; MODULE_SHIPPING_CHINA_POST_TEXT_WAY,   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8216;cost&#8217; =&gt; $ttl)));   &nbsp;&nbsp;&nbsp;&nbsp;}else{   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;}   &nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;if ($this-&gt;tax_class &gt; 0) {   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;quotes[&#8216;tax&#8217;] = zen_get_tax_rate($this-&gt;tax_class, $order-&gt;delivery[&#8216;country&#8217;][&#8216;id&#8217;], $order-&gt;delivery[&#8216;zone_id&#8217;]);   &nbsp;&nbsp;&nbsp;&nbsp;}   &nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;if (zen_not_null($this-&gt;icon)) $this-&gt;quotes[&#8216;icon&#8217;] = zen_image($this-&gt;icon, $this-&gt;title);   &nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;return $this-&gt;quotes;   }   <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u4e3b\u8981\u662f\u6839\u636e\u56fd\u5bb6\u4ee3\u7801\u628a\u8d39\u7387\u7ed9\u627e\u51fa\u6765\uff0c\u5982\u679c\u8fd8\u6709\u5176\u5b83\u8fd0\u8f93\u65b9\u5f0f\u4e5f\u91c7\u7528\u7c7b\u4f3c\u7684\u65b9\u6cd5\uff0c\u90a3\u4e48\u67d0\u4e2a\u56fd\u5bb6\u53ef\u80fd\u5bf9\u5e94\u591a\u4e2ageo_zone\uff0c\u8fd9\u4e2a\u65f6\u5019\u9700\u8981\u8fc7\u6ee4\u51fa\u7b26\u5408\u5f53\u524d\u8fd0\u8f93\u65b9\u5f0f\u7684geo_zone\uff0c\u5728\u5bfc\u5165\u5206\u533a\u8868\u65f6\uff0c\u6bcf\u4e2a\u5206\u533a\u90fd\u91c7\u7528ChinaPost_\u524d\u7f00\uff0c\u6240\u4ee5\u8fd9\u91cc\u6dfb\u52a0\u4e86like \u2018ChinaPost_%\u2019\u6761\u4ef6\u5c31\u53ef\u4ee5\u8fc7\u6ee4\u51fa\u5f53\u524d\u7684\u8fd0\u8f93\u65b9\u5f0f\u7684\u5206\u533a\uff0c\u5f53\u7136\u52a1\u5fc5\u8981\u907f\u514d\u540c\u4e00\u4e2a\u56fd\u5bb6\u88c5\u5165\u540c\u4e00\u79cd\u8fd0\u8f93\u65b9\u5f0f\u7684\u4e0d\u540c\u5206\u533a\u4e2d\uff08\u56fd\u5bb6\u5206\u533a\u5bfc\u5165\u65f6\u9700\u8981\u8003\u8651\u8fd9\u4e2a\u903b\u8f91\uff09\uff0c\u5426\u5219\u5c06\u5f97\u5230\u591a\u4e2a\u8d39\u7387\uff0c\u8fd9\u91cc\u603b\u662f\u4f7f\u7528\u8fd4\u56de\u6392\u5728\u7b2c\u4e00\u7684\u90a3\u6761\u8bb0\u5f55\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e2d\u56fd\u90ae\u653f\u5c0f\u5305\u6709\u6302\u53f7\u548c\u5e73\u90ae\uff0c\u8fd9\u91cc\u8bf4\u7684\u662f\u6302\u53f7\u56fd\u5bb6\u90ae\u653f\u5c0f\u5305\u3002\u8fd9\u4e2a\u8fd0\u8f93\u65b9\u5f0f\u628a\u56fd\u5bb6\u5206\u621010\u4e2a\u533a\uff0c\u6bcf\u4e2a\u533a\u5bf9\u5e94\u4e0d\u540c\u7684\u8d39\u7387\uff08\u6bcf\u516c\u65a4\u591a\u5c11\u94b1\uff09\u3002 \u7531\u4e8e\u9488\u5bf9\u4e0d\u540c\u56fd\u5bb6\u53ef\u80fd\u5bf9\u5e94\u4e86\u4e0d\u540c\u8d39\u7387\uff0c\u6240\u6709\u5b9e\u73b0\u8fd9\u4e2a\u63d2\u4ef6\u5e76\u6ca1\u6709\u90a3\u4e48\u7b80\u5355\uff0c\u4ee5\u4e0a\u56fe\u7247\u5c55\u793a\u7684\u53ea\u662f\u4e00\u4e9b\u57fa\u672c\u53c2\u6570\uff0c\u5b9e\u9645\u7684\u56fd\u5bb6\u5206\u533a\u8d39\u7387\u8868\u9700\u8981\u5bfc\u5165\u5230\u6570\u636e\u5e93\u4e2d\uff0c\u800c\u8fd9\u4e9bZen-cart\u5e76\u6ca1\u6709\u5b9e\u73b0\u3002 \u8fd9\u4e9b\u5de5\u4f5c\u91cf\u662f\u6709\u70b9\u5927\u7684\uff0c\u6bd4\u5982\u4e3a\u4e86\u80fd\u4f7f\u7528\u56fd\u5bb6\u5bf9\u5e94\u7684\u4e2d\u6587\u540d\u79f0\u5305\u56fd\u5bb6\u5bfc\u5165\u5230\u5206\u533a\u8868\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u6269\u5c55countries\u8868\uff0c\u628a\u6bcf\u4e2a\u56fd\u5bb6\u7684\u4e2d\u6587\u540d\u5bf9\u5e94\u4e0a\u53bb\u3002\u8fd9\u4e2a\u6b65\u9aa4\u53ef\u4ee5\u5199\u4e00\u6bb5\u7a0b\u5e8f\u6279\u91cf\u5bfc\u5165\uff0c\u8fd9\u91cc\u8df3\u8fc7\u4e86\u3002 \u63a5\u4e0b\u6765\u662f\u5efa\u7acb\u5206\u533a\uff0c\u8fd9\u91cc\u91cd\u590d\u5229\u7528Zen-cart\u9ed8\u8ba4\u7684geo_zone \u8981\u5bfc\u5165\u7684\u8868\uff1a \u4e0d\u8fc7\u4e3a\u4e86\u8ba9\u6bcf\u4e2ageo_zone\u5bf9\u5e94\u8d39\u7387\uff0c\u9700\u8981\u5bf9geo_zone\u8fdb\u884c\u6269\u5c55\uff08\u6dfb\u52a0cost\u5b57\u6bb5\uff09 1 ALTER TABLE `geo_zones` ADD `cost` VARCHAR( 64 ) NULL DEFAULT &#8216;0&#8217; \u8fd9\u6837\u5206\u533a\u5bf9\u5e94\u7684\u56fd\u5bb6\u7684\u5bf9\u5e94\u5173\u7cfb\u5c31\u5efa\u7acb\u8d77\u6765\u4e86\uff0c\u6bcf\u4e2a\u5206\u533a\u7528cost\u5b57\u6bb5\u8bb0\u5f55\u4e86\u8fd9\u4e2a\u5206\u533a\u7684\u8d39\u7387\u3002 \u90a3\u4e48China Post\u8fd0\u8d39\u6a21\u5757\u7684quote\u65b9\u6cd5\uff1a 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-60987","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=60987"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60987\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}