{"id":199523,"date":"2025-05-03T10:23:07","date_gmt":"2025-05-03T02:23:07","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199523\/"},"modified":"2025-05-03T10:23:07","modified_gmt":"2025-05-03T02:23:07","slug":"ecshop%e8%ae%a2%e5%8d%95%e6%8f%90%e4%ba%a4%e9%a1%b5%e9%9d%a2%e8%af%a6%e7%bb%86%e5%9c%b0%e5%9d%80%e6%98%be%e7%a4%ba%e7%9c%81%e5%b8%82%e5%8c%ba","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199523\/","title":{"rendered":"ecshop\u8ba2\u5355\u63d0\u4ea4\u9875\u9762\u8be6\u7ec6\u5730\u5740\u663e\u793a\u7701\u5e02\u533a"},"content":{"rendered":"<p>\u9ed8\u8ba4\u7684ecshop\u8ba2\u5355\u63d0\u4ea4\u9875\u9762\uff0c\u6536\u8d27\u4eba\u4fe1\u606f\u4e2d\u53ea\u8bb0\u5f55\u4e86\u7528\u6237\u7684\u8be6\u7ec6\u5730\u5740\uff0c\u6ca1\u6709\u663e\u793a\u7701\u4efd\u3001\u57ce\u5e02\u548c\u533a\u57df\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/160525\/0205415625-0.png\" class=\"aligncenter\">   \u4e0b\u9762\u6211\u4eec\u5c31\u6765\u8c03\u53d6\u5df2\u7ecf\u586b\u5199\u7684\u7701\u4efd\u3001\u57ce\u5e02\u548c\u533a\u57df\u3002   &nbsp;   1\u3001\u627e\u5230includes\/lib_main.php\uff0c\u6dfb\u52a0\u4e00\u4e2a\u51fd\u6570   &nbsp;   &nbsp;   function get_region_name($rid){   &nbsp; &nbsp; return $GLOBALS[&#8216;db&#8217;]-&gt;GetOne(&#8220;SELECT region_name FROM &#8220;.$GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;region&#8217;).&#8221; WHERE region_id=&#8217;$rid'&#8221;);   }   2.\u627e\u5230flow.php\uff0c\u5b9a\u4f4d\u5230   &nbsp;   &nbsp;   elseif ($_REQUEST[&#8216;step&#8217;] == &#8216;checkout&#8217;)   \u5728\u6b64\u533a\u5757\u4e0b\u627e\u5230   &nbsp;   &nbsp;   $smarty-&gt;assign(&#8216;consignee&#8217;,$consignee);   \u9ed8\u8ba4\u5e94\u8be5\u5728483\u884c\u5de6\u53f3\uff0c\u7136\u540e\u5728\u6b64\u884c\u4e0a\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a   &nbsp;   &nbsp;   $consignee[&#8216;province_name&#8217;] &nbsp;= &nbsp;get_region_name($consignee[&#8216;province&#8217;]);   $consignee[&#8216;city_name&#8217;] &nbsp;= &nbsp;get_region_name($consignee[&#8216;city&#8217;]);   $consignee[&#8216;district_name&#8217;] &nbsp;= &nbsp;get_region_name($consignee[&#8216;district&#8217;]);   3\u3001\u627e\u5230\u6a21\u677f\u6587\u4ef6flow.dwt\uff0c\u5728themes\/\u6a21\u7248\u6587\u4ef6\u5939\/flow.php\uff0c\u67e5\u627e   &nbsp;   1   &lt;!&#8211; {if $step eq &#8220;checkout&#8221;} \u5f00\u59cb\u8ba2\u5355\u786e\u8ba4\u754c\u9762 &#8211;&gt;   \u5728\u6b64\u533a\u5757\u4e0b\u627e\u5230\u5982\u4e0b\u4ee3\u7801\u3002\u5927\u7ea6\u5728401\u884c\uff0c\u4e0d\u540c\u7684\u6a21\u7248\u53ef\u80fd\u4e0d\u4e00\u6837\uff0c\u53ef\u67e5\u627e\u5173\u952e\u5b57   &nbsp;   &nbsp;   &nbsp; &nbsp; &lt;!&#8211; {if $total.real_goods_count gt 0} &#8211;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$lang.detailed_address}:&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$consignee.address|escape} &lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$lang.postalcode}:&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$consignee.zipcode|escape}&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp;&lt;!&#8211; {\/if} &#8211;&gt;   \u628a\u4e0a\u9762\u7684\u4ee3\u7801\u4fee\u6539\u4e3a\u4ee5\u4e0b\u4ee3\u7801\uff1a   &nbsp;   &nbsp;   &nbsp; &lt;!&#8211; {if $total.real_goods_count gt 0} &#8211;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$lang.detailed_address}:&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$consignee.province_name|escape}-{$consignee.city_name|escape}-{$consignee.district_name|escape}-{$consignee.address|escape} &lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$lang.postalcode}:&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$consignee.zipcode|escape}&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &lt;!&#8211; {\/if} &#8211;&gt;   \u4fee\u6539\u4e4b\u540e\uff0c\u663e\u793a<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/160525\/0205412064-1.png\" class=\"aligncenter\">   \u4e0b\u9762\u6211\u4eec\u6765\u4fee\u6539\u4f1a\u5458\u4e2d\u5fc3\u6211\u7684\u8ba2\u5355\u4e2d\u7684\u8be6\u7ec6\u5730\u5740   1.\u6253\u5f00\u6839\u76ee\u5f55user.php\u627e\u5230\u4ee5\u4e0b\u4ee3\u7801   &nbsp;   &nbsp;   $smarty-&gt;assign(&#8216;order&#8217;, &nbsp; &nbsp; &nbsp;$order);   \u5728\u5176\u4e0a\u65b9\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801   &nbsp;   &nbsp;   $order[&#8216;province_name&#8217;] &nbsp;= &nbsp;get_region_name($order[&#8216;province&#8217;]);   $order[&#8216;city_name&#8217;] &nbsp;= &nbsp;get_region_name($order[&#8216;city&#8217;]);   $order[&#8216;district_name&#8217;] &nbsp;= &nbsp;get_region_name($order[&#8216;district&#8217;]);   2.\u6253\u5f00user_transaction.dwt\uff0c\u5728themes\/\u6a21\u7248\u6587\u4ef6\u5939\/user_transaction.dwt\uff0c\u627e\u5230\u4e0b\u9762\u7684\u4ee3\u7801   &nbsp;   &nbsp;   {$order.address|escape}   \u66ff\u6362\u4e3a\u4ee5\u4e0b\u4ee3\u7801   &nbsp;   &nbsp;   {$order.province_name|escape}-{$order.city_name|escape}-{$order.district_name|escape}-{$order.address|escape}   \u4fee\u6539\u5b8c\u6210\uff0c\u663e\u793a<br \/>\n<br \/> <br \/>\n<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/160525\/0205411V9-2.png\" class=\"aligncenter\">   &nbsp;  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9ed8\u8ba4\u7684ecshop\u8ba2\u5355\u63d0\u4ea4\u9875\u9762\uff0c&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-199523","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=199523"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199523\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}