{"id":61003,"date":"2025-04-26T12:18:59","date_gmt":"2025-04-26T04:18:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/61003\/"},"modified":"2025-04-26T12:18:59","modified_gmt":"2025-04-26T04:18:59","slug":"zencart%e9%80%9a%e8%bf%87%e4%ba%a7%e5%93%81id-%e6%89%b9%e9%87%8f%e6%b7%bb%e5%8a%a0%e6%8e%a8%e8%8d%90%e4%ba%a7%e5%93%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/61003\/","title":{"rendered":"zencart\u901a\u8fc7\u4ea7\u54c1id \u6279\u91cf\u6dfb\u52a0\u63a8\u8350\u4ea7\u54c1"},"content":{"rendered":"<p> 1.\u4fee\u6539 admin\/featured.php<\/p>\n<p> \u67e5\u627e pre_add_confirmation<\/p>\n<p> \u5c06 pre_add_confirmation \u4e0e&nbsp; break; \u4e4b\u95f4\u7684\u4ee3\u7801\uff0c\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u66ff\u6362\u5373\u53ef<br \/> &nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO524Y0-2D33.gif\" class=\"aligncenter\" title=\"zencart\u901a\u8fc7\u4ea7\u54c1id \u6279\u91cf\u6dfb\u52a0\u63a8\u8350\u4ea7\u54c1\u63d2\u56fe\" alt=\"zencart\u901a\u8fc7\u4ea7\u54c1id \u6279\u91cf\u6dfb\u52a0\u63a8\u8350\u4ea7\u54c1\u63d2\u56fe\" \/>  <\/p>\n<pre>\r\n&lt;?php\r\n \r\n case 'pre_add_confirmation':\r\n      \/\/ check for blank or existing featured\r\n\r\n        $pre_add_products_id=$_POST['pre_add_products_id'];\r\n        $pre_add_products_id2=explode(',',$pre_add_products_id);\r\n        foreach($pre_add_products_id2 as $key=&gt;$val) {\r\n            $sql = \"select products_id from \" . TABLE_PRODUCTS . \" where products_id='\" . (int)$val . \"'\";\r\n            $check_featured = $db-&gt;Execute($sql);\r\n            if ($check_featured-&gt;RecordCount() == 1) {\r\n                $sql = \"select products_id from \" . TABLE_FEATURED . \" where products_id='\" . (int)$val . \"'\";\r\n                $check_featured = $db-&gt;Execute($sql);\r\n                if ($check_featured-&gt;RecordCount() &lt; 1) {\r\n                    \/\/ add empty featured\r\n                    $featured_date_available = ((zen_db_prepare_input($_POST['start']) == '') ? '0001-01-01' : zen_date_raw($_POST['start']));\r\n                    $expires_date = ((zen_db_prepare_input($_POST['end']) == '') ? '0001-01-01' : zen_date_raw($_POST['end']));\r\n                    $products_id = zen_db_prepare_input($val);\r\n                    $db-&gt;Execute(\"insert into \" . TABLE_FEATURED . \" (products_id, featured_date_added, expires_date, status, featured_date_available)\r\n                        values ('\" . (int)$products_id . \"', now(), '\" . zen_db_input($expires_date) . \"', '1', '\" . zen_db_input($featured_date_available) . \"')\");\r\n                }\r\n            }     \r\n        }\r\n        break;\r\n?&gt;<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO524Y0-2D33.gif\" class=\"aligncenter\" title=\"zencart\u901a\u8fc7\u4ea7\u54c1id \u6279\u91cf\u6dfb\u52a0\u63a8\u8350\u4ea7\u54c1\u63d2\u56fe\" alt=\"zencart\u901a\u8fc7\u4ea7\u54c1id \u6279\u91cf\u6dfb\u52a0\u63a8\u8350\u4ea7\u54c1\u63d2\u56fe\" \/>   <\/p>\n<p> 2.admin\\includes\\functions\\general.php<\/p>\n<p> \u67e5\u627e \u51fd\u6570 zen_set_field_length<\/p>\n<p> \u5728\u8fd9\u4e2a\u51fd\u6570\u4e0b\u9762 \u589e\u52a0\u4ee5\u4e0b\u51fd\u6570\u5373\u53ef<br \/> &nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO524Y0-2D33.gif\" class=\"aligncenter\" title=\"zencart\u901a\u8fc7\u4ea7\u54c1id \u6279\u91cf\u6dfb\u52a0\u63a8\u8350\u4ea7\u54c1\u63d2\u56fe\" alt=\"zencart\u901a\u8fc7\u4ea7\u54c1id \u6279\u91cf\u6dfb\u52a0\u63a8\u8350\u4ea7\u54c1\u63d2\u56fe\" \/>  <\/p>\n<pre>\r\n  function zen_set_field_length_1000($max=50, $override=false) {\r\n    $field_length= 1000;\r\n    switch (true) {\r\n      case (($override == false and $field_length &gt; $max)):\r\n        $length= 'size = \"' . ($max+1) . '\" maxlength= \"' . $field_length . '\"';\r\n        break;\r\n      default:\r\n        $length= 'size = \"' . ($field_length+1) . '\" maxlength = \"' . $field_length . '\"';\r\n        break;\r\n    }\r\n    return $length;\r\n  }<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO524Y0-2D33.gif\" class=\"aligncenter\" title=\"zencart\u901a\u8fc7\u4ea7\u54c1id \u6279\u91cf\u6dfb\u52a0\u63a8\u8350\u4ea7\u54c1\u63d2\u56fe\" alt=\"zencart\u901a\u8fc7\u4ea7\u54c1id \u6279\u91cf\u6dfb\u52a0\u63a8\u8350\u4ea7\u54c1\u63d2\u56fe\" \/>   <\/p>\n<p> &nbsp;<\/p>\n<p> 3. \u505a\u5b8c\u4e0a\u97622\u6b65\u540e \u5c31\u53ef\u4ee5 \u901a\u8fc7\u540e\u53f0 Catalog &#8211;&gt; Featured Products &#8211;&gt; \u70b9\u51fb\u53f3\u8fb9\u7684 Product ID to be Manually Added as a Featured\u6309\u94ae<br \/> \u7136\u540e\u5728\u6587\u672c\u6846\u4e2d\u8f93\u5165\u4ea7\u54c1\u7684id, \u4ea7\u54c1id\u4e4b\u95f4\u7528\u82f1\u6587\u9017\u53f7\u9694\u5f00\uff0c\u5217\u5982 21,55,23,89<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u4fee\u6539 admin\/featured.php \u67e5\u627e pre_add_confirmation \u5c06 pre_add_confirmation \u4e0e&nbsp; break; \u4e4b\u95f4\u7684\u4ee3\u7801\uff0c\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u66ff\u6362\u5373\u53ef &nbsp; &lt;?php case &#8216;pre_add_confirmation&#8217;: \/\/ check for blank or existing featured $pre_add_products_id=$_POST[&#8216;pre_add_products_id&#8217;]; $pre_add_products_id2=explode(&#8216;,&#8217;,$pre_add_products_id); foreach($pre_add_products_id2 as $key=&gt;$val) { $sql = &#8220;select products_id from &#8221; . TABLE_PRODUCTS . &#8221; where products_id='&#8221; . (int)$val . &#8220;&#8216;&#8221;; $check_featured = $db-&gt;Execute($sql); if ($check_featured-&gt;RecordCount() == 1) { $sql = &#8220;select products_id 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-61003","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61003","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=61003"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61003\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=61003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=61003"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=61003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}