<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OpenCart &#8211; Larry的午茶時光</title>
	<atom:link href="https://blog.yuyansoftware.com.tw/category/php/opencart/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.yuyansoftware.com.tw</link>
	<description></description>
	<lastBuildDate>Sun, 27 Nov 2022 03:25:06 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.yuyansoftware.com.tw/wp-content/uploads/2022/10/favicon-45x45.png</url>
	<title>OpenCart &#8211; Larry的午茶時光</title>
	<link>https://blog.yuyansoftware.com.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>OpenCart 裝 ThemeGlobal Lite 時 slideshow 不見的問題</title>
		<link>https://blog.yuyansoftware.com.tw/2017/06/opencart-themeglobal-lite-slideshow/</link>
					<comments>https://blog.yuyansoftware.com.tw/2017/06/opencart-themeglobal-lite-slideshow/#respond</comments>
		
		<dc:creator><![CDATA[Larry]]></dc:creator>
		<pubDate>Sun, 18 Jun 2017 07:47:00 +0000</pubDate>
				<category><![CDATA[OpenCart]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://test234.yuyansoftware.com.tw/2017/06/18/opencart-%e8%a3%9d-themeglobal-lite-%e6%99%82-slideshow-%e4%b8%8d%e8%a6%8b%e7%9a%84%e5%95%8f%e9%a1%8c/</guid>

					<description><![CDATA[ThemeGlobal Lite 是 OpenCart market place 裡還算滿熱門的一個主題，前陣子拿來試用，但一直有 slideshow 出不來的問題，本篇記錄一下 trace 這問題的一些過程 (雖然最後發現是某處沒設定到  lol]]></description>
										<content:encoded><![CDATA[<p><a href="https://www.opencart.com/index.php?route=marketplace/extension/info&amp;extension_id=4554" target="_blank" rel="noopener noreferrer">https://www.opencart.com/index.php?route=marketplace/extension/info&amp;extension_id=4554</a></p>
<p>ThemeGlobal Lite 是 OpenCart market place 裡還算滿熱門的一個主題，前陣子拿來試用，但一直有 slideshow 出不來的問題，本篇記錄一下 trace 這問題的一些過程 (雖然最後發現是某處沒設定到  lol</p>
<p>(以下測試是依照最新版 OpenCart 2.3.0.2)</p>
<p>slideshow 的顯示是在 common/header.tpl, 找到</p>
<pre>&lt;?php $slideshow = $modules-&gt;getModules('slideshow'); ?&gt;
&lt;?php if(count($slideshow)) { 
</pre>
<p>以 header.tpl 來說，原因就是 $slideshow 是空的。$modules-&gt;getModules 的實作是在 catalog/view/theme/themegloballite/lib/module.php, Modules::getModules. 其中找到</p>
<pre>$module_data2 = $this-&gt;model_design_layout-&gt;getLayoutModules(
$layout_id, $module_position);
</pre>
<p>當 $module_position = &#8216;slideshow&#8217; 時，$module_data2 是空的。$this-&gt;model_design_layout-&gt;getLayoutModules 的實作是在 catalog/model/design/layout.php, ModelDesignLayout::getLayoutModules.</p>
<p>其中可以看到是在 DB table layout_module 沒有 position = &#8216;slideshow&#8217; 的項目。如果去看一下 table layout_module, 裡面 position 應該只有 content_top, content_bottom, column_left, column_right 這幾個值 (OpenCart 2.x 就是這樣切版的)，並沒有 slideshow.</p>
<p>到目前為止關於這問題解法的思考方向可以分為兩點：<br />
1) 想辦法在 layout position 裡加上 slideshow 這位置。但這會改到框架，而且破壞框架本身的設計安排。<br />
2) 更改 Modules::getModules 的實作, 讓這 function 可以跳過 layout position, 直接拿到 slideshow 模組。</p>
<p>最後發現 ThemeGlobal Lite 有自帶一個 TG ThemeGlobal Lite Revolution Slider 模組，要確定有安裝它，而且確定他的 Status 是 on, 而且裡面有加 slide. 如果安裝設定都正確的話，回到 Modules::getModules, 他會走標記為</p>
<p>// Old Opencart 1.5.6 Modules</p>
<p>的這一路 (即使目前 OpenCart 為 2.3)，最後 return slideshow 給 header.tpl</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.yuyansoftware.com.tw/2017/06/opencart-themeglobal-lite-slideshow/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[好文分享] Create a Custom Theme With OpenCart</title>
		<link>https://blog.yuyansoftware.com.tw/2017/05/create-custom-theme-with-opencart/</link>
		
		<dc:creator><![CDATA[Larry]]></dc:creator>
		<pubDate>Mon, 29 May 2017 08:30:00 +0000</pubDate>
				<category><![CDATA[OpenCart]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[好文記錄與分享]]></category>
		<guid isPermaLink="false">http://test234.yuyansoftware.com.tw/2017/05/29/%e5%a5%bd%e6%96%87%e5%88%86%e4%ba%ab-create-a-custom-theme-with-opencart/</guid>

					<description><![CDATA[可以看到 admin 底下沒有多墊 theme/default 這兩層。就這架構來看 catalog 是可以容納更多 theme 的前端檔案，如果你有裝其他 theme 的話，theme 資料夾底下除了 default, 還會有你裝的其他的 theme.]]></description>
										<content:encoded><![CDATA[<p><span style="color: #444444; font-size: large;"><b>Introduction</b></span><br />
<a href="https://code.tutsplus.com/tutorials/create-a-custom-theme-with-opencart-introduction--cms-21786" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://code.tutsplus.com/tutorials/create-a-custom-theme-with-opencart-introduction&#8211;cms-21786</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">(以下測試是依照最新版 OpenCart 2.3.0.2)</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">* 檔案結構上 view 底下是 theme 和 javascript. css, 圖, 和 html (tpl) 是放在 theme 底下。有點特殊的是 javascript 是獨立一個資料夾。</span><span style="font-size: large;">但是 admin 的 view 又不同：</span><br />
<span style="font-size: large;">catalog</span><br />
<span style="font-size: large;">&nbsp; &#8211; view</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &#8211; javascript</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &nbsp; &#8211; bootstrap</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &nbsp; &#8211; font-awesome</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &nbsp; &#8211; &#8230;.</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &#8211; theme</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &nbsp; &#8211; default</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &nbsp; &nbsp; &#8211; image</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &nbsp; &nbsp; &#8211; stylesheet</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &nbsp; &nbsp; &#8211; template</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">admin</span><br />
<span style="font-size: large;">&nbsp; &#8211; view</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &#8211; image</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &#8211; javascript</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &#8211; stylesheets</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &#8211; template</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">可以看到 admin 底下沒有多墊 theme/default 這兩層。就這架構來看 catalog 是可以容納更多 theme 的前端檔案，如果你有裝其他 theme 的話，theme 資料夾底下除了 default, 還會有你裝的其他的 theme.</span></p>
<p><a name="more"></a><span style="font-size: large;">* catalog/view/theme/default/template 底下的架構：</span><br />
<span style="font-size: large;">&#8211; common: 所有頁面的共用元件放在這邊, 例如 header.tpl, footer.tpl.</span><br />
<span style="font-size: large;">&#8211; error</span><br />
<span style="font-size: large;">&#8211; information</span><br />
<span style="font-size: large;">&#8211; module (OpenCart 2.3 是在&nbsp;</span><span style="font-size: large;">template/extension/module)</span><br />
<span style="font-size: large;"><br />
</span><span style="color: #444444; font-size: large;"><b>Part Two</b></span><br />
<a href="https://code.tutsplus.com/tutorials/create-a-custom-theme-with-opencart-part-two--cms-21865" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://code.tutsplus.com/tutorials/create-a-custom-theme-with-opencart-part-two&#8211;cms-21865</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">作者提到, 不管是新做前端介面或是更改預設介面, 都應該新增一個 theme</span><br />
<span style="font-size: large;">「In either case, I recommend creating a new custom theme instead of modifying the default theme files directly as it&#39;ll make the life easier during the version upgrade of the OpenCart.」</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">OpenCart 2.3 新增 theme 有點複雜 (與上面文章敘述不同), 請參考這篇文章</span><br />
<a href="http://undefined.gr/site/2016/10/09/custom-opencart-2-3-0-2-theme/" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">http://undefined.gr/site/2016/10/09/custom-opencart-2-3-0-2-theme/</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">1. 新增 catalog/view/theme/mytheme,</span><br />
<span style="font-size: large;">2. 新增 admin/controller/extension/theme/mytheme.php, 記得改 class name&nbsp;ControllerExtensionThemeMyTheme (這很重要)。取代 mytheme.php 裡的 &#8220;theme_default&#8221; 字串成 &#8220;mytheme&#8221;.</span><br />
<span style="font-size: large;">3. 新增&nbsp;admin/view/template/extension/theme/mytheme.tpl, 一樣取代 mytheme.tpl 裡的 &#8220;theme_default&#8221; 字串成 &#8220;mytheme&#8221;.</span><br />
<span style="font-size: large;">4. 新增 admin/language/en-gb/extension/theme/mytheme.php, 更改裡面的 $_[&#8216;heading_title&#8217;]&nbsp;成 &#8220;My Theme&#8221;.</span><br />
<span style="font-size: large;">5. 新增 catalog/view/theme/mytheme/image/mytheme.png</span><br />
<span style="font-size: large;">6. 到你的後台 Extensions -&gt; Extensions, 選擇 Theme, 應該會看到 &#8220;My Theme&#8221;, 點安裝，安裝完後編輯 &#8220;My Theme&#8221; 成 Enable, 資料夾指向 mytheme.</span><br />
<span style="font-size: large;">7. 到 System -&gt; Settings 就可以選擇你商店的 template 了。</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">回到 tutsplus 這篇文章, 將</span><br />
<span style="font-size: large;">catalog/view/theme/mycustomtheme/template/common/header.tpl 中的</span><br />
<span style="font-size: large;">&lt;link href=&#8221;catalog/view/theme/default/stylesheet/stylesheet.css&#8221; rel=&#8221;stylesheet&#8221;&gt;</span><br />
<span style="font-size: large;">改成</span><br />
<span style="font-size: large;">&lt;link href=&#8221;catalog/view/theme/mycustomtheme/stylesheet/stylesheet.css&#8221; rel=&#8221;stylesheet&#8221;&gt;</span><br />
<span style="font-size: large;"><br />
</span><span style="color: #444444; font-size: large;"><b>Part Three</b></span><br />
<a href="https://code.tutsplus.com/tutorials/create-a-custom-theme-with-opencart-part-three--cms-21890" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://code.tutsplus.com/tutorials/create-a-custom-theme-with-opencart-part-three&#8211;cms-21890</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">OpenCart 的切版是</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Content Top &nbsp; &nbsp; &nbsp;</span><br />
<span style="font-size: large;">Column Left &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Column Right</span><br />
<span style="font-size: large;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Content Bottom</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">程式端可以看 template/common/home.tpl, 就可以清楚的看出來 layout. 後台可以看 Design -&gt; Layouts, 裡面的 layout 設定也是依循 Column Left/Right, Content Top/Bottom, 其中的 $modules (例如在 content_top.tpl 裡面), 就是在 Design -&gt; Layouts 裡設定。</span><br />
<span style="font-size: large;"><br />
</span><span style="color: #444444; font-size: large;"><b>Part Four</b></span><br />
<a href="https://code.tutsplus.com/tutorials/create-a-custom-theme-with-opencart-part-four--cms-21932" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://code.tutsplus.com/tutorials/create-a-custom-theme-with-opencart-part-four&#8211;cms-21932</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">模組 assign 的方式 OpenCart 2.3 與這篇文章敘述的不同。以 2.3 來說，到 Extensions -&gt; Extensions, 選擇 Modules, 底下會列出所有已安裝的 module, 找到一個 module (例如 Slideshow), 點右邊 + 號，</span><span style="font-size: large;">可以生成一個實體。回到 Design -&gt; Layouts, 選擇一個頁面進入，就可以新增 Column Left/Right, Content Top/Bottom 模組實體。</span></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
