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 ‘Php’ 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…)
Typo3 + Php
Posted: September 8, 2012 by Sankar Vijayakumar in Php, Typo3Tags: check IP using Typoscript Php Javascript, disable cache in typo3 extension, php, php code to access values from typo3 ts template, php code to fetch extension manager configuration values, php code to get typoscript values, typo3, typo3 last executed query, typo3 locallang values using php, typo3 page storage folder page id in php, typo3 SQL-Query from exec_SELECTquery, typo3 version using php
Let’s check a few php codes related to typo3:-
-
Php code to fetch extension configuration values from extension manager configuration tab fields
$variable_name = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ext_name']); //returns an array.
Ext_name should be replaced with the extension key.
Sample code for getting the language keys given in lfeditor “viewlanguages” field: (more…)
How to get values of fields inside the Section of elements(sc)/Container for elements(co) in templavoila flexible content element (fce)?
Posted: August 3, 2012 by Sankar Vijayakumar in Php, Typo3Tags: container for elements fields, fce field templavoila and typoscript, fields inside the section of elements, templavoila fce fields, templavoila flexible content element, typo3, typoscript
First of all for those who are trying to find a method using typoscript please keep on trying until you’re sure that it’s not possible and for those who got a solution for this question using typoscript please send me or share it somewhere. Before solving this using an userfunction, I had a strong feeling that it’s possible via typoscript (like appending the values to a typoscript variable inside the section and use it outside the section of elements.) and I spend a whole day in search of a typoscript solution but didn’t succeed.
Just by referring the field name it’s possible to get the values of fields in the same level of an FCE. But the same way we can’t take the values of fields inside a “Section of elements” for the fields outside it. For this we can make use of an userfunction as shown below:
- Include the php file in the Setup section of TS template:
includeLibs.fce_values= fileadmin/templates/user_getFlexformFieldValue.php - Code in user_getFlexformFieldValue.php file (the same code that I used in my website – used for fetching the file names added via image field): (more…)