{"id":61009,"date":"2025-04-26T08:13:41","date_gmt":"2025-04-26T00:13:41","guid":{"rendered":"https:\/\/fwq.ai\/blog\/61009\/"},"modified":"2025-04-26T08:13:41","modified_gmt":"2025-04-26T00:13:41","slug":"zencart%e5%9c%a8pc%e4%b8%8e%e7%a7%bb%e5%8a%a8%e7%ab%af%e6%98%be%e7%a4%ba%e4%b8%8d%e5%90%8c%e7%9a%84%e6%94%af%e4%bb%98%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/61009\/","title":{"rendered":"zencart\u5728pc\u4e0e\u79fb\u52a8\u7aef\u663e\u793a\u4e0d\u540c\u7684\u652f\u4ed8\u65b9\u5f0f"},"content":{"rendered":"<p>\u9700\u6c42: zencart\u6839\u636e\u5728pc\u7aef \\ \u79fb\u52a8\u5e94\u7528\u7aef \\ \u79fb\u52a8\u7f51\u9875\u7aef , \u663e\u793a\u4e0d\u540c\u7684\u652f\u4ed8\u65b9\u5f0f:   &nbsp;   \u5728includes\/templates\/template_default\/templates\/\u4e0b\u4fee\u6539&nbsp;   tpl_checkout_payment_default.php\u6587\u4ef6, \u5148\u6839\u636e userAgent\u5224\u65ad\u662f\u5426\u662f\u79fb\u52a8\u5e94\u7528\u8bbf\u95ee , \u5728\u6839\u636e\u6761\u4ef6\u5224\u65ad\u662f\u5426\u663e\u793a\u652f\u4ed8\u9009\u9879:&nbsp;   1.\u4fee\u6539\u652f\u4ed8\u9009\u9879\u524d\u9762\u7684radiobuttion\u662f\u5426\u663e\u793a,\u5c06   &nbsp;   &lt;?php echo zen_draw_radio_field(&#8216;payment&#8217;, $selection[$i][&#8216;id&#8217;], ($selection[$i][&#8216;id&#8217;] == $_SESSION[&#8216;payment&#8217;] ? true : false), &#8216;id=&#8221;pmt-&#8216;.$selection[$i][&#8216;id&#8217;].'&#8221;&#8216;); ?&gt;   1   \u4fee\u6539\u4e3a:   &nbsp;   &lt;?php&nbsp;   if(strpos($_SERVER[&#8216;HTTP_USER_AGENT&#8217;],&#8217;FLAG_APP&#8217;) !== false){\/\/\u5982\u679c\u4e0d\u4e3afalse,\u8bf4\u660e\u662f\u79fb\u52a8\u5e94\u7528\u8bbf\u95ee   &nbsp; &nbsp; if ($selection[$i][&#8216;id&#8217;] == &#8216;alipaydirect&#8217;) {\/\/\u5982\u679c\u662falipayapp   &nbsp; &nbsp; \/\/\u4ec0\u4e48 \u90fd\u4e0d\u505a   &nbsp; &nbsp; }else if ($selection[$i][&#8216;id&#8217;] == &#8216;alipayapp&#8217;){\/\/\u5982\u679c\u662falipaydirect,\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4   &nbsp; &nbsp; &nbsp; &nbsp; echo zen_draw_radio_field(&#8216;payment&#8217;, $selection[$i][&#8216;id&#8217;], ($selection[$i][&#8216;id&#8217;] == $_SESSION[&#8216;payment&#8217;] ? true : false), &#8216;id=&#8221;pmt-&#8216;.$selection[$i][&#8216;id&#8217;].'&#8221; checked=&#8221;checked&#8221;&#8216;);   &nbsp; &nbsp; &nbsp;}else{   &nbsp; &nbsp; &nbsp; &nbsp; echo zen_draw_radio_field(&#8216;payment&#8217;, $selection[$i][&#8216;id&#8217;], ($selection[$i][&#8216;id&#8217;] == $_SESSION[&#8216;payment&#8217;] ? true : false), &#8216;id=&#8221;pmt-&#8216;.$selection[$i][&#8216;id&#8217;].'&#8221;&#8216;);&nbsp;   &nbsp; &nbsp; }   }else{   &nbsp; &nbsp; if ($selection[$i][&#8216;id&#8217;] == &#8216;alipayapp&#8217;) {\/\/\u5982\u679c\u662falipayapp   &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u4ec0\u4e48 \u90fd\u4e0d\u505a   &nbsp; &nbsp; }else if ($selection[$i][&#8216;id&#8217;] == &#8216;alipaydirect&#8217;){\/\/\u5982\u679c\u662falipaydirect,\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4   &nbsp; &nbsp; &nbsp; &nbsp; echo zen_draw_radio_field(&#8216;payment&#8217;, $selection[$i][&#8216;id&#8217;], ($selection[$i][&#8216;id&#8217;] == $_SESSION[&#8216;payment&#8217;] ? true : false), &#8216;id=&#8221;pmt-&#8216;.$selection[$i][&#8216;id&#8217;].'&#8221; checked=&#8221;checked&#8221;&#8216;);   &nbsp; &nbsp; }else{   &nbsp; &nbsp; &nbsp; &nbsp; echo zen_draw_radio_field(&#8216;payment&#8217;, $selection[$i][&#8216;id&#8217;], ($selection[$i][&#8216;id&#8217;] == $_SESSION[&#8216;payment&#8217;] ? true : false), &#8216;id=&#8221;pmt-&#8216;.$selection[$i][&#8216;id&#8217;].'&#8221;&#8216;);   &nbsp; &nbsp; }   }   ?&gt;   &nbsp;   \u4fee\u6539radiobuttion\u540e\u9762\u7684\u652f\u4ed8\u65b9\u5f0flogo\u548c\u6587\u5b57\u662f\u5426\u663e\u793a:&nbsp;   \u5c06:   &lt;label for=&#8221;pmt-&lt;?php echo $selection[$i][&#8216;id&#8217;]; ?&gt;&#8221; class=&#8221;radioButtonLabel&#8221;&gt;&lt;?php echo $selection[$i][&#8216;module&#8217;]; ?&gt;   &nbsp;   \u6539\u4e3a   &nbsp;   &lt;!&#8211; \u4e0b\u9762\u5224\u65adlable\u7684\u662f\u5224\u65ad\u662f\u5426\u663e\u793aalipaydirect\u7684\u56fe\u6807\u548c\u540d\u79f0 &nbsp;&#8211;&gt;   &lt;?php if(strpos($_SERVER[&#8216;HTTP_USER_AGENT&#8217;],&#8217;FLAG_APP&#8217;) !== false){\/\/\u5982\u679c\u4e0d\u4e3afalse,\u8bf4\u660e\u662f\u79fb\u52a8\u5e94\u7528\u8bbf\u95ee ?&gt;   &lt;label for=&#8221;pmt-&lt;?php if ($selection[$i][&#8216;id&#8217;] !== &#8216;alipaydirect&#8217;){ &nbsp;echo $selection[$i][&#8216;id&#8217;]; }?&gt;&#8221; class=&#8221;radioButtonLabel&#8221;&gt;&lt;?php &nbsp;if ($selection[$i][&#8216;id&#8217;] !== &#8216;alipaydirect&#8217;){ echo $selection[$i][&#8216;module&#8217;];} ?&gt;&lt;\/label&gt;   &lt;?php }else{?&gt;   &lt;label for=&#8221;pmt-&lt;?php if ($selection[$i][&#8216;id&#8217;] !== &#8216;alipayapp&#8217;){ &nbsp;echo $selection[$i][&#8216;id&#8217;]; }?&gt;&#8221; class=&#8221;radioButtonLabel&#8221;&gt;&lt;?php &nbsp;if ($selection[$i][&#8216;id&#8217;] !== &#8216;alipayapp&#8217;){ echo $selection[$i][&#8216;module&#8217;];} ?&gt;&lt;\/label&gt;   &lt;?php }?&gt;   &nbsp;   &nbsp;   \u6ce8:&nbsp;   1 . \u4ee5\u4e0a\u7684 selection[i][\u2018id\u2019] == \u2018alipaydirect\u2019 , \u91cc\u9762\u7684alipaydirect\u662f\u5173\u952e , \u5373\u652f\u4ed8\u65b9\u5f0f&nbsp;   \u53d6includes\\modules\\payment\\ \u6587\u4ef6\u5939\u4e0b\u76f8\u5e94\u901a\u9053\u63a5\u53e3\u6587\u4ef6\u540d\u5373\u53ef\u3002&nbsp;   \u5982 paypal.php\uff0calipayapp.php \u7684\u4e3a paypal\uff0calipayapp   &nbsp;   &lt;?php if ($selection[$i][&#8216;id&#8217;] == &#8216;paypal&#8217;) { ?&gt;   &nbsp;   &lt;?php if ($selection[$i][&#8216;id&#8217;] == &#8216;alipayapp&#8217;) { ?&gt;   &nbsp;   \u4ee5\u4e0a\u7684&nbsp;  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9700\u6c42: zencart\u6839\u636e\u5728pc\u7aef \\ \u79fb\u52a8\u5e94\u7528\u7aef \\ \u79fb\u52a8\u7f51\u9875\u7aef , \u663e\u793a\u4e0d\u540c\u7684\u652f\u4ed8\u65b9\u5f0f: &nbsp; \u5728includes\/templates\/template_default\/templates\/\u4e0b\u4fee\u6539&nbsp; tpl_checkout_payment_default.php\u6587\u4ef6, \u5148\u6839\u636e userAgent\u5224\u65ad\u662f\u5426\u662f\u79fb\u52a8\u5e94\u7528\u8bbf\u95ee , \u5728\u6839\u636e\u6761\u4ef6\u5224\u65ad\u662f\u5426\u663e\u793a\u652f\u4ed8\u9009\u9879:&nbsp; 1.\u4fee\u6539\u652f\u4ed8\u9009\u9879\u524d\u9762\u7684radiobuttion\u662f\u5426\u663e\u793a,\u5c06 &nbsp; &lt;?php echo zen_draw_radio_field(&#8216;payment&#8217;, $selection[$i][&#8216;id&#8217;], ($selection[$i][&#8216;id&#8217;] == $_SESSION[&#8216;payment&#8217;] ? true : false), &#8216;id=&#8221;pmt-&#8216;.$selection[$i][&#8216;id&#8217;].&#8217;&#8221;&#8216;); ?&gt; 1 \u4fee\u6539\u4e3a: &nbsp; &lt;?php&nbsp; if(strpos($_SERVER[&#8216;HTTP_USER_AGENT&#8217;],&#8217;FLAG_APP&#8217;) !== false){\/\/\u5982\u679c\u4e0d\u4e3afalse,\u8bf4\u660e\u662f\u79fb\u52a8\u5e94\u7528\u8bbf\u95ee &nbsp; &nbsp; if ($selection[$i][&#8216;id&#8217;] == &#8216;alipaydirect&#8217;) {\/\/\u5982\u679c\u662falipayapp &nbsp; &nbsp; \/\/\u4ec0\u4e48 \u90fd\u4e0d\u505a &nbsp; &nbsp; }else if ($selection[$i][&#8216;id&#8217;] == &#8216;alipayapp&#8217;){\/\/\u5982\u679c\u662falipaydirect,\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4 [&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-61009","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61009","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=61009"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61009\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=61009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=61009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=61009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}