(Tutorial) Build Opencart Theme
(Tutorial) Build Opencart Theme
Documentation Screencasts Support General Support Community Forums Bug Tracker Contact Us Extensions Partners
Community Forums
Board index General FAQ & Tutorials Themes Change font size Print view Search FAQ Register Login
2 posts Page 1 of 1
catalog/view/theme/ |-> default |-> mytheme |-> image/*.* - copy all image |-> stylesheet/*.* - copy all stylesheet |-> template |-> common |-> header.tpl
i. ii. iii. iv. Note: We need to copy all the images because it's required by stylesheet.css. We need to copy IE stylesheet since it's declared on header.tpl (remove the file when you removing the IE style at header.tpl) We neet to copy slideshow.css and carousel.css since it's needed by opencart module. Rating star image is hard-coded into Page: category, manufacturer_info, product, review, search, special; Module: bestseller, featured, latest, special. It's up to you whether including those module and page to your theme and used another rating image, or just replacing use default rating star image.
2. 3. 4. 5.
Now open header.tpl with text editor. Search word default and replace with mytheme Refresh your frontpage, and everything should be the same as when you used the default theme. To get different visual like changing color etc, you can modificate mytheme/stylesheet/stylesheet.css
|-> manufacturer_list.tpl 2. To customizing template and work with the controller, you need to understand that opencart used push-based MVC model -CMIIW. In quick explanation: a. When you accessing route=product/category url, opencart call controller/product/category.php file. b. This controller (ex. category.php) will decide which MV-L: Model, View (tpl), language will be load. In category controller (category.php) load: i. 3 Model (category, product, image): $this->load->model('...'); ii. 2 View (category.tpl & not_found.tpl): $this->template = '...'; iii. 1 Language: $this->language->load('...') c. The controller also decide what data will be pushed into template and how user input will be processed. i. $this->$this->data['text_price'] = $this->language->get('text_price'); will produce Price in template: <?php echo text_price; ?> ii. When you change the product show (from 15 to 25) at frontpage, controller catch the request with if (isset($this->request->get['limit'])) { ... } then process it $this->data['limits'][] = array(... 'value' => 25, ...); 3. Remember that there is no fallback function for controller. If you modificate the controller file manually, it will be replaced when you upgrade the opencart. Instead modificate it manually, you can used vQmod to make "virtual modification". We will talk this on step 5.
|-> admin |-> catalog |-> download |-> image |-> system |-> vqmod 4. Go to your browser and access: http://localhost/yoursite/vqmod/install. You will see success message: vQmod has been installed on your system! 5. On the vQmod package, you will see folder docs and example to give you a refference how vQmod work. Here I will give you some quick refference: a. vQmod File is an .xml file stored at vqmod/xml folder. When executed, the vQmod force opencart to use the modification instead the default file (original file) and produce cache file at vqmod/vqcache. b. One vQmod File able to modificate multiple file; within one file, vQmod able to do multiple modificate operation. c. Example structure inside a vQmod File: <modification> <id>vQmod File ID</id> <version>1.0.0</version> --> vQmod File version <vqmver>1.0.8</vqmver> --> minimum vQmod version to work <author>your name</author> <file name="catalog/controller/product/category.php "> --> the file to modify <operation> <search position="replace"><![CDATA[ search this code and replace it with code bellow ]]></search> <add><![CDATA[ add this new code to replace code above ]]></add> </operation> <operation> <search position="after"><![CDATA[ search this code and add code bellow after it ]]></search> <add><![CDATA[ add this new code after code searched above ]]></add> </operation> </file> <file name="..."> <operation>
<search position="before"><![CDATA[ search this code and add code bellow before it ]]></search> <add><![CDATA[ add this new code before code searched above ]]></add> </operation> </file> </modification> My product: Opencart Blog Manager First Things First: Opencart Check List - Tips for Requesting Support - Tutorials Collection for 1.5.x Don't forget to add [SOLVED] to your Thread Title (first post), if your issue is solved.
qahar Posts: 1336 Joined: Tue Jun 29, 2010 2:24 pm Location: Indonesia Website Top
How to use include, require, include_once or require_once that support vQmod? If you use something like this on your theme: Code: Select all
include 'bla_bla.tpl';
vQmod will unable to modificate your included file. To make vQmod able modify the file, you should use the full path. Qphoria on this post suggest to use $vqmod->modCheck(): Example: Code: Select all
include('catalog/view/theme/<themename>/template/product/bla_bla.tpl');
My product: Opencart Blog Manager First Things First: Opencart Check List - Tips for Requesting Support - Tutorials Collection for 1.5.x Don't forget to add [SOLVED] to your Thread Title (first post), if your issue is solved.
qahar Posts: 1336 Joined: Tue Jun 29, 2010 2:24 pm Location: Indonesia Website
Top Display posts from previous: Post a reply 2 posts Page 1 of 1 Return to Themes Jump to: Sort by
Who is online
Users browsing this forum: No registered users and 5 guests Board index The team Delete all board cookies All times are UTC Powered by phpBB 2000, 2002, 2005, 2007 phpBB Group Copyright 2010 OpenCart - All rights reserved Home | Features | Demo | Download | Support | Extensions | Partners
Hosted by Arvixe Web Hosting.