OpenCart – Condensing Language Strings (Smart Coding)

Last Updated on Sunday, 3 March 2013 08:04 Written by Joe Stenhouse Wednesday, 6 March 2013 12:00

This article will be about one of the many tricks involved in writing clean condensed code when doing your own customizations within the Opencart framework. Since Opencart is an MVC-L there will be Language files involved if you are writing your own pages to echo on the front end. You should never hard code text directly into a .tpl (template file) because one “it is messy” and two it makes it difficult to track down and change later on whether it is you or the customer doing it. The first thing you do is create your own language file in the correct language directory. The easiest way to do that is to open up an existing file and just SAVE AS and rename it to that folder. This way you already have strings there you can just replace with your own so if we were looking in for example: catalog/language/english/account/account.php it would look like this:

Learn More

Search

Authors

Web Hosting

Linux Hosting
ASP .NET Hosting
Business Hosting
Reseller Hosting
E-Commerce Hosting
Dedicated Servers

Acceptable Use Policy
Terms of Service
Privacy Policy

Affiliate Program
Site Map

Blog Hosting

WordPress Hosting
ExpressionEngine Hosting
Movable Type Hosting
Habari Hosting
Textpattern Hosting


CMS Hosting

Joomla Hosting
Drupal Hosting
MODX Hosting
Concrete5 Hosting
Xoops Hosting
Shopping Cart Hosting

nopCommerce Hosting
OpenCart Hosting
Magento Hosting
osCommerce Hosting
Tomato Cart Hosting


Video Sharing Software Hosting

ClipBucket Hosting
ClipShare Hosting
osTube Hosting
vShare Hosting
MediaXXX Hosting
Forum Hosting

XenForo Hosting
vBulletin Hosting
MyBB Hosting
phpBB Hosting
Simple Machines Hosting


Social Network and Community Website Hosting

SocialEngine Hosting
Elgg Hosting
SkaDate Hosting
Dolphin Hosting
phpfox Hosting
Copyright © 2003-2013 Arvixe, LLC. All trademarks are property of their legal owner.