{"id":60968,"date":"2025-04-26T11:26:02","date_gmt":"2025-04-26T03:26:02","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60968\/"},"modified":"2025-04-26T11:26:02","modified_gmt":"2025-04-26T03:26:02","slug":"zencart%e5%88%86%e7%b1%bb%e9%a1%b5%e6%af%8f%e9%a1%b5%e6%98%be%e7%a4%ba%e4%ba%a7%e5%93%81%e6%95%b0%e9%87%8f%e8%87%aa%e5%ae%9a%e4%b9%89%e9%80%89%e6%8b%a9","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60968\/","title":{"rendered":"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9"},"content":{"rendered":"<p> zencart\u9ed8\u8ba4\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u662f\u56fa\u5b9a\u7684\uff0c\u5982\u4f55\u8ba9\u987e\u5ba2\u53ef\u4ee5\u9009\u62e9\u6bcf\u9875\u663e\u793a\u7684\u4ea7\u54c1\u7684\u6570\u91cf\u5462\uff1f<br \/> \u6548\u679c\u56fe<\/p>\n<p> \u65b9\u5f0f\u4e00\uff1a\u5168\u90e8\u5c55\u793a<br \/> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO530H0-36131.jpg\" class=\"aligncenter\" title=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe\" alt=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe\" \/><\/p>\n<p> &nbsp;<\/p>\n<p> \u65b9\u5f0f\u4e8c\uff1a\u4e0b\u62c9\u83dc\u5355<br \/> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO532Q0-4F93.jpg\" class=\"aligncenter\" title=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe1\" alt=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe1\" \/><\/p>\n<p> \u4fee\u6539\u65b9\u6cd5<\/p>\n<p> 1.\u5bfc\u5165sql<\/p>\n<pre>\r\nINSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function)\r\nVALUES\r\n(NULL, '\u4ea7\u54c1\u5217\u8868\u9875- \u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf', 'CUSTOM_PRODUCT_LISTING_NUMBER', '3,6,9', '\u793a\u4f8b 3,6,9 &lt;br \/&gt;\u6570\u5b57\u95f4\u7528\u82f1\u6587\u9017\u53f7\u9694\u5f00', 8, 2, NOW(), NOW(), NULL, NULL);<\/pre>\n<p> &nbsp;<\/p>\n<p> 2.\u540e\u53f0 \uff0d Configuration \uff0d Product Listing \uff0d \u4ea7\u54c1\u5217\u8868\u9875- \u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\uff0c\u586b\u5199\u53ef\u4f9b\u9009\u62e9\u7684\u6bcf\u9875\u4ea7\u54c1\u6570\u91cf\u3002<\/p>\n<p> 3.includes\\modules\\YOUR_TEMPLATE\\product_listing.php\u4e2d\uff0c\u67e5\u627e<\/p>\n<pre>\r\n$show_submit = zen_run_normal();<\/pre>\n<p> \u540e\u9762\u589e\u52a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO533R0-53461.gif\" class=\"aligncenter\" title=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" alt=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" \/>  <\/p>\n<pre>\r\n$allnum=$db-&gt;Execute($listing_sql);\r\nif(isset($_GET['pagesize']) &amp;&amp; (int) $_GET['pagesize'] &gt;0 &amp;&amp; (int) $_GET['pagesize'] &lt; 5000){\r\n    $pagenum=(int) $_GET['pagesize'];\r\n}elseif($_GET['pagesize']=='all'){\r\n    $pagenum=$allnum-&gt;RecordCount();\r\n}else{\r\n    $pagenum=MAX_DISPLAY_PRODUCTS_LISTING;\r\n}<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO533R0-53461.gif\" class=\"aligncenter\" title=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" alt=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" \/>   <\/p>\n<p> \u67e5\u627e<\/p>\n<pre>\r\n$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');<\/pre>\n<p> \u4fee\u6539\u4e3a<\/p>\n<pre>\r\n$listing_split = new splitPageResults($listing_sql, $pagenum, 'p.products_id', 'page');<\/pre>\n<p> 4.includes\\templates\\YOUR_TEMPLATE\\templates\\tpl_modules_product_listing.php\u4e2d\uff0c\u67e5\u627e<\/p>\n<pre>\r\n&lt;div id=\"productsListingTopNumber\" class=\"navSplitPagesResult back\"&gt;&lt;?php echo $listing_split-&gt;display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?&gt;&lt;\/div&gt;\r\n&lt;div id=\"productsListingListingTopLinks\" class=\"navSplitPagesLinks forward\"&gt;&lt;?php echo TEXT_RESULT_PAGE . ' ' . $listing_split-&gt;display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?&gt;&lt;\/div&gt;\r\n&lt;br class=\"clearBoth\" \/&gt;<\/pre>\n<p> \u5982\u679c\u4f7f\u7528\u5168\u90e8\u5c55\u793a\u65b9\u5f0f\uff0c\u5728\u5176\u540e\u589e\u52a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO533R0-53461.gif\" class=\"aligncenter\" title=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" alt=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" \/>  <\/p>\n<pre>\r\n&lt;?php\r\n        $perPage=$_GET['pagesize'];\r\n        $parameters = zen_get_all_get_params(array('page', 'info', 'x', 'y', 'pagesize'));\r\n        $perpage_links = '&lt;div class=\"perPage\"&gt;Items Per Page: ';\r\n        $array_perpage=explode(',',CUSTOM_PRODUCT_LISTING_NUMBER);\r\n        foreach($array_perpage as $value){\r\n        $perpage_links .= ($perPage!=$value) ? '&lt;a href=\"' . zen_href_link($_GET['main_page'], $parameters.'&amp;pagesize=' .$value, 'NONSSL') . '\"&gt;'.$value.'&lt;\/a&gt;' :$value;\r\n        $perpage_links .= ' | ';\r\n        }\r\n        $perpage_links .= ($perPage!='all') ? '&lt;a href=\"' . zen_href_link($_GET['main_page'], $parameters.'&amp;pagesize=all&amp;', 'NONSSL') . '\"&gt;All&lt;\/a&gt;' : 'ALL';\r\n        $perpage_links .= '&lt;\/div&gt;';\r\n        $parameters='';\r\n        echo $perpage_links;\r\n?&gt;<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO533R0-53461.gif\" class=\"aligncenter\" title=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" alt=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" \/>   <\/p>\n<p> \u5982\u679c\u4f7f\u7528\u4e0b\u62c9\u83dc\u5355\u65b9\u5f0f\uff0c\u5728\u5176\u540e\u589e\u52a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO533R0-53461.gif\" class=\"aligncenter\" title=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" alt=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" \/>  <\/p>\n<pre>\r\n&lt;?php\r\n        $perPage=$_GET['pagesize'];\r\n        $parameters = zen_get_all_get_params(array('page', 'info', 'x', 'y', 'pagesize'));\r\n        $perpage_links = '&lt;div class=\"perPage\"&gt;&lt;strong&gt;Show: &lt;\/strong&gt;';\r\n        $perpage_links .='&lt;select name=\"pagesize\" onchange=\"changePagesize(this);\"&gt;';\r\n        $array_perpage=explode(',',CUSTOM_PRODUCT_LISTING_NUMBER);\r\n        foreach($array_perpage as $value){\r\n            if($perPage==$value){\r\n                    $perpage_links .='&lt;option value=\"'.$value.'\" selected=\"selected\"&gt;'.$value.'&lt;\/option&gt;';\r\n            }else{\r\n                    $perpage_links .='&lt;option value=\"'.$value.'\"&gt;'.$value.'&lt;\/option&gt;';\r\n            }\r\n        }\r\n        if($perPage=='all'){\r\n            $perpage_links .='&lt;option value=\"all\" selected=\"selected\"&gt;All&lt;\/option&gt;';\r\n        }else{\r\n            $perpage_links .='&lt;option value=\"all\"&gt;All&lt;\/option&gt;';\r\n        }\r\n        $perpage_links .='&lt;\/select&gt;';\r\n        $perpage_links .= '&lt;\/div&gt;';\r\n        echo $perpage_links;\r\n?&gt;\r\n&lt;script language=\"javascript\"  type=\"text\/javascript\"&gt;\r\nfunction changePagesize(obj){\r\n            window.location.href= \"&lt;?php echo str_replace('amp;','',zen_href_link($_GET['main_page'], $parameters, 'NONSSL')) ?&gt;\"+ \"&amp;pagesize=\"+obj.value;\r\n}\r\n&lt;\/script&gt;<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/c160110\/14523AO533R0-53461.gif\" class=\"aligncenter\" title=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" alt=\"zencart\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u81ea\u5b9a\u4e49\u9009\u62e9\u63d2\u56fe2\" \/>   <\/p>\n<p> \u5927\u5bb6\u53ef\u4ee5\u6839\u636e\u4e0a\u9762\u7684\u601d\u8def\uff0c\u5199\u51fa\u66f4\u591a\u5982\u5546\u54c1\u6a2a\u7ad6\u6392\uff0c\u4ef7\u683c\u4ece\u9ad8\u5230\u4f4e\uff0c\u4ece\u4f4e\u5230\u9ad8\u7b49\u52a0\u5f3a\u7528\u6237\u4f53\u9a8c\u7684\u65b9\u6cd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>zencart\u9ed8\u8ba4\u5206\u7c7b\u9875\u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\u662f\u56fa\u5b9a\u7684\uff0c\u5982\u4f55\u8ba9\u987e\u5ba2\u53ef\u4ee5\u9009\u62e9\u6bcf\u9875\u663e\u793a\u7684\u4ea7\u54c1\u7684\u6570\u91cf\u5462\uff1f \u6548\u679c\u56fe \u65b9\u5f0f\u4e00\uff1a\u5168\u90e8\u5c55\u793a &nbsp; \u65b9\u5f0f\u4e8c\uff1a\u4e0b\u62c9\u83dc\u5355 \u4fee\u6539\u65b9\u6cd5 1.\u5bfc\u5165sql INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (NULL, &#8216;\u4ea7\u54c1\u5217\u8868\u9875- \u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf&#8217;, &#8216;CUSTOM_PRODUCT_LISTING_NUMBER&#8217;, &#8216;3,6,9&#8217;, &#8216;\u793a\u4f8b 3,6,9 &lt;br \/&gt;\u6570\u5b57\u95f4\u7528\u82f1\u6587\u9017\u53f7\u9694\u5f00&#8217;, 8, 2, NOW(), NOW(), NULL, NULL); &nbsp; 2.\u540e\u53f0 \uff0d Configuration \uff0d Product Listing \uff0d \u4ea7\u54c1\u5217\u8868\u9875- \u6bcf\u9875\u663e\u793a\u4ea7\u54c1\u6570\u91cf\uff0c\u586b\u5199\u53ef\u4f9b\u9009\u62e9\u7684\u6bcf\u9875\u4ea7\u54c1\u6570\u91cf\u3002 3.includes\\modules\\YOUR_TEMPLATE\\product_listing.php\u4e2d\uff0c\u67e5\u627e $show_submit = zen_run_normal(); \u540e\u9762\u589e\u52a0 $allnum=$db-&gt;Execute($listing_sql); if(isset($_GET[&#8216;pagesize&#8217;]) &amp;&amp; [&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-60968","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60968","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=60968"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60968\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}