{"id":61004,"date":"2025-04-26T08:28:04","date_gmt":"2025-04-26T00:28:04","guid":{"rendered":"https:\/\/fwq.ai\/blog\/61004\/"},"modified":"2025-04-26T08:28:04","modified_gmt":"2025-04-26T00:28:04","slug":"zen-cart%e8%bf%90%e8%b4%b9%e6%89%8b%e5%8a%a8%e4%bc%b0%e7%ae%97%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/61004\/","title":{"rendered":"Zen-cart\u8fd0\u8d39\u624b\u52a8\u4f30\u7b97\u529f\u80fd"},"content":{"rendered":"<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523ARYT10-DS4.jpg\" class=\"aligncenter\" title=\"Zen-cart\u8fd0\u8d39\u624b\u52a8\u4f30\u7b97\u529f\u80fd\u63d2\u56fe\" alt=\"Zen-cart\u8fd0\u8d39\u624b\u52a8\u4f30\u7b97\u529f\u80fd\u63d2\u56fe\" \/><br \/> &nbsp;<\/p>\n<p> Zen-cart\u4e2d\u7684\u8fd0\u8d39\u4f30\u7b97\u51fa\u73b0\u5728\u8d2d\u7269\u8f66\u9875\u9762\uff0c\u5b83\u53ea\u80fd\u6839\u636e\u8d2d\u7269\u8f66\u4e2d\u7684\u91cd\u91cf\u4f30\u7b97\u8fd0\u8d39\uff0c\u800c\u65e0\u6cd5\u624b\u52a8\u8f93\u5165\u91cd\u91cf\u8fdb\u884c\u4f30\u7b97\u3002\u624b\u52a8\u8f93\u5165\u91cd\u91cf\u53ef\u4ee5\u5feb\u901f\u6bd4\u8f83\u5404\u79cd\u8fd0\u8f93\u65b9\u5f0f\u7684\u4ef7\u683c\u3002<\/p>\n<p> \u8fd9\u91cc\u7684\u8fd9\u4e2a\u529f\u80fd\u4eceZen-cart\u9ed8\u8ba4\u7684\u8fd0\u8d39\u4f30\u7b97\u79fb\u690d\u800c\u6765\uff0c\u7cbe\u7b80\u4e86\u4e00\u4e9b\u4ee3\u7801\u3002\u6838\u5fc3\u4ee3\u7801\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  <\/td>\n<td>   if(isset($_POST[&#8216;action&#8217;]) &amp;&amp; ($_POST[&#8216;action&#8217;] == &#8216;submit&#8217;)){   &nbsp;&nbsp;&nbsp;&nbsp;if(isset($_POST[&#8216;shipping_weight&#8217;])){   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$_SESSION[&#8216;shipping_weight&#8217;] = (int)$_POST[&#8216;shipping_weight&#8217;];   &nbsp;&nbsp;&nbsp;&nbsp;}   &nbsp;&nbsp;&nbsp;&nbsp;if (isset($_POST[&#8216;zone_country_id&#8217;])){   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$_SESSION[&#8216;zone_country_id&#8217;] = $_POST[&#8216;zone_country_id&#8217;];   &nbsp;&nbsp;&nbsp;&nbsp;}   &nbsp;&nbsp;&nbsp;&nbsp;zen_redirect(zen_href_link(&#8216;shipping_estimator&#8217;));   &nbsp;&nbsp;&nbsp;&nbsp;exit;   }   &nbsp;   if (isset($_SESSION[&#8216;zone_country_id&#8217;])){   &nbsp;&nbsp;&nbsp;&nbsp;$country_info = zen_get_countries($_SESSION[&#8216;zone_country_id&#8217;],true);   &nbsp;&nbsp;&nbsp;&nbsp;$order-&gt;delivery = array(&#8216;country&#8217; =&gt; array(&#8216;id&#8217; =&gt; $_SESSION[&#8216;zone_country_id&#8217;], &#8216;title&#8217; =&gt; $country_info[&#8216;countries_name&#8217;], &#8216;iso_code_2&#8217; =&gt; $country_info[&#8216;countries_iso_code_2&#8217;], &#8216;iso_code_3&#8217; =&gt;&nbsp; $country_info[&#8216;countries_iso_code_3&#8217;]), &#8216;country_id&#8217; =&gt; $_SESSION[&#8216;zone_country_id&#8217;]);&nbsp;&nbsp;   } else {   &nbsp;&nbsp;&nbsp;&nbsp;$country_info = zen_get_countries(STORE_COUNTRY,true);   &nbsp;&nbsp;&nbsp;&nbsp;$order-&gt;delivery = array(&#8216;country&#8217; =&gt; array(&#8216;id&#8217; =&gt; STORE_COUNTRY, &#8216;title&#8217; =&gt; $country_info[&#8216;countries_name&#8217;], &#8216;iso_code_2&#8217; =&gt; $country_info[&#8216;countries_iso_code_2&#8217;], &#8216;iso_code_3&#8217; =&gt;&nbsp; $country_info[&#8216;countries_iso_code_3&#8242;]),&#8217;country_id&#8217; =&gt; STORE_COUNTRY);   }   &nbsp;   $total_weight = 10;   if(isset($_SESSION[&#8216;shipping_weight&#8217;])){   &nbsp;&nbsp;&nbsp;&nbsp;$total_weight = (int)$_SESSION[&#8216;shipping_weight&#8217;];   }   &nbsp;   \/\/\/\/\/\/\/   require(DIR_WS_CLASSES . &#8216;shipping.php&#8217;);   $shipping_modules = new shipping;   $quotes = $shipping_modules-&gt;quote();   $qs = array();   foreach($quotes as $q){   &nbsp;&nbsp;&nbsp;&nbsp;if($q[&#8216;id&#8217;] == &#8216;freeshipper&#8217;){   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;continue;   &nbsp;&nbsp;&nbsp;&nbsp;}else{   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$qs[] = $q;   &nbsp;&nbsp;&nbsp;&nbsp;}   }   $quotes = $qs;&nbsp;   \/\/\/\/\/\/\/   &nbsp;   \/\/ set selections for displaying   $selected_country = $order-&gt;delivery[&#8216;country&#8217;][&#8216;id&#8217;];   $free_shipping = false;   &nbsp;   $show_in = &#8216;shipping_estimator&#8217;;   <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u63a5\u4e0b\u6765\u5c31\u662f\u4e00\u4e2a\u8868\u5355\u8f93\u51fa\u3002<\/p>\n<p> \u6ce8\u610f\u95ee\u9898\uff1a\u4ece\u4ee3\u7801\u53ef\u4ee5\u770b\u51fa\uff0c\u6211\u628afreeshipper\u8fd9\u79cd\u8fd0\u8f93\u65b9\u5f0f\u7ed9\u8fc7\u6ee4\u6389\u4e86\u3002\u9ed8\u8ba4\uff0c\u5982\u679c\u8d2d\u7269\u8f66\u4e2d\u6ca1\u6709\u4ea7\u54c1\u6216\u4ea7\u54c1\u91cd\u91cf\u4e3a\u96f6\uff0c\u8fd9\u4e2a\u8fd0\u8f93\u65b9\u5f0f\u5c31\u53ef\u80fd\u88ab\u6fc0\u6d3b\u3002\u800c\u6211\u4e0d\u60f3\u53bb\u4fee\u6539freeshipper\u7684\u903b\u8f91\uff0c\u6240\u4ee5\u8fd9\u91cc\u628a\u5b83\u8fc7\u6ee4\u6389\u3002\u53e6\u5916\uff0c\u6bcf\u4e2a\u8fd0\u8d39\u6a21\u5757\u7684\u7c7b\u7684\u6784\u9020\u51fd\u6570\u4e2d\u90fd\u6709\u5224\u65ad\u6a21\u5757\u662f\u5426\u542f\u7528\u7684\u4ee3\u7801\u903b\u8f91\uff1a<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td>  1   2   3  <\/td>\n<td>   if (zen_get_shipping_enabled($this-&gt;code) ) {   &nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;enabled = ((MODULE_SHIPPING_HK_POST_AIR_MAIL_STATUS == &#8216;True&#8217;) ? true : false);   }   <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u5f53\u524d\u8fd0\u8f93\u65b9\u5f0f\u662f\u5426\u542f\u7528\uff0c\u7531zen_get_shipping_enabled()\u51fd\u6570\u63a7\u5236\uff0c\u8fd9\u4e2a\u51fd\u6570\u6839\u636e\u8d2d\u7269\u8f66\u7684\u5185\u5bb9\u63a7\u5236\u8fd0\u8d39\u6a21\u5757\u662f\u5426\u542f\u7528\uff0c\u5f88\u660e\u663e\uff0c\u5bf9\u4e8e\u624b\u52a8\u8f93\u5165\u91cd\u91cf\u6765\u8ba1\u7b97\u8fd0\u8d39\u7684\u60c5\u51b5\uff0c\u662f\u4e00\u5927\u9650\u5236\uff0c\u53ef\u4ee5\u4fee\u6539\u8fd9\u4e2a\u51fd\u6570\u7684\u903b\u8f91\uff0c\u4e0d\u8fc7\u6211\u66f4\u52a0\u503e\u5411\u4fee\u6539\u6211\u7684\u81ea\u5b9a\u4e49\u8fd0\u8d39\u6a21\u5757\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff1a<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td>  1   2   3   4   5  <\/td>\n<td>   \/\/&#8230;.   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;global $order, $db, $total_weight;   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (zen_get_shipping_enabled($this-&gt;code) || ($total_weight &gt; 0)) {   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;enabled = ((MODULE_SHIPPING_HK_POST_AIR_MAIL_STATUS == &#8216;True&#8217;) ? true : false);   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}   <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u4ece\u5916\u90e8\u83b7\u53d6$total_weight\uff0c\u5728\u8fd0\u8d39\u6a21\u5757\u521d\u59cb\u5316\u65f6\uff0c\u91cd\u91cf\u786e\u5b9a\uff0c\u7136\u540e\u5224\u65ad\u8fd9\u4e2a\u91cd\u91cf\uff0c\u53ea\u8981\u5927\u4e8e\u96f6\u6a21\u5757\u5c31\u603b\u662f\u542f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Zen-cart\u4e2d\u7684\u8fd0\u8d39\u4f30\u7b97\u51fa\u73b0\u5728\u8d2d\u7269\u8f66\u9875\u9762\uff0c\u5b83\u53ea\u80fd\u6839\u636e\u8d2d\u7269\u8f66\u4e2d\u7684\u91cd\u91cf\u4f30\u7b97\u8fd0\u8d39\uff0c\u800c\u65e0\u6cd5\u624b\u52a8\u8f93\u5165\u91cd\u91cf\u8fdb\u884c\u4f30\u7b97\u3002\u624b\u52a8\u8f93\u5165\u91cd\u91cf\u53ef\u4ee5\u5feb\u901f\u6bd4\u8f83\u5404\u79cd\u8fd0\u8f93\u65b9\u5f0f\u7684\u4ef7\u683c\u3002 \u8fd9\u91cc\u7684\u8fd9\u4e2a\u529f\u80fd\u4eceZen-cart\u9ed8\u8ba4\u7684\u8fd0\u8d39\u4f30\u7b97\u79fb\u690d\u800c\u6765\uff0c\u7cbe\u7b80\u4e86\u4e00\u4e9b\u4ee3\u7801\u3002\u6838\u5fc3\u4ee3\u7801\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 35 36 37 38 39 40 41 42 43 44 if(isset($_POST[&#8216;action&#8217;]) &amp;&amp; ($_POST[&#8216;action&#8217;] == &#8216;submit&#8217;)){ &nbsp;&nbsp;&nbsp;&nbsp;if(isset($_POST[&#8216;shipping_weight&#8217;])){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$_SESSION[&#8216;shipping_weight&#8217;] = [&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-61004","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61004","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=61004"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61004\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=61004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=61004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=61004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}