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 MoreHow to Create a Simple Message Debugging Script for Your Website in PHP
Last Updated on Saturday, 23 June 2012 04:12 Written by Richi González Monday, 25 June 2012 12:00
Hello,
Whenever I am developing, I need to know where the script fails, what is currently doing, what values variables have, etc, therefore I always use a simple messages/errors script for debugging that will throw all the messages and errors to the top of the page.
Difficulty level: Easy
1. Create/Open a PHP file
2. Declare our variable $msg as an array
Learn More
Recent Comments