Suppose we want to show similar products in product page without using opencart modules. In that case, create a new file named ‘similar_products.tpl’ and use it in the following way: (more…)
Archive for the ‘OpenCart’ Category
Opencart: Load multiple view files within a view template file
Posted: October 6, 2014 by Sankar Vijayakumar in OpenCart, PhpTags: blogging, coding, opencart, php, programmer, technology
Opencart: Vqmod tutorial
Posted: November 25, 2013 by Sankar Vijayakumar in OpenCart, PhpTags: blogging, coding, php, programmer, software, technology, vqmod
Vqmod stands for ‘Virtual Quick Mod‘, also known as ‘Virtual File modification System‘. It’s used to virtually alter any php or tpl file in OpenCart except the main index.php files. The changes are mentioned in xml files using search/add/replace tags and these files are parsed on page load. The original core files with the xml files’ code injected to it are then executed. The files with injected code can be viewed in vqmod/vqcache folder. Thus the core files are never touched and the opencart version upgrade can be done anytime.
Advantages of Vqmod:
- No need to edit the core files.
- Fallback to original sourcefiles in case of errors.
- Opencart version upgrade can be done easily by replacing core files.
- Website Performance never gets affected due to vqmod xml files.
How to install vqmod?
Opencart: Add bcc and cc in emails
Posted: August 6, 2013 by Sankar Vijayakumar in OpenCart, PhpTags: blogging, opencart, php, programmer, software, technology
How to add cc mails in opencart?
Here’s it, just 1 file needs to be modified:
system\library\mail.php
- After “protected $to;” add:
protected $cc;
- Below “public function setTo($to) {” function add: (more…)
Opencart: Add store based google analytics code
Posted: June 8, 2013 by Sankar Vijayakumar in OpenCart, PhpTags: blogging, google analytics, opencart, programmer, software, technology
Here’s it, just 3 files need to be modified:
-
admin\controller\setting\store.php
After “$this->data[‘entry_secure’] = $this->language->get(‘entry_secure’);” add:
$this->data['entry_google_analytics'] = $this->language->get('entry_google_analytics');Before “$this->template = ‘setting/store_form.tpl’;” add: (more…)
Use multiple databases in OpenCart
Posted: April 13, 2013 by Sankar Vijayakumar in OpenCartTags: blog, blogging, database, opencart, programmer, software, technology
- Config.php:
Add:
//New DB
define('NEWDB_DRIVER', 'mysql');
define('NEWDB_HOSTNAME', 'localhost');
define('NEWDB_USERNAME', 'root');
define('NEWDB_PASSWORD', 'password');
define('NEWDB_DATABASE', 'sitename_newdb');
define('NEWDB_PREFIX', 'ndb'); - Index.php:
Below the current database setup ($db = new DB(DB_DRIVER …) add: (more…)