Thursday, January 19, 2017

Magento 1.9 Ajax Login with Social Connectors

We are using Magento 1.9 right now for one the project as Magento 2.0 has certain performance issue and some of the extensions are not yet available for Magento 2.0. In this project we have a requirement to add Ajax Login with Social connector options which includes, login with Facebook and Login with Google. Problem we faced is, there is no free extension available in market which allows both ajax login and give you social connector options. So what I did is I installed two different extensions for Ajax Login and Social Connectors and then merged code from social connector plugin to Ajax Login plugin.

In this blog I am going to explain how you can do this.

First of you have to install following two plugins in Magento.

GoMage Social Connector
Ajax Login

With the first login you will get social login options in admin where you can configure your social networks like Facebook and Google and add necessary information like App id and redirect URL etc.

Once it's configured in admin, you will get Social Connectors option in login page like this.

But we need this options in Ajax Login Popup.

So to do this we will copy code for GoMage Extension to this. To do this go to.


And open index.phtml file.

Add following code before buttons code.

<!-- Social Login -->
<a href="#" onclick="gomageSocialFBLogin();return false;" title="<?php echo $this->getText('facebook') ?>">
Login with Facebook

<a href="<?php echo $this->getUrl('gomage_social/google/login', array('_secure' => true, 'gs_url' => Mage::helper('core')->urlEncode(Mage::helper('core/url')->getCurrentUrl())));  ?>" title="<?php echo $this->getText('google') ?>">
Login with Google

That's it and now you will have social connector options in Ajax login.

I have just added basic designs, you can change it as per your requirements.

Wednesday, January 18, 2017

5 Things Programmers Don't Do or Hate to Do

I am a computer programmer and have been working in the IT industry since last 9 years. During this time I have realized many times that a programmer is mis interpreted by many who don't know exactly about programming and IT industry. There are certain myths in mind of non programmer persons that needs to be changed. This blog will explain 5 things that I have heard many times and I really hated to listen that. If you are a non IT person and reading this blog, just make sure next time you don't speak following things in front of computer programmer. If you are an IT person and reading this blog, just enjoy and and add a comment if you want to add something to this list.

Can you Fix my PC? Can you Fix my Windows?

This is the biggest mis understanding in mind of non IT people. They just believe that a computer programmer can repair any computer and can fix Windows. They can repair any part of computer including RAM and Hard disk and even Processor. Now this is a limit. How one programmer will know about hardwares? And hardwares like hard disk and processor is highly configured hardwares and need special environments and tools and skills to do that. It's not like open the CPU, take out hard disk, smashed hammers on it and done, it's repaired. Yes we can do small things like open CPU and adjust RAM and check for any loose connection and if that fixes the PC and then it's well and good. But beyond that we can not do anything. WE CAN NOT CREATE A COMPUTER

Same goes of operating system, if windows is corrupted or not working properly due to virus, a programmer can not fix it just like that. Operating system like windows are too much complex system and if its broken, it need to be repaired by expert who knows about it. Off course some programmers do know much about it and can fix the things but not all programmers can do it. So please spare us with this. 


Do You Develop Websites?

No all the programmers do not just make websites , there are so many fields and functions in IT industry like mobile app, desktop app, cloud development, server admin etc. And all the programmers will have their own specializations. Some of the programmers create mobile app, some are experts in creating desktop applications. And anyways, internet is not just about websites, there is much more and for each field and functions, there are programmers who are expert in it.

Type Without Looking At Keyboard and Type it Faster

Programming is not just about writing stories, where we just have to type characters and alphabets and just numbers. Every computer language has strict syntax to follow when writing code and creating programs. 

For example, there should be semi colon ( ; ) at end of each statement when you are using PHP language. When we are writing a code we uses lots of characters like

: colon
; semi colon
( ) [ ] { } all type of brackets
, comma etc.

So we have to look down and see if we are using correct character. And we can not type faster while writing a code as when we are writing a code, we also have to think if it's correct or not and make sure there is no error or syntax error. So 


Are You Writing Code All Nights?

Yes it's a fact that computer programmer works till late night or would like to work till late night but this is not usual scenario and we do not write code all nights. We are normal people and would like to rest like normal people do. We like to work till late night but not at a cost of our health and besides we are not machine that will work 24 hours a day with out any rest.

Do You Also Hack Computers?

A Big No, programmers are not hackers not even ethical hacking. Hacking needs good knowledge of computer hardwares and networks and not all programmers know about it. It needs some special skills and training to be a qualified ethical hackers. Yes some programmers do it for fun and out of curiosity but this is not something we do it regularly on day to day business. It's not our bread butter and besides hacking is illegal and none of the programmer would like to go on that way.

How To Be a Good Developer and Professional

Hello and welcome to third blog of the series "Freshers to Professional" blog. In case you missed previous blogs, you can read here.

Part 1 : Because All The Leaders Were Developers Once
Part 2 : Some of the Greatest Programmers of All Time

This blog is about self evaluation. After reading this blog, you will realize  if you have what it takes to be a great developer and if you are have not this symptoms ,you have to find out your Knack.

You Should Have Knack Of Technology.

