Sections

HairStyles For Men

Long hair styles for men

Categories

  • Article
  • Fashion
  • Hairstyles
  • Health
  • Mumbai Schools
  • Puzzle
  • Uncategorized

How To Create A Custom Login Page For OpenCart Websites

Posted on February 7, 2017 by admin Leave a comment

Hello again everyone, in this OpenCart blog I will be looking at how to create a brand new customer login page for your OpenCart store.

The default login page for OpenCart has two major flaws which make it a nightmare for usability, SEO and common sense. By default the login link for your store will be something like “index.php?route=account/login” which is pretty shoddy so the first thing we would need to change is the URL to make it more standardised like www.[YOUR DOMAIN].com/login.

Setting up a new redirect to your custom OpenCart Login Page

Right, when you try to login to OpenCart the end result effectively boils down to one of two things: you either get redirected to your Account page or you will be redirected back to the login page. Since we have a custom login page, if your customer incorrectly enters their details and gets redirected back to the OpenCart default login page then it will make your site look pretty dodgy/confusing.

Open up:

  • catalog/controller/account/login.php

Go down to about line 162 where you will see the following code:

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/login.tpl')) {
$this->template = $this->config->get('config_template') . '/template/account/login.tpl';
} else {
$this->template = 'default/template/account/login.tpl';
}

What we need to do is define what happens when someone logs in incorrectly, in this case, send them back to our custom login page rather than reloading the default account login template file. So I have changed as below:

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/login.tpl')) {
//$this->template = $this->config->get('config_template') . '/template/account/login.tpl';
$this->redirect('http://[YOUR DOMAIN]/login/?login=0');
} else {
$this->redirect('http://[YOUR DOMAIN]/login/?login=0');
}

Make sure that you have the added parameter to the URL as this “login=0″ will be used in the next section when we show error messages.

Editing the Information Template for your new OpenCart Login Page

So, open up the information template of your theme:

  • catalog/view/theme/[YOUR THEME]/template/information/information.tpl

Then, at the top of your theme template file, just below the add this following block of code:

request->get['login'])) { ?>

request->get['login'] == "0" && $heading_title == "Customer Login") { ?>

No match, please enter your email address and password.

In this block of code, we are basically saying that if the Page Title equals = “Customer Login” and the “login=0″ parameter is in the URL then it is a customer who has failed to login correctly and has been redirected to this page by the code we entered in the previous section.

If you have chosen a different name for your login page then make sure that the second line above reflects your actual page name rather than what I chose. You can also customise the error message which appears by changing the third line in the code in between

.

And now we get to the fun part!

Designing your new custom OpenCart Login Page

Now, we have the hard coding part out of the way, if a customer incorrectly logs into your OpenCart store then they will now be redirected to this new information page which you’re using as a custom login page rather than the default template. Since information pages in OpenCart allow HTML input it means that you can design a huge range of visual login pages which you can tailor to your company’s branding and add some nice features.

Just go into the OpenCart admin area and create a new information page titled “Customer Login”, make sure the SEO keyword is “login” (without the quotation marks) and the checkbox is ticked which stops it showing up in the footer area. Then you’re free to design the page how you like, the only things which must stay the same as the default template is the form action and the names of the fields. Below is the very basic form which you must have on the page in order to allow customers to login:



 

I would encourage you to be as creative as you can, this is a good opportunity to take something which is usually pretty steadfast in OpenCart and mold it into something which represents your brand properly. As always let me know if you have any ideas, suggestions or improvements to this post on creating custom login pages for OpenCart.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Google+ (Opens in new window)

Like this:

Like Loading...

Related

Categories: Article

Tags: How To Create A Custom Login Page For OpenCart Websites

Leave a Reply Cancel reply

Tags

2015 about after american care chandigarh cultural dislikes fashion from hair haircut hairstyle hairstyles high history india indian international interview likes look make marathi marriage mumbai number part road school season style summer that this time wedding what when which with women working world! your
« Increasing Your OpenCart Store Security
Adding Facebook Comments To OpenCart Product Pages »

Search Here

Archives

  • February 2017
  • January 2017
  • December 2016
  • July 2016
  • June 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015

Latest Articles

  • How To Edit Or Remove The Continue Button From OpenCart Information Pages
  • How To SEO Your OpenCart Store For International Targeting
  • Changing The Default Product Availability Options In OpenCart
  • Adding Facebook Comments To OpenCart Product Pages
  • How To Create A Custom Login Page For OpenCart Websites
  • Increasing Your OpenCart Store Security
  • Editing The OpenCart Homepage Nivo Slider
  • How To Avoid Google’s Duplicate Content Penalties In eCommerce Search Pages
  • How To Customise The OpenCart Homepage For Branding, Conversions And SEO
  • How To Install An OpenCart Template
  • Adding Custom OpenCart Contact Forms For Quotes, Leads and Marketing
  • How To Create A Free Blogging Module With OpenCart
  • How To Redirect OpenCart Customers After Logging In And Logging Out
  • How To Set A New Font In OpenCart Using Google Fonts
  • How To Automatically Send Birthday Emails and Personal Coupons With OpenCart

Powered by WordPress and HeatMap AdAptive Theme

%d bloggers like this: