{"id":61029,"date":"2025-04-26T09:43:53","date_gmt":"2025-04-26T01:43:53","guid":{"rendered":"https:\/\/fwq.ai\/blog\/61029\/"},"modified":"2025-04-26T09:43:53","modified_gmt":"2025-04-26T01:43:53","slug":"zencart%e7%bb%99%e4%ba%a7%e5%93%81%e5%8f%82%e6%95%b0%e6%b7%bb%e5%8a%a0%e6%96%b0%e5%ad%97%e6%ae%b5","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/61029\/","title":{"rendered":"ZenCart\u7ed9\u4ea7\u54c1\u53c2\u6570\u6dfb\u52a0\u65b0\u5b57\u6bb5"},"content":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u600e\u4e48\u6837\u4e3aZenCart\u666e\u901a\u4ea7\u54c1\u6dfb\u52a0\u4e00\u4e2a\u65b0\u5c5e\u6027\u3002   1\u3001\u9996\u5148\u8003\u8651\u4f60\u8981\u6dfb\u52a0\u4e00\u4e2a\u4ec0\u4e48\u6837\u7684 \u5c5e\u6027\u5230\u4f60\u7684\u4ea7\u54c1\uff0c\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\u6dfb\u52a0\u4e24\u4e2a\u5c5e\u6027\uff1a[guarantee-time]\u548c[color]\u3002   &nbsp;   2\u3001\u5728\u6570\u636e\u5e93\u7ba1\u7406\u754c\u9762 \uff08\u5982:phpmyadmin\uff09\u4e2d\u627e\u5230\u8868[products]\uff0c\u6216\u8005\u8868\u7684\u524d\u7f00\u52a0[products]\uff0c\u4e3a\u8fd9\u4e2a\u8868\u6dfb\u52a0\u4e24\u4e2a\u5b57\u6bb5\uff1a [products_guarantee] \u548c[products_color] \uff1a   &nbsp;   &nbsp;   ALTERTABLE`zencart_products`ADD`products_guarantee`INTNOTNULL,ADD`products_color`VARCHAR( 32 )NOTNULL;   3\u3001\u7f16\u8f91\u6587\u4ef6 [collect_info.php](\u5728\u76ee\u5f55\/admin\/includes\/modules\/product\/\u4e0b)   \uff081\uff09\u5728\u6700\u5f00\u59cb\u7684\u5730\u65b9\u6709\u4e00 \u4e2a\u53d8\u91cf\u53c2\u6570\u8bbe\u7f6e\uff0c\u6dfb\u52a0\u4f60\u7684\u5b57\u6bb5\u5230\u5b83\u4eec\u7684\u6700\u540e\uff1a   &nbsp;   &nbsp;   &#8216;products_guarantee&#8217;=&gt;&#8217;0&#8217;,&#8217;products_color&#8217;=&gt;&#8221;);   \uff082\uff09 \u5728\u4e0b\u8fb9\u6709\u4e00\u4e2a\u6570\u636e\u5e93\u67e5\u8be2\uff1a   &nbsp;   &nbsp;   set[$product = $db-&gt;Execute(&#8220;&#8230;]   \u6dfb\u52a0\u4f60\u7684\u5b57\u6bb5\u5728 [from &#8230;] \u90e8\u5206\u7684\u524d\u8fb9\uff0c\u5e76\u4e14\u5b57\u6bb5\u524d\u6dfb\u52a0\uff1a   &nbsp;   &nbsp;   select &#8230;&#8230;., p.products_guarantee, p.products_color from &#8230;.   \uff083\uff09\u73b0\u5728\u6dfb\u52a0\u8f93\u5165\u6846\u5230\u4ea7\u54c1\u8868\u5355\u4e2d(\u5728450\u884c\u9644\u8fd1\uff0c\u5177\u4f53\u4f4d\u7f6e\u81ea\u5df1 \u770b\u60c5\u51b5\u5b9a):   &nbsp;   &nbsp;   &nbsp;   &lt;tr&gt;   &lt;tdclass =main&gt;Guarantee Time (in months)   &lt;\/tdclass&gt;&lt;tdclass =main&gt;&lt; ?phpecho zen_draw_separator(&#8216;pixel_trans.gif&#8217;, &#8217;24&#8217;, &#8217;15&#8217;) . &#8216; &#8216; . zen_draw_input_field(&#8216;products_guarantee&#8217;, $pInfo-&gt;products_guarantee, zen_set_field_length(TABLE_PRODUCTS, &#8216;products_guarantee&#8217;)); ?&gt;   &lt;\/tdclass&gt;&lt;\/tr&gt;   &lt;tr&gt;   &lt;tdclass =main&gt;Color   &lt;\/tdclass&gt;&lt;tdclass =main&gt;&lt; ?phpecho zen_draw_separator(&#8216;pixel_trans.gif&#8217;, &#8217;24&#8217;, &#8217;15&#8217;) . &#8216; &#8216; . zen_draw_input_field(&#8216;products_color&#8217;, $pInfo-&gt;products_color, zen_set_field_length(TABLE_PRODUCTS, &#8216;products_color&#8217;)); ?&gt;   &lt;\/tdclass&gt;&lt;\/tr&gt;   \u5982\u679c\u662f\u7f16\u8f91\u5668\u7684\u8bdd\u9700\u8981\u5728adminincludesfunctionsgeneral.php\u6587\u4ef6\u91cc\u9762\u6dfb\u52a0\u4e00\u4e2a\u58f0\u660e   &nbsp;   4\u3001 \u7f16\u8f91\u6587\u4ef6 [preview_info.php] (\u5728\u76ee\u5f55 \/admin\/includes\/modules\/product\/\u4e0b)   \u5728\u7b2c10\u884c \u5de6\u53f3\uff0c\u627e\u5230\u53d8\u91cf[$product]\u7684\u5b9a\u4e49. \u50cf\u4e0a\u8fb93.2\u4e2d\u7684\u4e00\u6837\u6dfb\u52a0\u67e5\u8be2\u5b57\u6bb5\uff1a   &nbsp;   select&#8230;&#8230;., p.products_guarantee, p.products_colorfrom&#8230;.   5\u3001 \u7f16\u8f91 [update_product.php] (\u5728\u76ee\u5f55\/admin\/includes\/modules\/\u4e0b)   \u572820\u884c\u5de6\u53f3\u627e \u5230$sql_data_array\u53d8\u91cf\u90a3\u4e2a\u7684\u5b9a\u4e49. \u5728\u6700\u540e\u4e00\u884c\u7684[);] \u524d\u8fb9\u6dfb\u52a0\u65b0\u5b57\u6bb5.   &nbsp;   $sql_data_array= &#8230;&#8230;&#8230;.&#8217;products_guarantee&#8217;=&gt; zen_db_prepare_input($_POST[&#8216;products_guarantee&#8217;]),&#8217;products_color&#8217;=&gt; zen_db_prepare_input($_POST[&#8216;products_color&#8217;]) );   6\u3001 \u7f16\u8f91 [main_template_vars.php] (\u5728\u76ee\u5f55\/includes\/modules\/pages\/product_info\/\u4e0b)   \u5728 \u7b2c40\u884c\u5de6\u53f3\u627e\u5230\u53d8\u91cf[$sql]\u7684\u5b9a\u4e49\uff0c\u50cf3.2\u4e2d\u4e00\u6837\u6dfb\u52a0\u65b0\u5b57\u6bb5\u7684\u67e5\u8be2\uff1a   &nbsp;   &nbsp;   select&#8230;&#8230;., p.products_guarantee, p.products_colorfrom&#8230;.   7\u3001 \u6700\u540e\u4e00\u6b65\uff1a\u5728\u4ea7\u54c1\u4fe1\u606f\u4e2d\u663e\u793a\u3002   \u7f16\u8f91[tpl_product_info_display.php&#8217;](\u5728\u76ee\u5f55\/includes \/templates\/\u4f60\u7684\u6a21\u677f\/templates\/\u4e0b)   \u4f60\u53ef\u4ee5\u628a\u4e0b\u8fb9\u7684\u4ee3\u7801\u6dfb\u52a0\u5230\u4f60\u8ba4\u4e3a\u5408\u9002\u7684\u663e\u793a\u4f4d\u7f6e   &nbsp;   &nbsp;   &nbsp;   echo$product_info-&gt;fields[&#8216;products_guarantee&#8217;];   &nbsp;   echo$product_info-&gt;fields[&#8216;products_color&#8217;];   OK\uff0c\u5e0c\u671b\u4f60\u4e00\u5207\u987a\u5229\uff01  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u600e\u4e48\u6837\u4e3aZenCart\u666e\u901a\u4ea7\u54c1\u6dfb\u52a0\u4e00\u4e2a\u65b0\u5c5e\u6027\u3002 1\u3001\u9996\u5148\u8003\u8651\u4f60\u8981\u6dfb\u52a0\u4e00\u4e2a\u4ec0\u4e48\u6837\u7684 \u5c5e\u6027\u5230\u4f60\u7684\u4ea7\u54c1\uff0c\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\u6dfb\u52a0\u4e24\u4e2a\u5c5e\u6027\uff1a[guarantee-time]\u548c[color]\u3002 &nbsp; 2\u3001\u5728\u6570\u636e\u5e93\u7ba1\u7406\u754c\u9762 \uff08\u5982:phpmyadmin\uff09\u4e2d\u627e\u5230\u8868[products]\uff0c\u6216\u8005\u8868\u7684\u524d\u7f00\u52a0[products]\uff0c\u4e3a\u8fd9\u4e2a\u8868\u6dfb\u52a0\u4e24\u4e2a\u5b57\u6bb5\uff1a [products_guarantee] \u548c[products_color] \uff1a &nbsp; &nbsp; ALTERTABLE`zencart_products`ADD`products_guarantee`INTNOTNULL,ADD`products_color`VARCHAR( 32 )NOTNULL; 3\u3001\u7f16\u8f91\u6587\u4ef6 [collect_info.php](\u5728\u76ee\u5f55\/admin\/includes\/modules\/product\/\u4e0b) \uff081\uff09\u5728\u6700\u5f00\u59cb\u7684\u5730\u65b9\u6709\u4e00 \u4e2a\u53d8\u91cf\u53c2\u6570\u8bbe\u7f6e\uff0c\u6dfb\u52a0\u4f60\u7684\u5b57\u6bb5\u5230\u5b83\u4eec\u7684\u6700\u540e\uff1a &nbsp; &nbsp; &#8216;products_guarantee&#8217;=&gt;&#8217;0&#8217;,&#8217;products_color&#8217;=&gt;&#8221;); \uff082\uff09 \u5728\u4e0b\u8fb9\u6709\u4e00\u4e2a\u6570\u636e\u5e93\u67e5\u8be2\uff1a &nbsp; &nbsp; set[$product = $db-&gt;Execute(&#8220;&#8230;] \u6dfb\u52a0\u4f60\u7684\u5b57\u6bb5\u5728 [from &#8230;] \u90e8\u5206\u7684\u524d\u8fb9\uff0c\u5e76\u4e14\u5b57\u6bb5\u524d\u6dfb\u52a0\uff1a &nbsp; &nbsp; select &#8230;&#8230;., p.products_guarantee, p.products_color from &#8230;. \uff083\uff09\u73b0\u5728\u6dfb\u52a0\u8f93\u5165\u6846\u5230\u4ea7\u54c1\u8868\u5355\u4e2d(\u5728450\u884c\u9644\u8fd1\uff0c\u5177\u4f53\u4f4d\u7f6e\u81ea\u5df1 \u770b\u60c5\u51b5\u5b9a): &nbsp; &nbsp; &nbsp; &lt;tr&gt; &lt;tdclass =main&gt;Guarantee Time (in months) &lt;\/tdclass&gt;&lt;tdclass =main&gt;&lt; ?phpecho zen_draw_separator(&#8216;pixel_trans.gif&#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-61029","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61029","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=61029"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61029\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=61029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=61029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=61029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}