{"id":620,"date":"2023-02-26T11:02:06","date_gmt":"2023-02-26T03:02:06","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=620"},"modified":"2023-04-29T20:17:51","modified_gmt":"2023-04-29T12:17:51","slug":"opencart-tips","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/26\/opencart-tips\/","title":{"rendered":"OpenCart\u6280\u5de7"},"content":{"rendered":"<h2>URL\u914d\u7f6e<\/h2>\n<p>\u914d\u7f6eStore URL\uff1a\u4fee\u6539config.php<br \/>\n\u914d\u7f6e\u7ba1\u7406URL\uff1a\u4fee\u6539admin\/config.php<\/p>\n<p><!-- more --><\/p>\n<h2>\u652f\u4ed8\u65b9\u5f0f\u914d\u7f6e<\/h2>\n<p>\u5982\u62a5\u9519\uff1a<\/p>\n<pre><code>Warning: No Payment options are available. Please contact us for assistance!<\/code><\/pre>\n<p>\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p>1\u3001\u5728 <code>Extensions<\/code> -&gt; <code>Payments<\/code> -&gt; \u4f7f\u80fd <code>Cash On Delivery<\/code> \u548c <code>Free Checkout<\/code><br \/>\n2\u3001\u6dfb\u52a0\u4e00\u4e2a\u5546\u54c1<\/p>\n<h2>OpenCart\u624b\u52a8\u5b89\u88c5\u63d2\u4ef6<\/h2>\n<p>vQmod (\u5168\u79f0 Virtual Quick Mod)\uff0c\u662f OpenCart \u7cfb\u7edf\u4e0a\u4e00\u4e2a\u53ef\u4ee5\u4ee5\u865a\u62df\u65b9\u5f0f\u4fee\u6539\u539f\u6587\u4ef6\u5185\u5bb9\u800c\u8bbe\u8ba1\u7684\u4e00\u4e2a\u63d2\u4ef6\u7cfb\u7edf\u3002<\/p>\n<p>OpenCart Export\/Import Tool\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.opencart.com\/index.php?route=marketplace\/extension\/info&amp;extension_id=17\">https:\/\/www.opencart.com\/index.php?route=marketplace\/extension\/info&#038;extension_id=17<\/a><\/p>\n<p>1\u3001FTP\u4e0a\u4f20admin\u548csystem\u5bf9\u5e94\u76ee\u5f55<br \/>\n2\u3001\u6839\u636e install.xml \u4fee\u6539\u76f8\u5e94\u6587\u4ef6\u5185\u5bb9\uff08vQmod\u8bed\u6cd5\uff09<br \/>\n3\u3001\u4fee\u6539\u6743\u9650\uff1a<code>System<\/code> -&gt; <code>Users<\/code> -&gt; <code>User Groups<\/code>\uff0c\u4fee\u6539 Administrator \u6743\u9650\uff0c\u5728 <code>Access Permission<\/code> \u548c <code>Modify Permission<\/code> \u4e2d\u52fe\u9009 <code>extension\/export_import<\/code><\/p>\n<blockquote>\n<p>\u6ce8\uff1a\u5982\u679c\u662fFTP\u5de5\u5177\u4e0a\u4f20\u7684\uff0c\u6309\u7167install.xml\u5185\u5bb9\u624b\u5de5\u66ff\u6362\u76f8\u5e94\u4ee3\u7801\uff1bOCMOD\u65b9\u5f0f\u7ba1\u7406\u540e\u53f0\u4e0a\u4f20\u7684\u76f4\u63a5\u5237\u65b0\u6269\u5c55\u4e0d\u9700\u8981\u624b\u5de5\u66ff\u6362\u4ee3\u7801<\/p>\n<\/blockquote>\n<h2>\u63d2\u4ef6\u914d\u7f6e\u6570\u636e\u5e93<\/h2>\n<p>\u8868\uff1aoc_setting<\/p>\n<h2>Twig\u6a21\u677f\u5f15\u64ce<\/h2>\n<p>Twig\u6a21\u677f\u5f15\u64ce\u7f13\u5b58\uff1a\u540e\u53f0\u9996\u9875\u53f3\u4e0a\u89d2\u6709\u4e2a\u201c\u8bbe\u7f6e\u201d\u56fe\u6807\uff0c\u5728\u201cComponent\u201d\u4e3a\u201cTheme\u201d\u884c\uff0c\u5728\u201cAction\u201d\u4e0b\u70b9\u51fb\u201c\u5237\u65b0\u201d\u56fe\u6807<\/p>\n<p>tpl\u6a21\u677f\u8f6ctwig\u6a21\u677f\uff1a\u6253\u5f00NotePad++\u641c\u7d22\u548c\u66ff\u6362\uff0c\u5f00\u542f\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f<\/p>\n<p>\u641c\u7d22\uff1a<code>&lt;\\?php\\secho\\s\\$(.*?);.*?&gt;<\/code><br \/>\n\u66ff\u6362\uff1a<code>{% raw %}{{ $1 }}{% endraw %}<\/code><\/p>\n<h2>\u8def\u7531\u53caController<\/h2>\n<p>catalog\/controller\/common\/home.php<\/p>\n<pre><code class=\"language-php\">class ControllerCommonHome extends Controller {\n  ...\n}<\/code><\/pre>\n<p>\u8bbf\u95ee\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/www.xxx.com\/index.php?route=common\/home\">http:\/\/www.xxx.com\/index.php?route=common\/home<\/a><\/p>\n<h2>\u5916\u90e8\u8bbf\u95ee\u8def\u7531<\/h2>\n<p>\u5916\u90e8\u8bf7\u6c42\u8def\u7531\u4e0d\u7ba1\u662fGET\u8fd8\u662fPOST\u65b9\u5f0f\u662f\u83b7\u53d6\u4e0d\u5230\u5ba2\u6237\u767b\u9646\u4fe1\u606f\u7684\uff0csession\u4e5f\u662f\u72ec\u7acb\u7684<\/p>\n<pre><code class=\"language-php\">\/\/file_put_contents(&quot;\/data\/www\/opencart\/log.txt&quot;, &#039;customer_id: &#039; . $this-&gt;customer-&gt;getId() . &quot;\\n&quot;, FILE_APPEND);\necho &#039;customer_id: &#039; . $this-&gt;customer-&gt;getId();\necho &#039;session_id: &#039; . $this-&gt;session-&gt;getId();<\/code><\/pre>\n<p>\u7f51\u9875\u7ad9\u5185\u8bf7\u6c42\u7ed3\u679c\uff1a<\/p>\n<pre><code>customer_id: 1\nsession_id: ac13f95b26e9fa0717393c37e3<\/code><\/pre>\n<p>\u5916\u90e8\u8bf7\u6c42\u7ed3\u679c\uff1a<\/p>\n<pre><code>customer_id: \nsession_id: 5f97bda23f24d1d629ce35b7d1<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>URL\u914d\u7f6e \u914d\u7f6eStore URL\uff1a\u4fee\u6539config.php \u914d\u7f6e\u7ba1\u7406URL\uff1a\u4fee\u6539admin\/config.p [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[173],"tags":[],"class_list":["post-620","post","type-post","status-publish","format-standard","hentry","category-opencart"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=620"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/620\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}