{"id":59551,"date":"2025-04-23T11:06:59","date_gmt":"2025-04-23T03:06:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/59551\/"},"modified":"2025-04-23T11:06:59","modified_gmt":"2025-04-23T03:06:59","slug":"ecshop%e5%a2%9e%e5%8a%a0%e6%9c%80%e5%a4%a7%e8%b4%ad%e7%89%a9%e9%87%91%e9%a2%9d%e9%99%90%e5%88%b6%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/59551\/","title":{"rendered":"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd"},"content":{"rendered":"<p> ecshop\u540e\u53f0\u9ed8\u8ba4\u7ba1\u7406\u9875\u9762\u91cc\u6709\u4e00\u9879\u529f\u80fd\u662f\u6700\u5c0f\u8d2d\u7269\u91d1\u989d\u9650\u5236\uff0c\u610f\u601d\u5f53\u5ba2\u6237\u4e70\u7684\u4e1c\u897f\u4ef7\u683c\u592a\u5c0f\uff0c\u6ca1\u6709\u5229\u6da6\u53ef\u8d5a\u7684\u65f6\u5019\uff0c\u4e0d\u5141\u8bb8\u7528\u6237\u63d0\u4ea4\u8ba2\u5355\u3002<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150503\/04562A300-0.png\" class=\"aligncenter\" title=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe\" alt=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe\" \/><\/p>\n<p> <span style=\"line-height: 18px\">\u7136\u800c\u5728\u5b9e\u9645\u7684\u67d0\u4e9b\u65b9\u9762\u7684\u4e70\u5356\u4e2d\uff0c\u54b1\u4eec\u4e5f\u8bb8\u8fd8\u9700\u8981\u4e00\u4e2a\u6700\u5927\u8d2d\u7269\u91d1\u989d\u7ea6\u675f\uff0c\u6240\u4ee5\u6b64\u6587\u7684\u7531\u6765\u5373\u662f\u8fd9\u513f\u3002\u521d\u770b\uff0c\u5f62\u4f3c\u5f88\u7b80\u7565\u4e48\uff0c\u4e00\u4e2a\u8868\u5355\u91cc\u52a0\u4e2ainputtext\uff0c\u524d\u9762\u641e\u4e2alabel\u6216\u8bb8span\u5199\u4e0a\u201c\u6700\u5927\u8d2d\u7269\u91d1\u989d\u201d\uff0c\u7136\u540e\u628a\u8be5\u6dfb\u52a0\u7684inputtext\u7684value\u5b58\u50a8\u5230\u6570\u636e\u5e93\u91cc\uff0c\u4f46\u662f\u4e8b\u5b9e\u4e0a\u5374\u5e76\u4e0d\u662f\u90a3\u4e48\u7684\u7b80\u7565\u3002<\/span><\/p>\n<p> \u5148\u6765\u770b\u540e\u53f0\u8be5\u9009\u9879\u7684\u914d\u7f6e\u6587\u4ef6\u4e3a\/admin\/shop_config.php\uff0c\u6253\u5f00\u540e\uff0c\u53d1\u73b0\u5176\u6587\u4ef6\u5185\u5e76\u6ca1\u6709\u4efb\u4f55\u76f4\u63a5\u53ef\u4ee5\u9884\u8bfb\u5230\u7684\u4e1c\u897f\uff0c\u4e5f\u6ca1\u6709\u5448\u73b0\u51fa\u4e0a\u9762\u6240\u8bf4\u7684\u8868\u5355\u7684\u57fa\u7840\u7ed3\u6784\u3002\u597d\u5427\uff0c\u5148\u770b\u770b\u6587\u4ef6\u5185\u6709\u4e9b\u4ec0\u4e48\u5427\u3002\u5f88\u5feb\u627e\u5230\u4e0b\u9762\u90a3\u4e00\u884c\uff0c\u5f97\u51fa\u9009\u9879\u5b58\u50a8\u7684\u6570\u636e\u90fd\u5b58\u653e\u5728\u540d\u4e3ashop_config\u7684table\u91cc\u3002<\/p>\n<pre>\r\n$sql = \"SELECT * FROM \" . $ecs-&gt;table('shop_config') .\r\n            \" WHERE type&lt;&gt;'hidden' $config_groups $excludes_groups ORDER BY parent_id, sort_order, id\";\r\n<\/pre>\n<p> \u6587\u4ef6\u672b\u5c3e\u6709\u4e2a\u51fd\u6570\uff0c\u8bfb\u53d6\u914d\u7f6e\u5230\u6570\u7ec4\u91cc\u53d8\u91cf\u5b58\u653e\uff0c\u770b\u6765\u662f\u7528\u6765\u76f4\u63a5\u8bfb\u53d6\u6570\u636e\u5e93\u91cc\u7684shop_config\u8868\u91cc\u7684\u5404\u9879\u7684\u503c\u3002<\/p>\n<pre>\r\n\/**\r\n * \u83b7\u5f97\u8bbe\u7f6e\u4fe1\u606f\r\n *\r\n * @param   array   $groups     \u9700\u8981\u83b7\u5f97\u7684\u8bbe\u7f6e\u7ec4\r\n * @param   array   $excludes   \u4e0d\u9700\u8981\u83b7\u5f97\u7684\u8bbe\u7f6e\u7ec4\r\n *\r\n * @return  array\r\n *\/\r\nfunction get_settings($groups=null, $excludes=null)\r\n<\/pre>\n<p> \u90a3\u4e48shop_config\u91cc\u7684\u6570\u503c\u662f\u4ec0\u4e48\u65f6\u5019\u751f\u6210\u7684\u5462\uff1f\u8fd9\u4e2a\u662f\u5b89\u88c5\u521d\u59cb\u5316\u7684\u65f6\u5019\u5199\u5165\u5230\u6570\u636e\u5e93\u91cc\u7684\uff0c\u6240\u4ee5\u63a5\u4e0b\u6765\u6253\u5f00shop_config\u8868\uff0c\u5f88\u5bb9\u6613\u627e\u5230code\u4e3amin_goods_amount\u7684value\u4e3a10\u3002<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150503\/04562A942-1.png\" style=\"width: 600px;height: 105px\" class=\"aligncenter\" title=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe1\" alt=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe1\" \/><\/p>\n<p> parent_id\u5bf9\u5e94\u7684\u5c31\u662fget_settings\u51fd\u6570\u91cc\u7684group\uff0c\u8d2d\u7269\u6d41\u7a0b\u662f\u7b2c4\u4e2a\u9879\u76ee\uff0c\u6240\u4ee5\u8fd9\u91cc\u662f4\uff1a<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150503\/0456261216-2.png\" style=\"width: 356px;height: 79px\" class=\"aligncenter\" title=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe2\" alt=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe2\" \/><\/p>\n<p> \u7136\u540e\u6839\u636e\u4e0a\u6587\u63d0\u5230\u7684sql\u8bed\u53e5\uff0c\u57fa\u672c\u53ef\u4ee5\u5224\u5b9a\u6309id\u5927\u5c0f\u987a\u5e8f\u8bfb\u53d6\u8be5\u8868\u5185\u5bb9\uff0c\u7136\u540e\u5448\u73b0\u5728Ecshop\u540e\u53f0\u7684\u914d\u7f6e\u9009\u9879\u4e2d\uff0c\u5c1d\u8bd5\u5728\u8868\u91cc\u6700\u540e\u76f4\u63a5\u6dfb\u52a0\u4e00\u884c\u6570\u636e\uff1a<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150503\/04562634J-3.png\" style=\"width: 600px;height: 56px\" class=\"aligncenter\" title=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe3\" alt=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe3\" \/><\/p>\n<p> \u53e6\u5916\u9700\u8981\u81ea\u884c\u8c03\u6574\u5bf9\u5e94\u7684\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6\/languages\/zh_cn\/admin\/shop_config.php\uff0c\u5bf9\u5e94\u4f4d\u7f6e\u6dfb\u52a0\u4e0b\u9762\u4e24\u884c\u3002<\/p>\n<pre>\r\n$_LANG['cfg_name']['max_goods_amount'] = '\u6700\u5927\u8d2d\u7269\u91d1\u989d';   \r\n$_LANG['cfg_desc']['max_goods_amount'] = '\u4f4e\u4e8e\u6b64\u8d2d\u7269\u91d1\u989d\uff0c\u624d\u80fd\u63d0\u4ea4\u8ba2\u5355\u3002';\r\n<\/pre>\n<p> \u4ee5\u53calanguages\/zh_cn\/shopping_flow\u91cc\u6dfb\u52a0\u8d85\u8fc7\u9650\u989d\u8fd4\u56de\u7684\u63d0\u793a\u5185\u5bb9\u3002<\/p>\n<pre>\r\n$_LANG['goods_amount_not_enough'] = '\u60a8\u8d2d\u4e70\u7684\u5546\u54c1\u6ca1\u6709\u8fbe\u5230\u672c\u5e97\u7684\u6700\u4f4e\u9650\u8d2d\u91d1\u989d %s \uff0c\u4e0d\u80fd\u63d0\u4ea4\u8ba2\u5355\u3002';\r\n<\/pre>\n<p> \u6700\u7ec8\uff0c\u5237\u65b0\u540e\u53f0\u914d\u7f6e\u9875\u9762\uff0c\u663e\u793a\u5982\u4e0b\uff1a<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150503\/04562610P-4.png\" style=\"width: 554px;height: 165px\" class=\"aligncenter\" title=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe4\" alt=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe4\" \/><\/p>\n<p> \u5f53\u7528\u6237\u8d2d\u4e70\u8d85\u8fc71000\u5143\u7684\u7269\u54c1\u65f6\uff1a<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150503\/0456261117-5.png\" style=\"width: 600px;height: 172px\" class=\"aligncenter\" title=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe5\" alt=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe5\" \/><\/p>\n<p> \u524d\u53f0\u8fd4\u56de\u9519\u8bef\u9875\u9762\u7ed9\u7528\u6237\uff1a<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150503\/0456262413-6.png\" style=\"width: 600px;height: 100px\" class=\"aligncenter\" title=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe6\" alt=\"ecshop\u589e\u52a0\u6700\u5927\u8d2d\u7269\u91d1\u989d\u9650\u5236\u529f\u80fd\u63d2\u56fe6\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ecshop\u540e\u53f0\u9ed8\u8ba4\u7ba1\u7406\u9875\u9762\u91cc\u6709\u4e00\u9879\u529f\u80fd\u662f\u6700\u5c0f\u8d2d\u7269\u91d1\u989d\u9650\u5236\uff0c\u610f\u601d\u5f53\u5ba2\u6237\u4e70\u7684\u4e1c\u897f\u4ef7\u683c\u592a\u5c0f\uff0c\u6ca1\u6709\u5229\u6da6\u53ef\u8d5a\u7684\u65f6\u5019\uff0c\u4e0d\u5141\u8bb8\u7528\u6237\u63d0\u4ea4\u8ba2\u5355\u3002 \u7136\u800c\u5728\u5b9e\u9645\u7684\u67d0\u4e9b\u65b9\u9762\u7684\u4e70\u5356\u4e2d\uff0c\u54b1\u4eec\u4e5f\u8bb8\u8fd8\u9700\u8981\u4e00\u4e2a\u6700\u5927\u8d2d\u7269\u91d1\u989d\u7ea6\u675f\uff0c\u6240\u4ee5\u6b64\u6587\u7684\u7531\u6765\u5373\u662f\u8fd9\u513f\u3002\u521d\u770b\uff0c\u5f62\u4f3c\u5f88\u7b80\u7565\u4e48\uff0c\u4e00\u4e2a\u8868\u5355\u91cc\u52a0\u4e2ainputtext\uff0c\u524d\u9762\u641e\u4e2alabel\u6216\u8bb8span\u5199\u4e0a\u201c\u6700\u5927\u8d2d\u7269\u91d1\u989d\u201d\uff0c\u7136\u540e\u628a\u8be5\u6dfb\u52a0\u7684inputtext\u7684value\u5b58\u50a8\u5230\u6570\u636e\u5e93\u91cc\uff0c\u4f46\u662f\u4e8b\u5b9e\u4e0a\u5374\u5e76\u4e0d\u662f\u90a3\u4e48\u7684\u7b80\u7565\u3002 \u5148\u6765\u770b\u540e\u53f0\u8be5\u9009\u9879\u7684\u914d\u7f6e\u6587\u4ef6\u4e3a\/admin\/shop_config.php\uff0c\u6253\u5f00\u540e\uff0c\u53d1\u73b0\u5176\u6587\u4ef6\u5185\u5e76\u6ca1\u6709\u4efb\u4f55\u76f4\u63a5\u53ef\u4ee5\u9884\u8bfb\u5230\u7684\u4e1c\u897f\uff0c\u4e5f\u6ca1\u6709\u5448\u73b0\u51fa\u4e0a\u9762\u6240\u8bf4\u7684\u8868\u5355\u7684\u57fa\u7840\u7ed3\u6784\u3002\u597d\u5427\uff0c\u5148\u770b\u770b\u6587\u4ef6\u5185\u6709\u4e9b\u4ec0\u4e48\u5427\u3002\u5f88\u5feb\u627e\u5230\u4e0b\u9762\u90a3\u4e00\u884c\uff0c\u5f97\u51fa\u9009\u9879\u5b58\u50a8\u7684\u6570\u636e\u90fd\u5b58\u653e\u5728\u540d\u4e3ashop_config\u7684table\u91cc\u3002 $sql = &#8220;SELECT * FROM &#8221; . $ecs-&gt;table(&#8216;shop_config&#8217;) . &#8221; WHERE type&lt;&gt;&#8217;hidden&#8217; $config_groups $excludes_groups ORDER BY parent_id, sort_order, id&#8221;; \u6587\u4ef6\u672b\u5c3e\u6709\u4e2a\u51fd\u6570\uff0c\u8bfb\u53d6\u914d\u7f6e\u5230\u6570\u7ec4\u91cc\u53d8\u91cf\u5b58\u653e\uff0c\u770b\u6765\u662f\u7528\u6765\u76f4\u63a5\u8bfb\u53d6\u6570\u636e\u5e93\u91cc\u7684shop_config\u8868\u91cc\u7684\u5404\u9879\u7684\u503c\u3002 \/** * \u83b7\u5f97\u8bbe\u7f6e\u4fe1\u606f * * @param array $groups \u9700\u8981\u83b7\u5f97\u7684\u8bbe\u7f6e\u7ec4 * @param array $excludes \u4e0d\u9700\u8981\u83b7\u5f97\u7684\u8bbe\u7f6e\u7ec4 * * @return array *\/ function get_settings($groups=null, $excludes=null) \u90a3\u4e48shop_config\u91cc\u7684\u6570\u503c\u662f\u4ec0\u4e48\u65f6\u5019\u751f\u6210\u7684\u5462\uff1f\u8fd9\u4e2a\u662f\u5b89\u88c5\u521d\u59cb\u5316\u7684\u65f6\u5019\u5199\u5165\u5230\u6570\u636e\u5e93\u91cc\u7684\uff0c\u6240\u4ee5\u63a5\u4e0b\u6765\u6253\u5f00shop_config\u8868\uff0c\u5f88\u5bb9\u6613\u627e\u5230code\u4e3amin_goods_amount\u7684value\u4e3a10\u3002 parent_id\u5bf9\u5e94\u7684\u5c31\u662fget_settings\u51fd\u6570\u91cc\u7684group\uff0c\u8d2d\u7269\u6d41\u7a0b\u662f\u7b2c4\u4e2a\u9879\u76ee\uff0c\u6240\u4ee5\u8fd9\u91cc\u662f4\uff1a \u7136\u540e\u6839\u636e\u4e0a\u6587\u63d0\u5230\u7684sql\u8bed\u53e5\uff0c\u57fa\u672c\u53ef\u4ee5\u5224\u5b9a\u6309id\u5927\u5c0f\u987a\u5e8f\u8bfb\u53d6\u8be5\u8868\u5185\u5bb9\uff0c\u7136\u540e\u5448\u73b0\u5728Ecshop\u540e\u53f0\u7684\u914d\u7f6e\u9009\u9879\u4e2d\uff0c\u5c1d\u8bd5\u5728\u8868\u91cc\u6700\u540e\u76f4\u63a5\u6dfb\u52a0\u4e00\u884c\u6570\u636e\uff1a \u53e6\u5916\u9700\u8981\u81ea\u884c\u8c03\u6574\u5bf9\u5e94\u7684\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6\/languages\/zh_cn\/admin\/shop_config.php\uff0c\u5bf9\u5e94\u4f4d\u7f6e\u6dfb\u52a0\u4e0b\u9762\u4e24\u884c\u3002 $_LANG[&#8216;cfg_name&#8217;][&#8216;max_goods_amount&#8217;] = &#8216;\u6700\u5927\u8d2d\u7269\u91d1\u989d&#8217;; $_LANG[&#8216;cfg_desc&#8217;][&#8216;max_goods_amount&#8217;] = &#8216;\u4f4e\u4e8e\u6b64\u8d2d\u7269\u91d1\u989d\uff0c\u624d\u80fd\u63d0\u4ea4\u8ba2\u5355\u3002&#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-59551","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59551","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=59551"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59551\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=59551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=59551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=59551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}