According to definition in dictionary meaning of Knack is.

  • A special talent or skill, especially one difficult to explain or teach
  • A skilful, ingenious, or resourceful way of doing something
  • A particular talent or aptitude, esp an intuitive one
So yes you need to have special talent and clear aptitude and particular attitude to be a good developer. In short you should have Knack of Technology like Little Dilbert

So yes you should be like Little Dilbert to be a great software engineer.  You should have Knack of technology and if you don't have it then you have to find it or develop it. Next we will see some questions that you have to ask yourself and find out if you have that knack or not. 

Do you like sitting in front of computer for long time? 

This if the first and foremost requirement to be a developer. Because as a developer you have to sit in front of computer and write code of long time. As you will be given a task and deadline to complete it and you have to meet that deadline. So you have to sit for long time and complete it. Sometime you may have to skip lunch, tea or dinner, you should be ready for it. In short it will be your "RACE AGAINST TIME" and you have to win it.

 Do you like to learn new things?

This is another most crucial requirement to be a good developer. Your learning will not stop after your college course. If you think I have studied enough and I will not invest my time to learn something new, you are at the dead end of your career. Because technologies come and go. Nothing is permanent. What is hot technology today will be out of the market tomorrow and something new will come and if you are not willing to learn new thing, you will be out of the race. Take an examples of programming languages.

There was a time where developers were using languages like C, C++
Then comes Java.
Then comes VB.NET,
Then comes PHP

Earlier there was VB script, then we have JavaScript

Earlier there was Objective C and now we have Swift

Earlier there was no cloud computing, now we have Cloud Computing

So things are constantly changing and if you are not willing to except change then you can not be good developer so you have to learn new things and adopt and survive it.

Can you keep calm in worst condition?

Coding is an art that we have to do with calm and composed mind. You should not be short tempered. Because while coding you may have to face situation where no matter what you do error is not resolved, you are trying for hours to get something working and it's not working as expected, you are not getting proper output. In this situation if you loose you calm and get angry then it will get worse and you will never be able to solve your problem. Do you know one missing semi colon in code can create nightmare for you. In this situation you should not get angry and search for error. Debugging is the process which needs lots of patience. You have to debug step by step and it is real time consuming.

Sometime you may have to face situation like your work is over written due to mistake or it's rejected by your leader or client and he asked you do do it again. In this case you should not punch into face of your leader or client but KEEP CALM AND CODE ON.

Do you think twice before start working?

Whenever some task is assigned to you, you have to think twice and look for the best possible solution to achieve it. Don't just start working on it with first thought come up in mind. It may be possible that you end up with disaster and you have to redo everything. And at start of your career, you could be fired for not performing well and this can ruin your career. So be careful about it and think twice before you start working on it.

Do you listen to others?

It's about being team player. In your career hardly it will happen that you will be the only person working on the project, there is always a team and when you are working in team, you have to listen to others because everyone like to give opinion and you have to deal with it, It may be possible that you gave solution to some task but from your team someone else come up with better solution. so you have to listen to them and understand what your team members are trying to say. So be a good listener, keep your ego aside and be a good team player.

Do you communicate with others?

Communicate with others is as important as listening to others. That is again a quality of team player. Your team members should be aware of what you are doing and what problems you are facing. It's possible that your work is affecting someone else's work. You have to communicate with them and inform about it. Same way if you are working on someone else work then you to ask them first about it understand it and then work on it. This will lead to less errors.

Do you like Algorithms and Flow Charts?

Most of the course on software development includes algorithms and flow charts. When you are studying it you may find it worthless and waste of time but it's actually not a waste of time. Algorithms and Flow charts are key elements of development. When you will be working on any task you have to break down it to smaller tasks and setup the flow as per the domain you are working. For example if you are building online selling website then to place an order there is a flow like

Customer registered
Customer add billing and shipping address
Customer makes payment
If payment is successful, place an order else show error. 

so that's the flow and for that you have to make up a flow chart in your mind and code as the flow. 

Same way for the difficult task you have algorithm, which is nothing but a plan to solve the problem and you have to create that plan. If you don't like algorithms then you will not be able to solve complex problems.

Do you know how to search on Google?

In the era of internet and Google, there lots of websites and forums and blogs where developers like you and me write about the problems we are facing and others in the communities give solution to this.

So it's possible that problem you are facing is already faced by someone else and there is solution already but you have to search it and find it. For this you should know how to search effectively on Google and find out solution and save your time.

Do you consider worst outcome while coding?

This is one common problem I have seen in all the developers. When they are working on some tasks, they just consider the best outcome and assume that all the inputs will be available. But this is not the case always, you have to make sure that you consider worst scenario as well and handle it properly. Do not assume that you will have all the possible inputs. If you don't consider worst scenario there will be lots of problems.

Do you take responsibility of your work and do not blame others?

As I mentioned, it's team play and in the team whenever something goes wrong, blame game starts. Nobody would like to receive criticism and try to blame others when project failed. But as a good ethical developer, you have to accept your mistake and take responsibility of your work and be open about it. There is no shame in accepting your mistakes. 

If your answer is Yes to above all the questions that means you are going to be a good developer. If your answer is NO for some questions that means you need to improve in that area but if your answer is NO for all the questions, I am afraid that you are not qualified to be a developer.  Go for other career option.