{"id":61007,"date":"2025-04-26T11:11:01","date_gmt":"2025-04-26T03:11:01","guid":{"rendered":"https:\/\/fwq.ai\/blog\/61007\/"},"modified":"2025-04-26T11:11:01","modified_gmt":"2025-04-26T03:11:01","slug":"zencart%e5%9b%bd%e5%ae%b6%e6%8e%92%e5%ba%8f%e5%8f%8a%e4%b8%ad%e6%96%87%e5%90%8d%e7%a7%b0%e7%9a%84%e6%89%a9%e5%b1%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/61007\/","title":{"rendered":"Zencart\u56fd\u5bb6\u6392\u5e8f\u53ca\u4e2d\u6587\u540d\u79f0\u7684\u6269\u5c55"},"content":{"rendered":"<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/160910\/122025NN-0.png\" class=\"aligncenter\" title=\"Zencart\u56fd\u5bb6\u6392\u5e8f\u53ca\u4e2d\u6587\u540d\u79f0\u7684\u6269\u5c55\u63d2\u56fe\" alt=\"Zencart\u56fd\u5bb6\u6392\u5e8f\u53ca\u4e2d\u6587\u540d\u79f0\u7684\u6269\u5c55\u63d2\u56fe\" \/><\/p>\n<p> Zencart\u56fd\u5bb6\u6392\u5e8f\u53ca\u4e2d\u6587\u540d\u79f0\u7684\u6269\u5c55,\u6700\u7ec8\u5b9e\u73b0\u6548\u679c\u5982\u4e0a<\/p>\n<p> \u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<p> 1. \u624b\u52a8\u6216SQL\u4fee\u6539\u6570\u636e\u8868\uff0c\u589e\u52a02\u4e2a\u5b57\u6bb5<\/p>\n<pre>\r\nALTER TABLE countries ADD `countries_name_cn` VARCHAR( 64 ) NULL DEFAULT '', ADD `order_by` int(11) NOT NULL DEFAULT '0';<\/pre>\n<p> 2. \u4fee\u6539admin\/countries.php\u6587\u4ef6\uff0c\u589e\u52a0\u8868\u5355\u63d2\u5165\u7f16\u8f91\u529f\u80fd\uff0c \u5171\u8ba17\u5904\uff0c\u6b64\u5904\u5ffd\u7565\u5177\u4f53\u4ee3\u7801\u3002<\/p>\n<p> 3.&nbsp;\u4e4b\u540e\u8fd8\u8981\u4fee\u6539\u4e24\u4e2a\u83b7\u53d6\u56fd\u5bb6\u4e0b\u62c9\u5217\u8868\u7684\u51fd\u6570\uff08\u524d\u53f0\u540e\u53f0\u5206\u522b\u5bf9\u5e94\u4e00\u4e2a\uff09<\/p>\n<p> #includes\/functions\/functions_lookups.php<\/p>\n<pre>\r\n  function zen_get_countries($countries_id = '', $with_iso_codes = false) {\r\n    global $db;\r\n    $countries_array = array();\r\n    if (zen_not_null($countries_id)) {\r\n~\r\n~\r\n    } else {\r\n      $countries = \"select countries_id, countries_name, countries_name_cn\r\n                    from \" . TABLE_COUNTRIES . \"\r\n                    order by order_by, countries_name\";\r\n\r\n      $countries_values = $db-&gt;Execute($countries);\r\n\r\n      while (!$countries_values-&gt;EOF) {\r\n        $countries_array[] = array('countries_id' =&gt; $countries_values-&gt;fields['countries_id'],\r\n                                   'countries_name' =&gt; $countries_values-&gt;fields['countries_name'].\" - \".$countries_values-&gt;fields['countries_name_cn']);\r\n\r\n        $countries_values-&gt;MoveNext();\r\n      }\r\n    }\r\n\r\n    return $countries_array;\r\n  }<\/pre>\n<p> #admin\/includes\/functions\/general.php<\/p>\n<pre>\r\n  function zen_get_countries($default = '') {\r\n    global $db;\r\n    $countries_array = array();\r\n    if ($default) {\r\n      $countries_array[] = array('id' =&gt; '',\r\n                                 'text' =&gt; $default);\r\n    }\r\n    $countries = $db-&gt;Execute(\"select countries_id, countries_name,countries_name_cn\r\n                               from \" . TABLE_COUNTRIES . \"\r\n                               order by order_by, countries_name\");\r\n\r\n    while (!$countries-&gt;EOF) {\r\n      $countries_array[] = array('id' =&gt; $countries-&gt;fields['countries_id'],\r\n                                 'text' =&gt; $countries-&gt;fields['countries_name'].\" - \".$countries-&gt;fields['countries_name_cn']);\r\n      $countries-&gt;MoveNext();\r\n    }\r\n\r\n    return $countries_array;\r\n  }<\/pre>\n<p> \u6700\u7ec8\u6548\u679c<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/160910\/1220253535-1.png\" class=\"aligncenter\" title=\"Zencart\u56fd\u5bb6\u6392\u5e8f\u53ca\u4e2d\u6587\u540d\u79f0\u7684\u6269\u5c55\u63d2\u56fe1\" alt=\"Zencart\u56fd\u5bb6\u6392\u5e8f\u53ca\u4e2d\u6587\u540d\u79f0\u7684\u6269\u5c55\u63d2\u56fe1\" \/><\/p>\n<p> \u5982\u679c\u4e0d\u662f\u7279\u522b\u9700\u8981\uff0c\u540e\u53f0\u51fd\u6570\u4e5f\u53ef\u4e0d\u4fee\u6539\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zencart\u56fd\u5bb6\u6392\u5e8f\u53ca\u4e2d\u6587\u540d\u79f0\u7684\u6269\u5c55,\u6700\u7ec8\u5b9e\u73b0\u6548\u679c\u5982\u4e0a \u5177\u4f53\u6b65\u9aa4\uff1a 1. \u624b\u52a8\u6216SQL\u4fee\u6539\u6570\u636e\u8868\uff0c\u589e\u52a02\u4e2a\u5b57\u6bb5 ALTER TABLE countries ADD `countries_name_cn` VARCHAR( 64 ) NULL DEFAULT &#8221;, ADD `order_by` int(11) NOT NULL DEFAULT &#8216;0&#8217;; 2. \u4fee\u6539admin\/countries.php\u6587\u4ef6\uff0c\u589e\u52a0\u8868\u5355\u63d2\u5165\u7f16\u8f91\u529f\u80fd\uff0c \u5171\u8ba17\u5904\uff0c\u6b64\u5904\u5ffd\u7565\u5177\u4f53\u4ee3\u7801\u3002 3.&nbsp;\u4e4b\u540e\u8fd8\u8981\u4fee\u6539\u4e24\u4e2a\u83b7\u53d6\u56fd\u5bb6\u4e0b\u62c9\u5217\u8868\u7684\u51fd\u6570\uff08\u524d\u53f0\u540e\u53f0\u5206\u522b\u5bf9\u5e94\u4e00\u4e2a\uff09 #includes\/functions\/functions_lookups.php function zen_get_countries($countries_id = &#8221;, $with_iso_codes = false) { global $db; $countries_array = array(); if (zen_not_null($countries_id)) { ~ ~ } else { $countries = &#8220;select countries_id, countries_name, countries_name_cn from [&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-61007","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61007","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=61007"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61007\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=61007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=61007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=61007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}