Open Cart 2.0 $this->model_checkout_order->getOrder() method does not convert cart total on multiple currency site
If you have multiple currency configured on your OpenCart 2.0 eCommerce application you will notice that order total is not being converted from the default currency to the other configured currencies. I won't say this is a bug but it works just fine in lower version of OpenCart.
Anyway, if you are in this dillemma, you would have to manually convert the total. Below is how your code currently looks like:
$orderinfo = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$data['ordertotal']…
UTC Server Date Timezone conversion on Browser
Got some issues converting date from the server to the timezone of the user viewing it. You can imagine displaying date and time from the server and the user can not see it interpreted in his/her own timezone. I solved this on a project and would like to share my solution so I can save someone from stress. Below is the javascript to use.
function timezoneConverter(mydate){
var d = new Date(mydate);
d.setUTCFullYear(d.getFullYear());
d.setUTCMonth(d.getMonth());
d.setUTCDate(d.getDate());
d.setUTCHours(d.getHours());
d.setUTCMinutes(d.getMinutes());
d.setUTCSeconds(d.getSeconds());
return…
[SOLVED] Call to undefined method PhalconMvcViewSimple::disable() - Phalcon 2.0.0
There is a little bug in Phalcon 2.0.0, trying to reference a method that does not exist again in View class. This method existed in version 1.3.4 but somehow was removed.
let dependencyInjector = this->getDI();
if !header {
let url = dependencyInjector->getShared("url"),
header = url->get(location);
}
if dependencyInjector->has("view") {
let view = dependencyInjector->getShared("view");
view->disable();
}
Whoever has removed…
How to get your Pascal Code to work on MacOX
A friend wanted me to help with some assignments on Pascal and it really got funny how I couldn't easily install the compiler on MacOx so I decided to put up some blog post for someone who would also like to do same.
You would need Xcode to be installed before FPC is installed. Visit Free Pascal (http://www.freepascal.org/download.var) and download the installation file. Double click on the .dmg and follow the prompt to install. It will be installed in /usr/local/bin.
The…
How to Successully Migrate your WooCommerce Store from Local/One Domain to another Domain/Remote Server
You can guess I have been doing more stuffs with WooCommerce. It is lovely working with a commerce system built into WordPress. I am not a wordpress person anyway but WooCommerce rocks. I think I should find some time to review Open Source Carts.
A friend asked me to help him move his WooCommerce store to another domain then it became clear to me that I have not had enough time with WordPress. I intentionally decided not to dive into WordPress despite all the buzz about it. Almost every…
Free Plugin to Customise Your WooCommerce Forms
One of the fom fields you want to disable on your WooCommerce srore is Post Code. I wonder why lots of stores keep this field on a Nigeria site. It is the little whistle blower that shows your application is either a whitelisted one or just an Open Source. Though there are other things that give hints about the source of an application, forms fields that are not needed shouldn't be part of the form presented to users. I have received several calls from different people asking for the post code…
Downgrading your Phalcon framework to a lower version - MacOX
Phalcon just moved to version 2.0 and getting information on how to downgrade your version of Phalcon on Mac is not easy to come by. I did this for a colleague and would like to share the steps to do this with anyone having this same challenge.
Downgrading your Phalcon version implies you would probably be building your Phalcon yourself. Follow the following steps below:
Regex for specific email domain - PHP
I ran into the issue of checking emails with regex to be sure it is only valid for a specific domain. I searched through the internet for hours without reasonable joy, so I decided to write mine. I am not sure how perfect this looks but it just works for what I needed it for.
If you have this same issue, below is the pattern I used.
/[_a-z0-9-]+(\.[_a-z0-9-]+)*@(?i)mydomain.com/
You can savely change "mydomain" to whatever you want.
I…
[SOLVED] Mod-Rewrite is not enabled - Phalcon
I ran into this funny error and almost got me pulling my hair. My development branch has been working so fine until I fixed a merge conflict on a branch and the whole story began.
Looking for so long into this probelm I realised that looking for how to enable your mod_rewrite is not the issue for me. The real issue is with the htaccess file. My virtual host configuration is pointing to the project root and htaccess file is not there.
In Phalcon,…
6 things you must not forget when integrating with GTPay
I had some interesting moment integrating GTBank payment gateway for a client recently. I wonder why so much have changed about the integration. It is funny you can't have a straight integration without escalating to GTBank support team; that is if you are lucky to talk to someone knowledgeable. The banks gateway have not been interesting because the support team have little knowledge of the platform.
I have created this blog post to help you with smooth integration, so you can do less…
[SOLVED] Dispatcher has detected a cyclic routing causing stability problems - Phalcon
I was recently working on a Phalcon project and came across this error "Dispatcher has detected a cyclic routing causing stability problems" while trying to restrict access to some controllers. Apparently this looks like an unending loop.
Doing some more research I saw this "If the dispatch loop makes more than 256 loops it throws this exception. Normally this is caused because the application continue making forwards over and over without exiting the dispatch loop. https://github.com/phalcon/cphalcon/blob/2.0.0/phalcon/dispatcher.zep#L378".
Here…
Reading CSV file with newline as delimiter - PHP
I got some issues working with a CSV file with newline delimeter. I want to read the file and be able to process the content. I was so confused what the deliter would look like. After solving this I decided to share with everyone who has this same problem. I guess this would save somebody some from sleepless night.
Below is the code that did the magic.
//CSV…
Git ignore file name change
I don't really think this worth bloging anyway but I would like to have it noted. I renamed a file and git was not tracking it. It shows nothing new to commit while my file name has changed from a small letter to capital. I guessed my file case must have been ignored.
If you have this same challenge, below is what saved me:
git config core.ignorecase false
Go to your terminal and type that. Git has a configuration setting that tells…
Who are the real money lenders; The Telecommunications or The Banks?
On our way for another meeting, Biyi asked the question again, “Who is the real money lender?” which struck yet another cord in me. I could vividly remember when Airtel started lending their customers airtime, it came at first as a magic of the millennium as this became a reality in Nigeria. I was truly amazed and I clapped for the success of this idea.You can't but applaud the Business development units that came up with such a great idea.
There are no doubts that, lots of intelligence…
The simplest explanation of Dependency Injection (DI)
Many friends have asked me what the concept of Dependency Injection is all about. I have explained this over and over so I decided to have it written so I would direct the next person that ask me to this post. New frameworks have pride this feature and they make it look like something totally new. Anyway, the name might be new but the concept is not #lol.
Dependency Injection is probably one of the most simple design pattern concept. And odds are you have probably already used it. But…
[SOLVED] beforeSave() model method not working in Phalcon
A friend found out there is what we can refer to as a little bug in Phalcon beforeSave() model method. Even though you override it, it still doesn't work. Let me use an example to describe this
class Car
{
public function beforeSave()
{
$engine = [];
// Create a Car first Engine
$engine[0] = new Engine();
$engine[0]->name = 'Toyota';
$this->engine = $engine;
}
}
$car = new Car;
$engine…
5 things you need to know when migrating your OpenCart Payment extension from 1.5.x to 2.0.x
I got a call from a friend requesting that I helped him port his OpenCart Payment extension/pluggin from 1.5.x to 2.0.x. It is funny there is rarely a place you can get information about migrating your OpenCart 1.5.x extenion to 2.0.x, so I deceided write one.
Here are five things you need to know or take note of when migrating your OpenCart Payment extension/plugin.
1. Change all $this->data[''] to $data[''] in your controllers.
2. From the admin…
[SOLVED] Phalcon Framework "fatal error: 'main/php.h' file not found" when creating extension from C source
I am trying to setup PHP Falcon framework on a MAC and ran into a little problem when creating the extension from C source.
After my git clone (git clone --depth=1 git://github.com/phalcon/cphalcon.git), changing directory to cphalcon/build and running sudo ./install gave an error:
/Users/
To solve this, follow the following steps:
1. MAMP…
10 Interesting Facts about Goodluck Ebele Jonathan's (GEJ) Facebook Fans Page
Recently, I got some brain waves to play around with Facebook API on some basic and in-depth analysis of how likes, shares and comments are related. These days, I don’t have so much time to do serious jobs so I would break down my analysis into 3 series; the basic analysis, sentiment analysis and the comparison analysis. I pray I would really have enough time to work on all the analysis.
I decided to choose Dr. Goodluck Ebele Jonathan's fans page as my sample…
Top 10 Nigerian Programmers I have worked with
This is one of my most anticipated articles this year because I had always wanted to list the top Nigerian programmers I have worked with. I am sorry if you have worked with me and you can’t find your name here, this would definitely be a continuous thing.
I have not made this list in the order of how good I perceive these potential Programming Generals; so I don’t expect anyone to take my views as represented in this article as any form of assessment. I have made the list in alphabetical…