{"id":60694,"date":"2025-04-26T08:23:27","date_gmt":"2025-04-26T00:23:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60694\/"},"modified":"2025-04-26T08:23:27","modified_gmt":"2025-04-26T00:23:27","slug":"%e5%a6%82%e4%bd%95%e8%ae%a9zencart%e7%9a%84%e4%ba%a7%e5%93%81%e9%a1%b5%e9%9d%a2%e6%98%be%e7%a4%ba%e5%90%8c%e7%b1%bb%e4%ba%a7%e5%93%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60694\/","title":{"rendered":"\u5982\u4f55\u8ba9zencart\u7684\u4ea7\u54c1\u9875\u9762\u663e\u793a\u540c\u7c7b\u4ea7\u54c1"},"content":{"rendered":"<p>\u5982\u4f55\u8ba9zencart\u7684\u4ea7\u54c1\u9875\u9762\u663e\u793a\u540c\u7c7b\u4ea7\u54c1\uff0c\u63d0\u4f9b\uff1a<\/p>\n<p>&nbsp;\u9996\u5148\u627e\u5230zencart\u6587\u4ef6\uff0c\u5728 includes\/templates\/\u4f60\u7684\u6a21\u677f\u76ee\u5f55\/templates\/\u4e0b\u9762\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6 \u547d\u540d\u4e3atpl_product_info_similar.php<\/p>\n<p> &nbsp; \u5f53\u7136\uff0c\u4e5f\u53ef\u4ee5\u968f\u4fbf\u547d\u540d\uff0c\u628a\u4ee5\u4e0b\u4ee3\u7801\u590d\u5236\u8fdb\u53bb\uff0c &lt;div class=&#8221;centerBoxWrapper&#8221; id=&#8221;similar_product&#8221;&gt; &lt;h2 class=&#8221;centerBoxHeading&#8221;&gt;Related Products&lt;\/h2&gt; &lt;ul&gt; &lt;?php $products_id = (int)$_GET[&#8216;products_id&#8217;];$flash_page_id_con = array(); $flash_page_images_con = array(); $flash_page_price_con = array(); $flash_page_name_con = array(); $flash_page_query = &#8220;select&nbsp; p.products_id,p.products_image,pd.products_name from &#8221; . TABLE_PRODUCTS .&#8221; p, &#8220;.&nbsp; TABLE_PRODUCTS_DESCRIPTION . &#8221; pd where p.`products_id`=pd.`products_id` AND&nbsp; pd.`language_id` = &#8216;&#8221; . (int)$_SESSION[&#8216;languages_id&#8217;] . &#8220;&#8216; AND p.`master_categories_id` =&nbsp; &#8221; . zen_get_products_category_id($products_id) . &#8221; ORDER BY rand() limit 12&#8243;; $flash_page = $db-&gt;Execute($flash_page_query); while(!$flash_page-&gt;EOF){ $flash_page_items[] = $flash_page-&gt;fields; $flash_page_id_con[] = $flash_page-&gt;fields[&#8216;products_id&#8217;]; $flash_page_images_src = is_int(strpos($flash_page-&gt;fields [&#8216;products_image&#8217;],&#8217;,&#8217;))? substr($flash_page-&gt;fields[&#8216;products_image&#8217;],0,strpos ($flash_page-&gt;fields[&#8216;products_image&#8217;],&#8217;,&#8217;)):$flash_page-&gt;fields[&#8216;products_image&#8217;]; $flash_page_images_con[] = &#8216;&#8221;&#8216;.(zen_not_null($flash_page-&gt;fields [&#8216;products_image&#8217;]) ? $flash_page_images_src : PRODUCTS_IMAGE_NO_IMAGE ).'&#8221;&#8216;; $flash_page_price_con[] = &#8216;&#8221;&#8216;.$currencies-&gt;display_price (zen_get_products_base_price($flash_page-&gt;fields[&#8216;products_id&#8217;]),zen_get_tax_rate ($product_check-&gt;fields[&#8216;products_tax_class_id&#8217;])).'&#8221;&#8216;; $flash_page_name_con[] = &#8216;&#8221;&#8216;.zen_output_string(zen_get_products_name ($flash_page-&gt;fields[&#8216;products_id&#8217;])).'&#8221;&#8216;; $flash_page-&gt;MoveNext(); } $flash_page_id = implode(&#8220;,&#8221;, $flash_page_id_con); $flash_page_images = implode(&#8220;,&#8221;, $flash_page_images_con); $flash_page_price = implode(&#8220;,&#8221;, $flash_page_price_con) $flash_page_name = implode(&#8220;,&#8221;, $flash_page_name_con); $flash_page_display_num = $flash_page-&gt;RecordCount(); ?&gt; &lt;?php for($i = 0; $i&lt; $flash_page_display_num ; $i++){?&gt; &lt;li id=&#8221;li&lt;?php echo $i;?&gt;&#8221; style=&#8221;display:block;float:left;padding- left:10px;width:160px; height:160px;&#8221;&gt; &lt;a href=&#8221;http:\/\/taoge167.blog.163.com\/blog\/&lt;?php echo zen_href_link(zen_get_info_page($flash_page_items[$i] [&#8216;products_id&#8217;]), &#8216;products_id=&#8217; . $flash_page_items[$i][&#8216;products_id&#8217;]);?&gt;&#8221;&gt;&lt;?php echo&nbsp; zen_image(DIR_WS_IMAGES . $flash_page_items[$i][&#8216;products_image&#8217;], $flash_page_items[$i] [&#8216;products_name&#8217;], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH,&nbsp; IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT); ?&gt;&lt;\/a&gt;&lt;p style=&#8221;text-align:center;&#8221;&gt;&lt;a href=&#8221;http:\/\/taoge167.blog.163.com\/blog\/&lt;?php&nbsp; echo zen_href_link(zen_get_info_page($flash_page_items[$i][&#8216;products_id&#8217;]), &#8216;products_id=&#8217;&nbsp; . $flash_page_items[$i][&#8216;products_id&#8217;]);?&gt;&#8221;&gt;&lt;?php echo $flash_page_items[$i] [&#8216;products_name&#8217;]; ?&gt;&lt;\/a&gt;&lt;br \/&gt;&lt;strong id=&#8221;cell_price&lt;?php echo $i?&gt;&#8221; class=&#8221;red&#8221;&gt;&lt;?php&nbsp; echo $currencies-&gt;display_price((zen_get_products_base_price($flash_page_items[$i] [&#8216;products_id&#8217;]) == 0 ? zen_get_products_sample_price($flash_page_items[$i] [&#8216;products_id&#8217;]): zen_get_products_base_price($flash_page_items[$i] [&#8216;products_id&#8217;])),zen_get_tax_rate($product_check-&gt;fields[&#8216;products_tax_class_id&#8217;])); ?&gt;&lt;\/strong&gt;&lt;\/p&gt; &lt;\/li&gt; &lt;?php \/\/print_r($flash_page_items[$i]); } ?&gt; &lt;\/ul&gt; &lt;\/div&gt; &lt;div style=&#8221;clear:both; height:1px;&#8221;\/&gt; \u7136\u540e\uff0c\u5728zen-cart\u6a21\u677f\u76ee\u5f55\u4e2d\u7684includes\/templates\/\u4f60\u7684\u6a21\u677f\u76ee\u5f55\/templates\/tpl_product_info_display.php \u4e2d \u4fee\u6539\u4e00\u4e9b\u5185\u5bb9 &nbsp; \u627e\u5230 &lt;!\u2013bof also purchased products module\u2013&gt; &lt;?php require($template-&gt;get_template_dir(&#8216;tpl_modules_also_purchased_products.php&#8217;, DIR_WS_TEMPLATE, $current_page_base,&#8217;templates&#8217;). &#8216;\/&#8217; . &#8216;tpl_modules_also_purchased_products.php&#8217;);?&gt; &lt;!\u2013eof also purchased products module\u2013&gt; \u5728\u4ed6\u7684\u540e\u9762\u6dfb\u52a0 &lt;!\u2013bof similar products\u2013&gt; &lt;?php require($template-&gt;get_template_dir(&#8216;tpl_product_info_similar.php&#8217;, DIR_WS_TEMPLATE, $current_page_base,&#8217;templates&#8217;). &#8216;\/&#8217; . &#8216;tpl_product_info_similar.php&#8217;);?&gt; &lt;!\u2013eof similar products\u2013&gt; \u8fd9\u6837\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u5728 \u4e2d\u7684\u4ea7\u54c1\u8be6\u7ec6\u9875\u663e\u793a\u540c\u7c7b\u7684\u4ea7\u54c1\uff0c\u4ee5\u589e\u52a0\u641c\u7d22\u5f15\u64ce\u6536\u5f55\uff0c\u6709\u76ca\u4e8ezencart\u7684seo\u4f18\u5316\u4e86\u3002 &nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u8ba9zencart\u7684\u4ea7\u54c1\u9875\u9762\u663e\u793a\u540c\u7c7b\u4ea7\u54c1\uff0c\u63d0\u4f9b\uff1a &nbsp;\u9996\u5148\u627e\u5230zencart\u6587\u4ef6\uff0c\u5728 includes\/templates\/\u4f60\u7684\u6a21\u677f\u76ee\u5f55\/templates\/\u4e0b\u9762\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6 \u547d\u540d\u4e3atpl_product_info_similar.php &nbsp; \u5f53\u7136\uff0c\u4e5f\u53ef\u4ee5\u968f\u4fbf\u547d\u540d\uff0c\u628a\u4ee5\u4e0b\u4ee3\u7801\u590d\u5236\u8fdb\u53bb\uff0c &lt;div class=&#8221;centerBoxWrapper&#8221; id=&#8221;similar_product&#8221;&gt; &lt;h2 class=&#8221;centerBoxHeading&#8221;&gt;Related Products&lt;\/h2&gt; &lt;ul&gt; &lt;?php $products_id = (int)$_GET[&#8216;products_id&#8217;];$flash_page_id_con = array(); $flash_page_images_con = array(); $flash_page_price_con = array(); $flash_page_name_con = array(); $flash_page_query = &#8220;select&nbsp; p.products_id,p.products_image,pd.products_name from &#8221; . TABLE_PRODUCTS .&#8221; p, &#8220;.&nbsp; TABLE_PRODUCTS_DESCRIPTION . &#8221; pd where p.`products_id`=pd.`products_id` AND&nbsp; pd.`language_id` = &#8216;&#8221; . (int)$_SESSION[&#8216;languages_id&#8217;] . &#8220;&#8216; AND p.`master_categories_id` [&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-60694","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60694","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=60694"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60694\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}