Thursday, 29 September 2016

Fix API Issues on Opencart

For this tutorial, I will be showing you how to fix the problem 'Warning: Your IP is not allowed to access this API!' To fix this problem I will be using my opencart dashboard.

API Issue.

First, you will need to add you IP to your API, to do this you need to go on to your opencart dashboard. Click on settings on the left-hand panel, in the drop down menu click users and then API.

Dashboard - Settings [1] - Users [2] - API [3].

You need to add a new API (blue button with plus sign), there are three tabs but we will only be focusing on two:
General
  • API Name - Create a name to call your API (i have used my own name)
  • API Key - Under the large blank box is a blue button with the word generate, click this and the blank box will fill with the API Key.
  • Status - This needs to be enabled.
IP Addresses
  • IP - In this table you will need to add your IP address, click the add button and put your IP in the field provided. If you do not know your IP it will be showing in the box above the IP table.

If you refresh your dashboard the problem will still be showing, now you will need to access your settings (Dashboard - System - Settings).

Dashboard - System [1] - Settings [2].

Your store settings need editing, when you enter the settings there will be several tabs across the top of the page, you will need to click on the option tab. Scrolling through the options section you need to find checkout. Go to the bottom of the checkout section and find API User, in the box next to this option should be --- None --- , click on this and will show a drop down menu. In the drop down menu will be the API name that you created previously, select this. Save this change and you will not have the API issue again. 

Sam    



Wednesday, 28 September 2016

Change Homepage SEO URL Opencart

This tutorial will be showing you how to change your opencart store homepage SEO URL. For this, I will be using my open cart dashboard and my cPanel file manager.

Homepage URL.

Go on your opencart dashboard, on the left-hand panel find system, once you have clicked on system you will see a menu underneath and you will need to click on settings
Dashboard - System [1] - Setting [2].

Once in the settings you will see several tabs at the top of the screen, you will need to click on server. Under the section general, you will see an option called 'use SEO URL's' this will be set to no, it needs  to be changed to yes. Click save and that's all for the dashboard.


Now to access your cPanel File Manager, you need to find seo_url.php (public_html/catalog/controller/common/seo_url.php). This file needs editing, once open find the line return $link; (line 128), Above this line add $link = str_replace('index.php?route=common/home', '', $link);. Your file will now look like this:

return $url_info['scheme'] . '://' . $url_info['host'] . (isset($url_info['port']) ? ':' . $url_info['port'] : '') . str_replace('/index.php', '', $url_info['path']) . $url . $query;
} else {
$link = str_replace('index.php?route=common/home', '', $link);
return $link;

Save this, refresh your store page and the URL will have changed.

With the change
Sam.


Add Featured Products Opencart

This tutorial will show you how to add featured products to the home page on your opencart store. For this I will be using my opencart dashboard, you will need to access your modules this is found in the left-hand panel on your dashboard under extensions. 


Dashboard - Extensions [1] - Modules [2].

This will show you a module list, scroll down the list until you find the module name Featured > Home Page, click on edit (blue button with a pencil icon). To edit the featured module you will ned to change and add a few things:

  • Module Name: I changed this to featured products, you can change this to what you would like to change the name too. 
  • Products: Add the products that you would like to feature, to do this just type the name of the product into the product box, this will add it to the box below.
  • Limit: I left this at the default 5.
  • Width: I also left this as the default recommended, 200.
  • Height: I kept the default, 200. 
  • Status: Set this to enabled. 
Save this module. 

Featured Module.
Now the module is created you will need to add it to your homepage, to do this you need to go back to your opencart dashboard. On the left-hand panel click on design then on the drop down menu click layout.

Dashboard - Design [1] - Layout [2].
This will bring you to the layout list, scroll through the list until you find the layout name home, click on edit. There will be a few options:
  • Layout Name: Leave this as Home.
  • Store & Route: Leave this to what it is set at.
  • Module: This is what you will need to edit. Click on the add module (blue button with a plus sign). In the module section, click on the drop down box and find the module you have just made (featured > featured product). In the section position, you need to set the position you want it to be on your homepage (I have selected top). In the sort order column, I have set this to 1.  
Save the changes.

Layout.
Once you have done this check your store to make sure it has worked. Remember to back up your store.


Final Look.



Sam