Home Blog

Building a Stronger AppSec Future: The Role of GitHub in Empowering Developers

As our world transforms into a digital space, application security has become the most crucial factor that businesses and individuals are concerned about. Data breaches and cyberattacks have increased, and hackers are always ready to exploit the vulnerabilities of technology; it is essential to ensure that applications are developed, designed, and deployed securely.

Developers now have to build applications that work efficiently and ensure they are secure from threats and attacks. This includes protecting applications from malicious activities by employing a range of processes, tools, and techniques such as penetration testing, code analysis, and secure coding practices. The primary aim of AppSec is to protect applications and data from threats and minimize the risk of security vulnerabilities.

The world of application security, or AppSec, is evolving quickly, and developers need tools to upkeep this pace. This is where GitHub comes in. GitHub is a web-based software development platform that manages code repositories and provides developers with various features and tools, such as GitHub code owners and code automation, to build robust and secure applications.

This article will explore the role of GitHub in empowering developers and creating a stronger AppSec future.

Why is GitHub Essential for AppSec?

GitHub has become an essential tool for developers, providing them with a range of valuable features, resources, and tools to build secure applications. It allows developers to manage their repositories from a central point. They can easily collaborate on code, track changes, and control code versions. This makes it easier for teams to work efficiently on complex group projects.

Moreover, it provides one of the best ways for developers to build secure web applications. For example, developers can use its built-in tools like code review, security templates, automation, and third-party tool integration to simplify the process. This also helps them identify vulnerabilities in their code, keep their dependencies up to date and put up adequate security measures in place. 

GitHub offers several benefits for AppSec, some of them are:

  1. Easy collaboration on complex projects.
  2. Robust security features to protect applications from attacks.
  3. Increased speed and efficiency by process automation.
  4. Access to a large community of developers and security experts to stay up-to-date on the latest AppSec trends.
  5. A wealth of knowledge and resources helping developers in building secure applications.

How Is GitHub Empowering Developers in Building a Stronger Application Security?

GitHub plays a significant role in building a stronger AppSec future. It is home to over 90 million developers and supports developers at every stage of their journey. From learning how to code to fulfilling the needs of a startup company, GitHub is dedicated to everyone. Its crowd-sourced security intelligence consisting of expert developers, security researchers, and academics from all over the world, contributes to increasing awareness and understanding.

This allows developers to have the latest security intelligence at hand. An article on GitHub showed that by updating 50% more vulnerable packages than in 2021, developers secured more than 18 million GitHub projects in 2022. GitHub is the best security solution due to its vast community and commitment to enhancing developer productivity. It has become an essential tool for developers as it possesses over 56 million repositories and hundreds of features, making it a key player in AppSec.

One fundamental way GitHub helps build secure applications is its code review process. With code review, developers can have other developers review their code to identify errors or potential vulnerabilities. GitHub provides various tools to support code review, including pull requests and code comments. These tools make it easy for developers to collaborate on code and ensure it is secure before deployment.

Another essential feature of GitHub when it comes to AppSec is the integration with a range of efficient security tools. In addition to its own security features, it lets you integrate third-party tools such as CodeQL and Dependabot for increased security checks. These third-party security tools help analyze the code and identify security issues in the applications.

Moreover, GitHub offers developers several security-related tools to aid in the development of highly secure apps. One of these features is GitHub Actions, which enables developers to accelerate the development of secure applications by automating processes. Moreover, GitHub gives developers access to many security templates, such as the Security Policy template, enabling them to quickly build safe and secure applications.

The Impact of GitHub on the Future of AppSec:

GitHub is shaping the future of AppSec by helping developers in creating secure applications quickly. It democratizes security by providing developers with a vast range of features, tools, educational resources, and a community of experts. This helps to break down the silos that have traditionally existed between development and security teams, empowering developers to take a more active role in AppSec.

It also promotes a culture of security by fostering a community of experts passionate about AppSec. It not only makes developers aware of the best practices of AppSec but also helps them understand the importance of application security.

As the GitHub platform continues to evolve and expand its security capabilities, it will likely play an even more significant role in shaping the future of AppSec.

How to build a free eCommerce website using Opencart 4 user manual in 2023

This Opencart user manual is for getting started with the Opencart online eCommerce website for 2022 for beginners, we are listing the best videos, blog posts, examples guides, tips, and tricks to run your Opencart shop successfully. We are showing both the frontend and backend management of Opencart.


In this opencart 3 user manual, we are showing how we can setup up an online eCommerce store with Opencart 3 for 2022. This is list of topics covering for the Opencart user manual

Get a domain name and hosting – We use onlydomains.com as we can get a domain name at $8 which is the cheapest that we found and for hosting you can use the google cloud which gives $300 for free or use another hosting as per your choice.

Install Opencart

In the above tutorial, we will show how to install Opencart and set up the custom URL with the virtual host.

Login into Opencart Administration

Go to http://YOURURL/admin, enter your username and password and you will be in the Administration section.

Opencart Administration

Admin user profile change in Opencart

In default Opencart installation the default user’s First Name and Last Name is John Doe so to change it just click in the John Doe on the top right corner and click the “Your Profile” then you can change the User details, we will show you how to change by going on System Users later.

user profile change in Opencart

Change as per your username. first name, last name, email, image, and password.


In the System section, we manage and enable global or system settings of the Opencart eCommerce store like users, localization, languages, statuses, length, weight classes, and many more.


All settings details of the Opencart are in the link below, which shows local settings, options, mail settings, and server settings.



To manage the users, user groups, access permission, modify permission, and API users in the Opencart check the following blog post:

User menu



In localization, we manage the local values of the stores like store locations, languages, currencies, stock statuses, order statuses, returns, countries, zones, geo sones, taxes, length classes, and weight classes.

Store location:

We can show multiple locations for each store so this is the section where we enter the store locations. Visit the blog below which shows how to add multiple stores and show it on the contact us page.



Opencart supports multi-language, so the languages section is to manages the languages for the store, by default it has the English language. We can upload a new language, add a new language, set a different default language than English, and create a new custom language pack for Opencart. Check the following two links for languages:




Go to admin >> System >> Localization >> Currencies where you will see the currencies available for use in the storefront. In the store by default is the US dollar. There are Euro, Pound, and US dollars. Go to the following post to learn all about the currencies in Opencart.


Stock Statuses

In Opencart 3 we can manage the stock statuses. For that go to admin >> System >> Localization >> Stock Statuses then you can enter the Stock Status Name. For detail go to the following post for stock statuses:


Order Statuses

In Opencart 3 we can manage the order statuses. For that go to admin >> System >> Localization >> Order Statuses then click “Add New” and you can enter the Order Status Name. For detail go to the blog post:


Returns (Return Statuses, Return Actions, and Return Reasons)

Opencart 3 has return functionalities by default. In this Opencart user manual, we are showing you how returns are managed and handled in Opencart 3 by the site administrator and customer. Read the following post for detail:


Countries and Zones:

You can manage countries and zones in Opencart.
Go to the blog post and learn more:


Geo Zones set up in Opencart

Zone Shipping is simply shipping that is based on the different destinations, or geo zones, based on the weight of the total order.


Taxes management in Opencart

We can manage and set up taxes with geocodes in OpenCart for each product.


Length Classes and Weight Classes management in Opencart

Opencart user manual where we are showing how we can manage length classes and weight classes. These lengths and weights are used by Shipping extensions like FedEx, UPS, etc, and will be used by Shipping API to calculate the shipping cost.


Maintenance (Backup/Restore, Uploads and Error Logs)

In this Opencart user manual, we are giving you details of the Maintenance links: Backup/Restore, Uploads, and Error logs.


Add categories and sub-categories in Opencart

The video shows steps to add categories and sub-categories in OpenCart.


Add products its options and attributes in Opencart 3

This video shows how to add products, their options, and attributes in Opencart, it shows physical products addition.


Add Manufacturers or Brands

We can add manufacturers and brands in Opencart and assign them to products and brands to have their own pages. The video shows to create the brands or manufacturers in Opencart:


Reviews management

Visitors or customers can give reviews to the product, the video below shows how we can manage the reviews in Opencart.


Add and change Information page, edit About us page and Add new Information page

We can add an information page, change it and edit the about us page, the video shows how we can do it.


Edit Contact us page and add a Google map in the contact us page

All the contact us page contents are handled from the settings, so if you have read the above settings posts then you can see how to change the contact addresses, phone numbers, and other stores. In the video below we show we can add google maps to the contact us page.


Add and manage Recurring profiles

If you are selling products where you can distribute the prices in installments then the recurring profiles are ways to set up, likewise we products with a subscription. See the video below, where it is described how to set up the recurring profiles.


Add filters

If your eCommerce site need filters then watch the video on how to set up in OpenCart


Manage extensions


Setup Marketplace



Manage Advertising


Manage Analytics

In this Opencart tutorial, you will learn how to add HTML in Opencart, similarly how to add google analytics, google tag manager, Adroll, Facebook pixels, MailChimp conversion code, google ads conversion in success page only, and other third-party JavaScript code in the Opencart, likewise our best way to manage the JavaScript code through google tag manager and test and preview in the google tag manager.


Manage Captchas in Opencart


Manage Dashboard


Manage Feeds


Manage Anti-Fraud


Manage Modules


Manage Payments


Manage Shippings


Manage themes


Manage Order Totals

See how Opencart Store credits works


Manage Modifications


Manage Events


Manage Layouts and Positions



Theme Editor


Language Editor


Manage Banners


Manage SEO URL




Sales and Manage Orders


Manage Returns


Manage Gift Vouchers


Customers, manage customers, customer groups and customer approvals

It is the same for Opencart 3 and Opencart 2.3


Affiliates management in Opencart


Manage Custom Fields


Marketing and Manage Marketing


Manage Coupons


Manage Mail


Reports, Who’s Online, and Statistics


We hope these lists of videos and blog posts will help you to start the Opencart shop and go deeper into it. Please don’t forget to post your questions or comments or errors so that we can help you. You can follow us at our Twitter account @rupaknpl. Subscribe to our YouTube channel for Opencart tutorials, and click to see all Opencart user manuals.

Opencart 4 and 3 API documentation for developer, Opencart API postman

Opencart API documentation for the developer: supports output formats that return a JSON response. Output formats are defined by specifying the output request parameter. With opencart API we can perform CRUD functionalities.

Opencart 4 API documentation

In Opencart 4 there are some changes on the API endpoints, here is the login API endpoint /index.php?route=api/account/login:

Here is the POSTMAN testing:


Here are the API username and API key in the Opencart admin.

Opencart API username key

IP Addresses to allow to access the Opencart API endpoints:

Opencart API IP addresses

If you are not using the master branch and using the Opencart then your endpoints may not work, and looking at the code there is a session of api_id that is checked and that session is not set. So there are some issues, so to make it work, we uncomment the following lines of code at catalog/controller/startup/api.php

namespace Opencart\Catalog\Controller\Startup;
class Api extends \Opencart\System\Engine\Controller {
	public function index(): object|null {
		if (isset($this->request->get['route'])) {
			$route = (string)$this->request->get['route'];
		} else {
			$route = '';
		// if (substr($route, 0, 4) == 'api/' && $route !== 'api/account/login' && !isset($this->session->data['api_id'])) {
		// 	return new \Opencart\System\Engine\Action('error/permission');
		// }
		return null;

Example of Opencart API call

Here is an example of an Opencart API call

$url = 'https://www.yourdomain.com/index.php?route=api/account/login&language=en-gb&store_id=0';
$request_data = [
	'username' => 'Default',
	'key'      => 'YOURSECRETKEY'

$curl = curl_init();

curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request_data);

$response = curl_exec($curl);

$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);


if ($status == 200) {
	$api_token = json_decode($response, true);

	if (isset($api_token['api_token'])) {

		// You can now store the session cookie as a var in the your current session or some of persistent storage
		$session_id = $api_token['api_token'];

$url = 'http://www.yourdomain.com/opencart-master/upload/index.php?route=api/sale/order.load&language=en-gb&store_id=0&order_id=1';

$curl = curl_init();

curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request_data);

// Add the session cookie so we don't have to login again.
curl_setopt($curl, CURLOPT_COOKIE, 'OCSESSID=' . $session_id);

$response = curl_exec($curl);


Opencart 3 API documentation

When we see API at Admin >> System >> Users >> API, then we are interested to explore it. We checked the catalog folder and found the image below:

Opencart API folder structure

All these tests are made in demo.webocreation.com. Checking the code we have to log in first. So we type the following URL but it gives me the following error.


<b>Notice</b>: Undefined index: key in <b>D:\xampp\htdocs\opencart2302\catalog\controller\api\login.php</b> on line <b>11</b>[]

Again we checked the code and found the following:

// Login with API Key
$api_info = $this->model_account_api->getApiByKey($this->request->post['key']);
if ($api_info) {

Which means we have to log in through the POST request. So we wrote the following curl code to log in through the POST URL.

We write the following code in opencartapi.php and upload it to webocreation.com root server:


$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://webocreation.com/index.php?route=api%2Flogin",
  CURLOPT_POSTFIELDS => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"key\"\r\n\r\nG63RZVjNnkPS3KdI8DZRrDph4LueZCRJcPwTfgnH8KzMFvVrsjp4g73YM1W3RdkTHRHyXK7c6vDVUsadxtx8c8r1uW2NWt0flPFNm5pVCq862jrBbrmztbBlPi4GWf9kQeB3YqT3uyOp7KldgRrvRu3eROSyGZZH2HEJ9sh9zSbXpm0u6wIOOdBoaNARzUOD74fHSn5iAYwCwPHeVkA29p3tkIPr8OFIzA9r3UGOXJ9xhWKojsGuKwnWEyaKuMB0\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--",
    "cache-control: no-cache",
    "content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
    "postman-token: dc6b20c6-b84d-3b12-3b89-e586d0058347"

$response = curl_exec($curl);
$err = curl_error($curl);


if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;


Below is the part of the code where you add your key that you have to change to yours:


Then I run http://telgap.com/opencartapi.php

{"error":{"ip":"Warning: Your IP **.**.**.** is not allowed to access this API!","key":"Warning: Incorrect API Key!"}}

I add my telgap.com IP at Admin >> Users >> API >> edit >> IP Addresses tab:

Whitelist IP in Opencart

After I add my IP and run the URL http://telgap.com/opencartapi.php again I got the successful message:

{"success":"Success: API session successfully started!","token":"kyJoxIKh9wEShzUxvBz2urUZSq"}

Following is the POSTMAN workout to achieve it.


I hope it will help somewhat to dig more about the OpenCart API.

You can check the following Opencart API-related posts:

Please let us know where and how are you using the Opencart API that you have used in eCommerce websites or have any questions or suggestions, please subscribe to our YouTube Channel and read more about Opencart 4 tutorial, opencart 3 tutorials, custom module theme development. You can also find us on Twitter and Facebook.

How to develop an Opencart 4.0.1 custom theme? OpenCart 4 theme development tutorial

As part of the Opencart 4 theme development tutorial, We already showed you how to install Opencart 4 theme and to create Opencart 4 custom theme admin section, in today’s tutorial, we are showing you how to develop the frontend section of the Opencart 4 custom theme. You can download the custom Opencart 4 theme here.

The final files and folders structure of the Opencart 4 custom theme looks like below:

opencart 4 custom theme

When we developed the backend code, we have added the Startup code like below:

Opencart 4 custom theme Startup Theme

Taking that into consideration, you need to create the following file at extension >> webocreation4 >> catalog >> controller >> startup >> theme_standard.php, once you create the file, you can use the following lines of code.

namespace Opencart\Catalog\Controller\Extension\webocreation4\Startup;

class ThemeStandard extends \Opencart\System\Engine\Controller
    public function index(): void
        if ($this->config->get('theme_theme_standard_status')) {
            $this->event->register('view/*/before', new \Opencart\System\Engine\Action('extension/webocreation4/startup/theme_standard|event'));

    public function event(string &$route, array &$args, mixed &$output): void
        $override = [

        if (in_array($route, $override)) {
            $route = 'extension/webocreation4/' . $route;

This overrides the header of the code, now, let’s create the header.twig at the extension folder, extension >> webocreation4 >> catalog >> view >> template >> common >> header.twig. Add the following lines of code:

<!DOCTYPE html>
<html dir="{{ direction }}" lang="{{ lang }}">
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>We are Here{{ title }}</title>
  <base href="{{ base }}"/>
  {% if description %}
    <meta name="description" content="{{ description }}"/>
  {% endif %}
  {% if keywords %}
    <meta name="keywords" content="{{ keywords }}"/>
  {% endif %}
  <script src="{{ jquery }}" type="text/javascript"></script>
  <link href="{{ bootstrap }}" type="text/css" rel="stylesheet" media="screen"/>
  <link href="{{ icons }}" type="text/css" rel="stylesheet"/>
  <link href="{{ stylesheet }}" type="text/css" rel="stylesheet"/>
  <link href="extension/webocreation4/catalog/view/stylesheet/stylesheet.css" type="text/css" rel="stylesheet"/>
  {% for style in styles %}
    <link href="{{ style.href }}" type="text/css" rel="{{ style.rel }}" media="{{ style.media }}"/>
  {% endfor %}
  {% for script in scripts %}
    <script src="{{ script }}" type="text/javascript"></script>
  {% endfor %}
  <script src="catalog/view/javascript/common.js" type="text/javascript"></script>
  {% for link in links %}
    <link href="{{ link.href }}" rel="{{ link.rel }}"/>
  {% endfor %}
  {% for analytic in analytics %}
    {{ analytic }}
  {% endfor %}
<nav id="top">
  <div id="alert" class="position-fixed top-0 end-0 p-3" style="z-index: 9999;"></div>
  <div class="container">
    <div class="nav float-start">
      <ul class="list-inline">
        <li class="list-inline-item">{{ currency }}</li>
        <li class="list-inline-item">{{ language }}</li>
    <div class="nav float-end">
      <ul class="list-inline">
        <li class="list-inline-item"><a href="{{ contact }}"><i class="fas fa-phone"></i></a> <span class="d-none d-md-inline">{{ telephone }}</span></li>
        <li class="list-inline-item">
          <div class="dropdown">
            <a href="{{ account }}" class="dropdown-toggle" data-bs-toggle="dropdown"><i class="fas fa-user"></i> <span class="d-none d-md-inline">{{ text_account }}</span> <i class="fas fa-caret-down"></i></a>
            <ul class="dropdown-menu dropdown-menu-right">
              {% if not logged %}
                <li><a href="{{ register }}" class="dropdown-item">{{ text_register }}</a></li>
                <li><a href="{{ login }}" class="dropdown-item">{{ text_login }}</a></li>
              {% else %}
                <li><a href="{{ account }}" class="dropdown-item">{{ text_account }}</a></li>
                <li><a href="{{ order }}" class="dropdown-item">{{ text_order }}</a></li>
                <li><a href="{{ transaction }}" class="dropdown-item">{{ text_transaction }}</a></li>
                <li><a href="{{ download }}" class="dropdown-item">{{ text_download }}</a></li>
                <li><a href="{{ logout }}" class="dropdown-item">{{ text_logout }}</a></li>
              {% endif %}
        <li class="list-inline-item"><a href="{{ wishlist }}" id="wishlist-total" title="{{ text_wishlist }}"><i class="fas fa-heart"></i> <span class="d-none d-md-inline">{{ text_wishlist }}</span></a></li>
        <li class="list-inline-item"><a href="{{ shopping_cart }}" title="{{ text_shopping_cart }}"><i class="fas fa-shopping-cart"></i> <span class="d-none d-md-inline">{{ text_shopping_cart }}</span></a></li>
        <li class="list-inline-item"><a href="{{ checkout }}" title="{{ text_checkout }}"><i class="fas fa-share"></i> <span class="d-none d-md-inline">{{ text_checkout }}</span></a></li>
  <div class="container">
    <div class="row">
      <div class="col-md-3 col-lg-4">
        <div id="logo">
          {% if logo %}
            <a href="{{ home }}"><img src="{{ logo }}" title="{{ name }}" alt="{{ name }}" class="img-fluid"/></a>
          {% else %}
            <h1><a href="{{ home }}">{{ name }}</a></h1>
          {% endif %}
      <div class="col-md-5">{{ search }}</div>
      <div id="header-cart" class="col-md-4 col-lg-3">{{ cart }}</div>
  {{ menu }}

The above code is similar to the default header code of the core Opencart code, one change is we add the custom stylesheet like below:

  <link href="extension/webocreation4/catalog/view/stylesheet/stylesheet.css" type="text/css" rel="stylesheet"/>

There are events to change the stylesheet but for now, we directly add the code like above. Now let’s create the stylesheet.css, extension >> webocreation4 >> catalog >> view >> stylesheet >>stylesheet.css. Paste the following code:

a {
  color: #f45511;
#menu {
  background-color: #f45511;
  background-image: linear-gradient(to bottom, #f45511, #f45511);
  background-repeat: repeat-x;
  border: 1px solid #f45511;
  border-color: #f45511;
  min-height: 40px;
  border-radius: 4px;

.btn-primary {
  color: #ffffff;
  text-shadow: none;
  background-image: linear-gradient(to bottom, #f45511, #f45511);
  background-repeat: repeat-x;
  border-color: #f45511;

With these codes, your custom Opencart 4 theme is ready, now you can add your CSS as per your requirement and make the website unique. Once it is active, it looks like the below, you can see the demo of the Opencart 4 custom theme

Opencart 4 custom themes

In this way, we complete a simple OpenCart 4 theme development tutorial, you can develop a new custom Opencart 4 theme and change the style, and show it on the front of Opencart 4. Hope you liked this article, please subscribe to our YouTube Channel for Opencart video tutorials. You can also find us on Webocreation Twitter and Webocreation Facebook. Please let us know if you have any questions or concerns.

Host LAMP stack in AWS Lightsail, Opencart hosting in AWS

In this hosting tutorial, we are looking into the AWS Lightsail LAMP stack, where we will host Opencart in AWS, and found out that there is no easy way to install it like WordPress or Magento even in AWS Lightsail, hope the Opencart package will be added soon, but for now, we need to use LAMP stack to host the Opencart in the AWS Lightsail. AWS Lightsail LAMP stack includes the latest versions of PHP 7+, Apache, and MySQL with phpMyAdmin and pre-configured components and PHP modules include FastCGI, ModSecurity, SQLite, Varnish, ImageMagick, xDebug, Xcache, OpenLDAP, Memcache, OAuth, PEAR, PECL, APC, GD, and cURL. All of the PHP modules and components needed for Opencart hosting are available in the LAMP stack of AWS Lightsail. 

Let’s get started with AWS LightSail

Go to https://aws.amazon.com/lightsail, and create an account or log in to your AWS account. The main AWS Lightsail dashboard page is separate from the main AWS dashboard. Or you can navigate from All services >> Compute >> Lightsail. It may look similar to the below screenshot.

AWS lightsail Dashboard

Create a LAMP Instance for Opencart hosting

In the Lightsail dashboard click the “Create Instance” button. You will see a page where you can select instance details:

Instance Location and Availability Zone: The location is auto-selected as per your geo-location but you can change it as per your hosting need. Mostly we used Virginia, Zone A (us-east-1) as our website visitors are mostly from the USA, it is upon your requirement and decides which location and Availability zone to choose.

Opencart cloud hosting

Platform instance image and Stack blueprint: We need linux/unix for the Opencart hosting so in “Select a platform” select the Linux/Unix. Then, in “Select a blueprint” select the LAMP (PHP 7)

Opencart Instance Image for AWS

SSH key pair and Automatic snapshots: Now go more below and you will see “Add launch script”, for now, we are not adding any script there. We will run scripts one by one in a command shell. If your account is new then create an SSH key pair else by default the key is selected. If you want to create something new then you can change it by clicking “Change SSH key pair”. Then check the checkbox for “Enable Automatic Snapshots” as this acts as a backup for you. If you don’t need backup then no need to check it. After you enable it, select the time you want to create the snapshot. We select 23:00 Coordinated Universal Time.

Backup setup and SSH key pair in AWS lightsail for Opencart

Choose your instance plan: For a start, for Linux/Unix-based instances, we can try the $3.50 USD Lightsail plan free for one month (up to 750 hours). Later, if we need to scale then we will scale by creating a new instance from the snapshots.

Choose your instance plan for Opencart

Identify your instance for Opencart: Now in the identify your instance, we entered the name as “Opencart_LAMP_PHP_7-2”, Key-only tags as Version1, and Key-value tags with Key as Framework and Value as Opencart. You can enter as per your need to identify your instance.

Opencart instance AWS

Now finally click the Create Instance button. It will take around 1 min to spin up your virtual machine with a LAMP stack. Then, you will see an instance in your dashboard like below:

Opencart Lamp stack

Now, click on it and you will get the details of that instance. You can see the buttons to stop and reboot. You can see the “Connect using SSH” button, Public IP and Username.

Opencart lamp instance detail

Click on the “Connect using SSH”, and you will see the command interface where you can enter your commands.

Console Command Interface Aws

Update system and PHP version in AWS lightsail

To ensure your system is up-to-date, you can run the following command:

sudo apt update -y

Check your PHP version by the following command as Opencart needs PHP version 7.3. If your PHP version is less the 7.3 than you need to upgrade to PHP 7.3+

php -v

If you are using the latest LAMP stack in AWS Lightsail then it is greater than PHP 7.4.

Opencart installation steps in the AWS Lightsail LAMP stack

Change the directory to /opt/bitnami/apache2/htdocs

cd /opt/bitnami/apache2/htdocs

When you do the ls command then you will see index.html which shows the Bitnami page. So, let’s remove it by the following command:

sudo rm index.html

Now, let’s retrieve the Opencart zip code by using wget. You can get the zip URL from the Github Opencart releases. We are using the zip link of Opencart as this is the latest version of Opencart now.

wget https://github.com/opencart/opencart/releases/download/

Let’s unzip the opencart- to backup/ folder

 unzip opencart- -d ./backup

Now, move all the files and folder at backup/upload as these are the Opencart files

 mv ./backup/upload/* .

Now, if you visit your Public IP, which is, then you will get a similar error to error no 1. So, let’s change the ownership of the files and folders to the daemon: daemon by running the following command:

sudo chown -R bitnami:daemon /opt/bitnami/apache2/htdocs/

If you want to be sure of files and folders permissions then you can run the following two commands as well:

sudo find . -type d -exec chmod 0755 {} \;
sudo find . -type f -exec chmod 0644 {} \; 

Now, see files and folders permission in AWS Lightsail for Opencart by running the command ls-lh

ls -lh

You will see the output below:

Files and Folder permission Opencart AWS

Now, if you go to public IP, then you will be able to see the first page of the Opencart installation.

Opencart Installation AWS

Create Static IP

You can start the installation but it is better to set up static IP. For that, go to the instance detail page, and in the “Networking” tab in the IP addresses section, click the button “Create static IP“.

Static IP for Opencart Instance AWS

A static IP is a fixed, public IP address that you can assign and reassign to your instances. In the Static IP location, you left it default. In the Attach to an instance, select your instance, we select “Opencart_LAMP_PHP_7-2”. In the Identify your static IP, just give a unique name.

Static IP Opencart

Now, your public IP as shown on the page, is Now open the IP in the browser then you will see step 1 of the Opencart installation page.

Create DNS Zone

As we are using an external domain registrar than Route 53 of AWS, so we need to create the DNS zone so we can add the NS1 and NS2 in the domain. Go to the Lightsail dashboard and go to the “Networking” tab. As we already set up Static IP, you will see a button to create a DNS zone, click the button “Create DNS zone”. Enter the domain you have registered, which is dpsignadvertising.com, enter the key-only tags and key-value tags as per your requirements else leave it blank.

DNS Zone setup AWS Opencart

Once you submit the “Create DNS zone” then you will get the Name Servers like the below:

Add record and name servers details for Opencart

Click “Add record”, then select A record, and enter @ in the subdomain in “Resolves to” select Static IP, our is “StaticIp-Opencart”, then click the green tick box. Similarly, again, click “Add record”, then select CNAME record, and enter www in the subdomain and in “Maps to” enter the domain name. URL, then click the green tick box.

Add Name servers to your domain registrar

Now open your domain registrar, our is onlydomains.com, in your domain change the Name Servers details like below and delegate to your AWS nameservers.

Domain name server change for Opencart URL

After some time go to your domain, for us, it took around 5min for DNS propagation, as we use dpsignadvertising.com for the domain so when we visit the dpsignadvertising.com, visit your URL and you will see the first page of the Opencart installation of the License agreement, click the “Continue” button.

In step 2, pre-installation steps, we see all green except the config files:

Opencart Pre Installation steps

So, we need to create the config.php files. You can use the following commands to change the config-dist.php to config.php

sudo mv config-dist.php config.php
sudo mv admin/config-dist.php admin/config.php 

Or, you can simply create the config.php files with the touch command:

sudo touch config.php admin/config.php

Now, change the ownership of config.php and admin/config.php

sudo chown daemon:daemon config.php admin/config.php

After the changes above, you can refresh the 2nd step of installation and click “Continue”. We reached the third step, where we need to enter the database and administration details.

Create a database, database user, and grant access

Let’s close your opened console command terminal and reconnect by clicking the “Connect using SSH” button so that you can open the new console command terminal. Then, run the command to get the root password.

cat bitnami_application_password
Get root password of Lightsail

The root password for us is bhV7CNgnVqBQ

Now, let’s run the following command to create the new database

mysql -u root -p

Then enter the above password. Then you entered it into the MySQL console.

Mysql Console

Let’s create a database, we are naming it “webocreationdb_2021”

CREATE DATABASE webocreationdb_2021;

Let’s create user “webocreationu12” with password ‘webocreation#123#dppass’ by running the command below:

CREATE USER 'webocreationu12'@'localhost' IDENTIFIED BY 'webocreation#123#dppass';

Let’s grant access to all for the user “webocreationu12” by running the command below:

GRANT ALL PRIVILEGES ON * . * TO 'webocreationu12'@'localhost';

Now, you can exit the database by typing the command exit;.


With all these, we are set for our database configuration.

  • DB Driver: Select MySQLi
  • Hostname: localhost
  • Username: webocreationu12
  • Password: webocreation#123#dppass
  • Database: webocreationdb_2021
  • Port: 3306
  • Prefix: oc_ or any as you need.
Database and Administration Configuration

You can enter the username and password for the administration

  • Username: admin (any)
  • Password: admin@2021 (any)
  • E-mail: info@webocreation.com (any)

Once, you entered all the details then click “Continue”.

In this 3rd step, you may see the blank page. So let’s debug the error. For that, let’s run the following command:

cd /opt/bitnami/apache2/htdocs/
sudo nano install/index.php

Then, in install/index.php, add the following lines of code.

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
Error Reporting PHP

After adding the code, exit the nano by clicking Ctrl + O and then Ctrl + X. After this let’s refresh step 3 http://dpsignadvertising.com/install/index.php?route=install/step_3, then you will see error 2. Let’s fix error 2.

 sudo nano install/cli_install.php

Then find the code $db->query(“SET @@session.sql_mode = ‘MYSQL40′”); and change to following:

$db-&gt;query("SET @@session.sql_mode = ''");

After the change, click Ctrl+O and Ctrl+X to exit the nano.

Similarly, do the same for install/model/install/install.php

sudo nano  install/model/install/install.php

Then find the code $db->query(“SET @@session.sql_mode = ‘MYSQL40′”); and change to following:

$db-&gt;query("SET @@session.sql_mode = ''");

After the change, click Ctrl+O and Ctrl+X to exit the nano.

Now, go and refresh the URL http://dpsignadvertising.com/install/index.php?route=install/step_3 and your Opencart installation is completed.

Installation CompleteOpencart

Now, let’s delete the install folder and other files and folders which are not needed.

sudo rm -rf install
sudo rm -rf backup
sudo rm opencart- 

With this Opencart installed, now let’s install the SSL certificate and implement the SEO URL for Opencart.

Install the free Let’s Encrypt Certificate

Install Certbot on your Lightsail instance by running the following commands:

sudo apt-get install software-properties-common -y
sudo apt-add-repository ppa:certbot/certbot -y
sudo apt-get update -y
sudo apt-get install certbot -y

Request a Let’s Encrypt SSL wildcard certificate by running the following commands, don’t forget to replace your domain where we use dpsignadvertising.com

sudo certbot -d $DOMAIN -d $WILDCARD --manual --preferred-challenges dns certonly
SSL Certificate Opencart

Before entering the Continue, you need to add the TXT record in the “Add record”. So, go to Lightsail dashboard >> Networking tab >> Click the DNS Zones for dpsignadvertising.com >> Click to Add record >> Select the TXT record >> in the Subdomain adds _acme-challenge >> in the “Responds with” add the value shown in console, ours is “XL1S8jJ9gNTUU1M7QxDBWv6_m5lC1Lf2YTE_I7iTnH4” and save it by clicking the green checkmark.

TXT record for acme challenge for SSL

Please wait for some time so that it propagates, after around 10 mins we click Continue in the Console.

Sometimes, it asks to add multiple TXT records. This must be set up in addition to the previous challenges; do not remove, replace, or undo the previous challenge tasks yet. Note that you might be asked to create multiple distinct TXT records with the same name. This is permitted by DNS standards.

Create links to the Let’s Encrypt certificate files in the Apache server directory by running the following commands:

sudo /opt/bitnami/ctlscript.sh stop
sudo mv /opt/bitnami/apache/conf/bitnami/certs/server.crt /opt/bitnami/apache/conf/bitnami/certs/server.crt.old
sudo mv /opt/bitnami/apache/conf/bitnami/certs/server.key /opt/bitnami/apache/conf/bitnami/certs/server.key.old
sudo ln -s /etc/letsencrypt/live/$DOMAIN/privkey.pem /opt/bitnami/apache/conf/bitnami/certs/server.key
sudo ln -s /etc/letsencrypt/live/$DOMAIN/fullchain.pem /opt/bitnami/apache/conf/bitnami/certs/server.crt
sudo /opt/bitnami/ctlscript.sh start

Configure HTTP to HTTPS redirection for your web application by running the following commands:

sudo vim /opt/bitnami/apache2/conf/bitnami/bitnami.conf

Add the following lines of code:

https redirect
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

After adding the code click the ESC key, and then enter:wq to save your changes, and quit Vim. Then restart the LAMP stack

sudo /opt/bitnami/ctlscript.sh restart

With these changes your SSL certificate is ready. Now you need to change a setting in Opencart admin and change the URL in the config.php and admin/config.php

cd /opt/bitnami/apache2/htdocs
sudo nano config.php

Change the define(‘HTTPS_SERVER’, ‘http://dpsignadvertising.com/’); to add https://

define('HTTPS_SERVER', 'https://dpsignadvertising.com/');

Exit it by pressing Ctrl + O to save and then enter, after that Ctrl + X to exit

Similarly, open admin/config.php and change the following to HTTPS://

define('HTTPS_SERVER', 'https://dpsignadvertising.com/admin/');
define('HTTPS_CATALOG', 'https://dpsignadvertising.com/');

Exit it by pressing Ctrl + O to save and then enter, after that Ctrl + X to exit.

Now go to https://dpsignadvertising.com/admin and System >> Settings >> Edit the store >> go to the Server tab >> in the security section select Yes for “Use SSL”. Then click Save.

SSL setting Opencart

With these steps, your SSL is activated for your domain.

Rename .htaccess.txt to .htaccess

Pull the .htaccess.txt of the Opencart and rename it to .htaccess

sudo wget https://raw.githubusercontent.com/opencart/opencart/master/upload/.htaccess.txt
sudo mv .htaccess.txt .htaccess

Read more about SEO friendly URL of Opencart

Activate the SEO URL

Once the .htaccess.txt is renamed to .htaccess, then we can activate the SEO URL at the admin. Go to admin >> System >> Settings >> Edit the Store >> Server tab >> Select Yes for “Use SEO URL”.

SEO URL Opencart

Read more for some best practices of Opencart SEO.

How to set up FileZilla SFTP in AWS Lightsail to transfer files?

In the Protocol field, you need to select SFTP – SSH File Transfer Protocol. The Host is your public IP. In Logon Type, you need to select the Key file. In the User field, you need to type bitnami. Finally in the Key file field, add the public key (where can you find the public key).

SFTP SSH setting for AWS

Then, click Connect button. You will get a list of folders, your code will be at htdocs.

SFTP AWS setup

PHPMyadmin access

Download the Lightsail SSH public key and change its permission to 0644 and make a tunnel to connect to PHPmyadmin. First, run the following command. Change the path of the key as per yours.

sudo chmod 0644 '/Applications/MAMP/htdocs/webocreation-bk/LightsailDefaultKey-us-east-1.pem'
sudo ssh -N -L 8888: -i /Applications/MAMP/htdocs/webocreation-bk/LightsailDefaultKey-us-east-1.pem bitnami@

Then, go to and you will be able to log in to the PHPMyadmin. The username is the root and you can get the password by running the following command the first time you logged in:

Where can you find the SSH public key in AWS Lightsail?

To get your SSH public key in AWS Lightsail, go to the top menu “Account“, then click on the SSH Keys tab, where you can see the lists of keys as per your region. Download the key as per your region. (How to find the region key pair of your EC2 instance?)

Find SSH key in AWS

How to find the region key pair of your EC2 instance?

Click on the instance and go to Connect tab, then at the bottom, it shows which key pair is used for this instance.

You configured this instance to use default (us-east-1) key pair.
Find AWS instance key pair

How to upgrade to a higher Lightsail package?

To upgrade your Lightsail plan to a larger instance, take a snapshot and then create a larger instance from the snapshot.

New Instances from Snapshots

Setup CDN Content Distribution in AWS

Go to Lightsail dashboard >> Networking tab >> Click the “Create distribution” button >> Then, in Choose your origin, select your Instance

CDN setup AWS

You can “Best for Dynamic Content” or Custom settings. Change the default cache behavior to cache nothing, then change the “Directory and file overrides” and give a path to the image cache.

Cache Default Behavior

In the Custom domains, first, create the SSL certificates and then enable the custom domains.

Custom Domain for CDN Opencart

You can leave the remaining setting as it is or change it as per your requirement and click the “Create Distribution” button and your CDN is set up.

Then, change A record with the AWS Cloudfront URL by removing the Static IP.

DNS Record changes Opencart. CDN

To check if the Cloudfront is working or not, just inspect the page and in the Network tab of the console, click the image and see the details. In the response, if it is serving via CloudFront URL and see the x-cache: “Hit from Cloudfront”, then CloudFront is serving the images.

Debug CDN Cloudfront Check. Opencart lightsail


Error 1: Installation error because of ownership issues

Warning: fopen(/opt/bitnami/apache/htdocs/system/storage/session//sess_bb5cfd84f55cef397e6edd17cb): failed to open stream: Permission denied in /opt/bitnami/apache/htdocs/system/library/session/file.php on line 29Warning: flock() expects parameter 1 to be resource, bool given in /opt/bitnami/apache/htdocs/system/library/session/file.php on line 31Warning: fwrite() expects parameter 1 to be resource, bool given in /opt/bitnami/apache/htdocs/system/library/session/file.php on line 33Warning: fflush() expects parameter 1 to be resource, bool given in /opt/bitnami/apache/htdocs/system/library/session/file.php on line 35Warning: flock() expects parameter 1 to be resource, bool given in /opt/bitnami/apache/htdocs/system/library/session/file.php on line 37Warning: fclose() expects parameter 1 to be resource, bool given in /opt/bitnami/apache/htdocs/system/library/session/file.php on line 39

Solution Error 1: run command ‘sudo chown daemon:daemon -R .’

Error 2: Fatal error: Uncaught Exception: Error: Variable ‘sql_mode’

Fatal error: Uncaught Exception: Error: Variable 'sql_mode' can't be set to the value of 'MYSQL40'<br />Error No: 1231<br />SET @@session.sql_mode = 'MYSQL40' in /opt/bitnami/apache/htdocs/system/library/db/mysqli.php:40 Stack trace: #0 /opt/bitnami/apache/htdocs/system/library/db.php(45): DB\MySQLi->query() #1 /opt/bitnami/apache/htdocs/install/model/install/install.php(35): DB->query() #2 /opt/bitnami/apache/htdocs/system/engine/loader.php(248): ModelInstallInstall->database() #3 /opt/bitnami/apache/htdocs/system/engine/proxy.php(47): Loader->{closure}() #4 /opt/bitnami/apache/htdocs/install/controller/install/step_3.php(11): Proxy->__call() #5 /opt/bitnami/apache/htdocs/system/engine/action.php(79): ControllerInstallStep3->index() #6 /opt/bitnami/apache/htdocs/system/engine/router.php(67): Action->execute() #7 /opt/bitnami/apache/htdocs/system/engine/router.php(56): Router->execute() #8 /opt/bitnami/apache/htdocs/system/framework.php(165): Router->dispatch() #9 /opt/bitnami/apache/htdocs/system/startup.php(104): requir in /opt/bitnami/apache/htdocs/system/library/db/mysqli.php on line 40

Solution Error 2: Remove the MYSQL40. Find the code $db->query(“SET @@session.sql_mode = ‘MYSQL40′”); and remove the MYSQL40 so that the code looks like $db->query(“SET @@session.sql_mode = ””);

Error 3: AWS LightSail 500 Internal Server Error

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at you@example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.

Solution Error 3: check if the .htaccess is there and rename it to a different till you fix the .htaccess file


Permissions 0644 for '/Applications/MAMP/htdocs/webocreation-bk/LightsailDefaultKey-us-east-1.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/Applications/MAMP/htdocs/webocreation-bk/LightsailDefaultKey-us-east-1.pem": bad permissions
bitnami@ Permission denied (publickey).

Solution Error 4: Give permission to the key file of 0644 by running “chmod 0644 pathofkeyfile

Error 5: Error while generating the SSL certificate

Failed authorization procedure. dpsignadvertising.com (dns-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Incorrect TXT record "oujxGkfDXUloV5IUO3__gNQA47b1wePnF4rvUcQWclM" found at _acme-challenge.dpsignadvertising.com

Solution Error 5: Check the TXT record and wait till it propagates.

Error 6: Class ‘Scssc’ not found

Fatal error: Uncaught Error: Class 'Scssc' not found in /opt/bitnami/apache/htdocs/admin/controller/startup/sass.php:9 Stack trace: #0 /opt/bitnami/apache/htdocs/system/engine/action.php(79): ControllerStartupSass->index() #1 /opt/bitnami/apache/htdocs/system/engine/router.php(67): Action->execute() #2 /opt/bitnami/apache/htdocs/system/engine/router.php(46): Router->execute() #3 /opt/bitnami/apache/htdocs/system/framework.php(165): Router->dispatch() #4 /opt/bitnami/apache/htdocs/system/startup.php(104): require_once('/opt/bitnami/ap...') #5 /opt/bitnami/apache/htdocs/admin/index.php(26): start() #6 {main} thrown in /opt/bitnami/apache/htdocs/admin/controller/startup/sass.php on line 9

Solution Error 6: Check the vendor folder and upload the right Opencart version vendor folder.

Error 7: This site can’t be reached

This site can’t be reached 
dpsignadvertising.com’s server IP address could not be found.
Checking the connection
Checking the proxy, firewall, and DNS configuration

Solution Error 7: Either you just make DNS changes, so better to wait up to 1-2 hours. Or the IP address given is not correct.

Error 8: mysqli::__construct(): (HY000/2002): Connection refused

Warning: mysqli::__construct(): (HY000/2002): Connection refused in /opt/bitnami/apache/htdocs/system/library/db/mysqli.php on line 7Warning: DB\MySQLi::__construct(): Couldn't fetch mysqli in /opt/bitnami/apache/htdocs/system/library/db/mysqli.php on line 10Warning: DB\MySQLi::__construct(): Couldn't fetch mysqli in /opt/bitnami/apache/htdocs/system/library/db/mysqli.php on line 10
Fatal error: Uncaught Exception: Error: <br />Error No: in /opt/bitnami/apache/htdocs/system/library/db/mysqli.php:10 Stack trace: #0 /opt/bitnami/apache/htdocs/storage12/modification/system/library/db.php(35): DB\MySQLi->__construct() #1 /opt/bitnami/apache/htdocs/system/framework.php(80): DB->__construct() #2 /opt/bitnami/apache/htdocs/system/startup.php(104): require_once('/opt/bitnami/ap...') #3 /opt/bitnami/apache/htdocs/index.php(31): start() #4 {main} thrown in /opt/bitnami/apache/htdocs/system/library/db/mysqli.php on line 10

Solution Error 8: Make sure your database server is not down.

In this way, you can set up the Opencart in AWS Lightsail. You can see how to set up Opencart in google cloud. Hope you liked this opencart tutorial, please subscribe to our YouTube Channel for Opencart video tutorials. You can also find us on Twitter and Facebook.



How to show the author’s image in the blog post on Hubspot?

We were designing the Hubspot theme and working on the blog listing and blog post of Hubspot, by default there was no author image shown, so we had to make some code changes to show the author’s avatar.

In the template type blog_post, we add the following code to show the author’s image, name, and published date of the HubSpot blog. You can get the author image URL with {{ content.blog_post_author.avatar}}

<div class="blog-post__meta">
  <div class="blog-post__meta_content">
      {% if content.blog_post_author.avatar %}
      <div class="blog-author-img">
        <img src="{{ content.blog_post_author.avatar}}" alt=" {{ content.blog_post_author.display_name }}" />
      {% endif %}
      <div class="blog-author-name">
          <a href="{{ blog_author_url(group.id, content.blog_post_author.slug) }}" rel="author">
            {{ content.blog_post_author.display_name }}
          <time datetime="{{ content.publish_date }}" class="blog-post__timestamp">
            {{ content.publish_date_localized }}

CSS added are below:

.blog-post__meta_content, .blog-post__meta{
  display: flex;
  flex: 1;
.blog-post__meta a{
  color: #01afd7 !important;
  text-decoration: none;

.blog-author-img img{
  width: 70px;
  border-radius: 50%;
  margin-right: 10px;
  align-items: center;
  display: flex;

With these additions we are able to show the author section below:

Author image in hubspot blog

We are HubSpot-certified developers from Phoenix Arizona, USA, so if you guys need any help on HubSpot development, please contact us or email us directly at webocreation.com@gmail.com. Please let us know if you have any questions or suggestions, please subscribe to our YouTube Channel and you can see more in Salesforce, Marketo, Pardot, and Hubspot. You can also find us on Twitter and Facebook. Enjoy!

How to remove en-gb from the SEO URL of Opencart 4?

In Opencart 4, when we activate the SEO URL it contains the language as well and for the English language, it shows en-gb by default, which we don’t like so we looked to remove it and the easiest way to remove en-gb is by following code. The following code will not work if you have multiple languages, it works only for English because we are replacing en-gb from the URL, we will find a way soon to remove all the languages and post the solution here.

SEO best practices for Opencart 4

Open file /system/library/url.php and find the following code:

if (!$js) {
	return str_replace('&', '&amp;', $url);
} else {
	return $url;

And, replace with the following code:

if (!$js) {
	return str_replace('en-gb/', '', str_replace('&', '&amp;', $url));
} else {
	return str_replace('en-gb/', '',$url);

Speed up the Opencart 

This will remove the en-gb from the Opencart 4 URL. Please let us know if you have any questions or suggestions, please subscribe to our YouTube Channel for Opencart video tutorials and you can see more in the Opencart tutorial category. You can also find us on Twitter and Facebook. Enjoy!

Common OpenCart Errors issues and How to Solve Them

This Opencart tutorial collects the most common errors that we face while developing and provides solutions for errors, try them and hope you could solve the issues

Cannot delete the admin folder in Opencart 4

https://forum.opencart.com/viewtopic.php?t=228495&p=843586 This solution looks working, for now, change the following lines of code at admin/controller/common/security.php

foreach (glob(trim($next, '/') . '/{*,.[!.]*,..?*}', GLOB_BRACE) as $file) {

to following

foreach (glob($next . '/{*,.[!.]*,..?*}', GLOB_MARK|GLOB_BRACE) as $file) {

2. Blank White Pages or 500 Internal Server Error

Blank white pages are a PHP error that for some reason the error messages don’t show because your server is not set up to display the errors.

  1. Go to the admin>> System >> Setting >> Edit store >> Server tab and at the end where you see the Error handling choose Yes to “Display Errors “.
  2. If you still don’t see the error, open php.ini and add code below: display_errors = 1; error_reporting = E_ALL; log_errors = 1;
  3. If you still don’t see the error then open index.php and add code below at the top (line 2): ini_set(‘display_errors’, 1); ini_set(‘log_errors’, 1); error_reporting(E_ALL);
  4. Still seeing the error then, set your “Output Compression Level” to 0 in the System > Settings > Server tab.
  5. If you still see the error, solve the issues but if you did not see the errors then most probably it will be a Server error.
  6. You can see error logs in the file also if you had enabled it.
    Blank screen issues in Opencart

Above mostly it gets solved and the 500 Internal Server Error can be solved with a similar approach.

2. Undefined Index / Variable

An undefined variable in the source code of a computer program is a variable that is accessed in the code but has not been previously declared by that code. So for that using “isset()” to check if the variable has been set will solve the issue.

Error variant:

Notice: Undefined index: filter in /Applications/XAMPP/xamppfiles/htdocs/opencart303/catalog/controller/product/category.php on lin

//$filter = $this->request->get['filter'];

if (isset($this->request->get['filter'])) {
    $filter = $this->request->get['filter'];
} else {
    $filter = '';
  • Commenting $filter = $this->request->get[‘filter’]; and checking with isset is one way to solve it.
  • If you get the issue while installing the modules or extensions then you need to check the code or solve the issues or contacting the developer can be also another solution.

3. Undefined Function / Method

Undefined function/method errors are seen when you call those functions or methods that are not defined and not found. IE_ERROR: A fatal error that causes script termination “Fatal error: Call to undefined function” or “Fatal error: Call to undefined method”. It happens if files are not found or the extensions are not compatible with your OpenCart version. Solutions can be below:

Error variant:

Related to OpenCart core files

  • Fatal error: Uncaught Error: Call to undefined method DB\MySQLi::query()
  • Fatal error: Uncaught Error: Call to undefined method Cart\Cart::getProducts() 
  • Fatal error: Uncaught Error: Call to undefined method ControllerAccountLogin::validate() in …/catalog/controller/account/login.php:54 

Go to the file and check whether the function or methods are defined there.

4. Headers Already Sent

Error variant:
  • Warning: Cannot modify header information – headers already sent by (output started at /public_html/config.php:31) in /path/public_html/index.php online.

Remove spaces at the beginning and end of the file mentioned. Like in the above error check with the config.php

5. Session Issue

  1. The product on the cart is self-cleared.
  2. The product on the cart is cleared after the user logged in.
  3. No items stored at product compares.
  4. OpenCart admin always asking to login and get message “Invalid token session. Please log in again”.
Error variant:
  • Warning: session_start () [function.session-start]: open (/tmp/…, O_RDWR) failed: No such file or directory (2) in /path/public_html/system /library /session.php on line

No such file or directory issue

  1. Open php.ini and add code below:session.save_path = /tmp;
  2. If the solution above does not work, contact your host and ask them how to set session.save_path.

6. Allowed Memory Size Exhausted

This error happens because your memory is not enough to execute the PHP code (uploading large images, deleting a lot of products, sending mass emails, etc). Increasing the memory allocated for PHP will solve the issue.

Error variant:
  • Fatal error: the Allowed memory size of 1111 bytes exhausted (tried to allocate 1111 bytes) in /path/public_html/system/library/image.php on line
  1. Edit php.ini and set memory_limit = 128M;
  2. Or put code below to .htaccess php_value memory_limit 128M
  3. If the above does not works then contacting the hosting providers is only the solution where they can increase the number.

Warning: Use of undefined constant DIR_STORAGE – assumed ‘DIR_STORAGE’ (this will throw an Error in a future version of PHP) in …/config.php on line

Some other errors that you can face are below:

Error: Calls to magic methods are not allowed!

// Stop any magical methods being called
if (substr($this->method, 0, 2) == '__') {
return new \Exception('Error: Calls to magic methods are not allowed!');

Error: Could not call product/category

// Initialize the class
		if (is_file($file)) {
			$controller = new $class($registry);
		} else {
			return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');

Error: Could not load model

if (!$this->registry->has('model_' . str_replace('/', '_', $route))) {
    $file = DIR_APPLICATION . 'model/' . $route . '.php';
    $class = 'Model' . preg_replace('/[^a-zA-Z0-9]/', '', $route);

    if (is_file($file)) {
        $proxy = new Proxy();
	// Overriding models is a little harder so we have to use 
        //  PHP's magic methods
	// In future version we can use runkit
        foreach (get_class_methods($class) as $method) {
            $proxy->{$method} = $this->callback($this->registry, $route . '/' . $method);

        $this->registry->set('model_' . str_replace('/', '_', (string)$route), $proxy);
    } else {
        throw new \Exception('Error: Could not load model ' . $route . '!');

Error: Could not load library

Error: Could not load helper

Error: Could not load cache adaptor Memcache/Redis/APC cache!

$class = 'Cache\\' . $adaptor;
if (class_exists($class)) {
    $this->adaptor = new $class($expire);
} else {
    throw new \Exception('Error: Could not load cache adaptor ' . $adaptor . ' cache!');

Error: Could not load database adaptor mpdo/mssql/mysql/mysqli/postgre !

$class = 'DB\\' . $adaptor;
if (class_exists($class)) {
    $this->adaptor = new $class($hostname, $username, $password, $database, $port);
} else {
    throw new \Exception('Error: Could not load database adaptor ' . $adaptor . '!');

Error: Could not make a database connection using this username and password

Error: Could not connect to database opencart

Error: PHP GD is not installed!

if (!extension_loaded('gd')) {
    exit('Error: PHP GD is not installed!');

Error: Could not load image filename!

Error: Invalid session ID!

Warning: Install folder still exists and should be deleted for security reasons!

Installed bad extension, pressed refresh in the modification, and both admin panel and site are down

Remove it from the database, then open config.php and find what is the value defined for storage. Go to that storage/ folder, then go to modification and remove folders, similarly go to upload/ folder and see if there are folders if you have, remove it also. With this, it will remove the cached files and folder. Then, you can access your admin again.

Fatal error uncaught exception

Fatal error: Uncaught Exception: Error: Table ‘….oc_session’ doesn’t exist in engine<br />Error No: 1932<br />SELECT `data` FROM `oc_session` WHERE session_id = ‘….’ AND expire > 1548638620 in …/system/library/db/mysqli.php:40 Stack trace: #0 …/system/library/db.php(45): DB\MySQLi->query(‘SELECT `data` F…’) #1 

For these errors to solve creating a database table will solve most of the issues

Fatal error: Uncaught Exception: Error: Could not load database adaptor DB_DRIVER!

Check in the system/library/DB folder whether the required driver file is there.


Hope you solve the problems, if you find them please let us know, then we try to provide the solutions.

Opencart error, Opencart blank white page, Opencart headers already sent, opencart undefined index, opencart undefined variable, opencart restriction in effect, opencart memory size exhausted, opencart undefined method, opencart undefined function, opencart invalid token session, opencart internal server error, Vqmod, opencart out of memory

How to add an Analytics extension in Opencart 4? Third-party JS free Opencart extension

With the launch of Opencart 4 we did not find the Google Analytics Opencart 4 module that we used to have in Opencart 3, so to fulfill that requirement we created a free Opencart extension called Third Party JS extension where you can add the Javascript code provided by third-party like Google Analytics, Facebook pixel, etc and add it on this extension.

How to install the Opencart 4 module?

Log in to Admin >> Extensions >> Installer >> Click the Upload button and select the file that ends with .ocmod.zip. In the above download example, it is third_party_js.ocmod.zip. Once it is installed you will see the “Third Party JS” in the installed extensions.

Once you uploaded the zip file, you click the install green icon to install the extension.

Installed extensions Opencart 4

Once you clicked the install button, your extension is installed successfully

opencart 4 extension installation success

Once you see the success message. Now you can go to Admin >> Extensions >> Extension. Then, choose the extension type “Analytics”  and click the install green install button.

Read More: Add HTML, google analytics, tag manager, and third-party JS code in Opencart

google analytics opencart 4

Once you click the install button, you can edit the store and you will see a form where you can install the third-party JavaScript like below and enable the status and click the blue save button.

Google Analytics Opencart 4 extension

After clicking the save, now the JavaScript code is shown at the head tag.

code added in the header Opencart 4

In this way, you can install the Opencart 4 extensions and use our free Opencart 4 analytics extension for your website.  Hope you liked this post, let us know if you have any questions or suggestions, please subscribe to our YouTube Channel for Opencart video tutorials. You can also find us on Twitter and Facebook. Enjoy Google Analytics Opencart 4 module!

Metaverse for E-commerce – What Retailers Need to Know

As technology evolves, so does the way we shop. The development of the internet over the past few years has allowed for the widespread acceptance of online shopping. 

With the advent of virtual and augmented reality, eCommerce has taken a major leap toward the Metaverse. Mark Zuckerberg (Meta) and Satya Nadella (Microsoft) have made public statements recently about their plans to make significant forays into the Metaverse.

The potential of the Metaverse for eCommerce is enormous. In the Metaverse, retailers can create virtual storefronts and interact with customers completely new. Imagine browsing a virtual store and seeing the products in three dimensions or trying on virtual clothes and accessories to see how they look before making a purchase.

What Is Metaverse E-commerce?

The Metaverse platform employs blockchain technology to facilitate honest and open interactions between buyers and sellers. Transactions in Metaverse are easy and risk-free because users can use the available smart contracts to create legally binding agreements that are automatically executed.

The Metaverse platform also simplifies online monetary transactions. The system operates with a cryptocurrency called ETP that can be exchanged for a wide range of goods and services from merchants worldwide. Fast, reliable, and secure, ETP is a modern method of making payments. It improves commerce’s security, openness, and efficacy, allowing more people to shop online.

How Does Metaverse E-commerce Work?

Shopping online can feel like an individual experience at times. You can’t benefit from other buyers’ feedback when you make an online purchase. Many things will change when the Metaverse’s commercial infrastructure is up and running.

You can converse with other shoppers in similar virtual reality (VR) environments. You’ll be able to view their replies and get advice from your pals.

The virtual world promises to improve the shopping experience by allowing more in-depth interactions with a wider range of products. Shops of the virtual variety will have their special section of the virtual world. Customers will get a real feel for the products at these stores.

Due to the nature of digital assets, shop owners can set up shop in multiple MMORPGs with precisely the same offerings. If you want to sell your wares on Facebook, even Facebook has you covered with a platform called Facebook Shop.

By exploring and experiencing products in various dimensions, customers will have a more enjoyable and immersive shopping experience. Soon, the lines between brick-and-mortar stores and online marketplaces will blur.

Why Should E-commerce Businesses Care About the Metaverse?

Improved Customer Engagement

In the Metaverse, retailers can create immersive experiences that engage customers on a deeper level than traditional eCommerce platforms. By creating a virtual storefront, retailers can showcase products in a way impossible on a conventional website. This can lead to increased customer engagement and, ultimately, more sales.

Personalized Shopping

In the Metaverse, retailers can create virtual assistants or avatars to guide customers through the shopping experience. These assistants can provide personalized recommendations based on a customer’s shopping history, preferences, and body shape and size. This can make the shopping experience more efficient and enjoyable for customers.

Enhanced Social Interaction

The Metaverse is a social platform, and retailers can use this to their advantage. By creating virtual events or pop-up stores, retailers can create a buzz around their brand and engage with customers more personally. This can help build brand loyalty and increase sales.

Cost-Effective Expansion

The Metaverse provides a cost-effective way for retailers to expand their reach. Instead of investing in brick-and-mortar stores, retailers can create virtual storefronts accessible to anyone with an internet connection. This can help small businesses compete with larger retailers and expand their reach to new markets.

New Revenue Streams

The Metaverse offers new revenue streams for retailers. By creating virtual goods and experiences, retailers can tap into a new market of customers willing to pay for unique and immersive experiences. This can include virtual clothes, accessories, and even virtual real estate.

Foster a More Inclusive Community

These days, it takes more than just pushing products on mobile, desktop, and social media to build a successful retail business. Customers care more about the good a company does in the world and the values it upholds than they do about the products it sells. Accordingly, brands must show they understand and value consumers’ priorities to build trust and loyalty, especially with younger generations.

Retailers frequently use freebies and VIP events to achieve this goal. That materialized in the cyber world as non-transferable tokens (NFTs). To incentivize customers to buy their NFTs, stores offer previews of new products or special content only available through those retailers.

Notable companies that have introduced NFTs include Nike, Coca-Cola, and Adidas, among many others.

Perform Market Research at Little to No Cost

As the lines between the digital and real worlds blur, stores may find the Metaverse useful for gathering information about customers’ tastes. Retailers, for instance, could use the Metaverse as a testing ground for products before bringing them to life. Consumers could also use the Metaverse to test out merchandise before making a purchase decision.

You can see this in action at Metaverse Fashion Week. With all the glitz and glamour of New York Fashion Week, some of the most recognizable brands converged on the Metaverse for a high-profile fashion event. How Gucci, Ralph Lauren, and the other brands will use the information gleaned from the circumstances needs to clarify. However, don’t be surprised to see physical iterations of the most notable digital trends appearing shortly.

The Metaverse Can Help E-commerce Businesses Boost ROI

60% of respondents to a Google survey said they would be interested in using augmented reality tools to enhance their shopping experiences, which would likely increase customer satisfaction and encourage them to purchase products they could first try in 3D.

Customers in the Metaverse will not only be able to visualize products more clearly, but they will also have the opportunity to interact with store employees. If your employees can create a welcoming atmosphere where customers feel comfortable expressing their full range of feelings, you can expect high product interest and sales.

Being an early adopter of the Metaverse will make your company famous and allow you to consult with other companies about how they can improve their operations by adopting similar strategies.

Which E-commerce Brands Are Planning to Enter the Metaverse?

Walmart: Walmart’s metaverse shopping will center on the creation and sale of virtual goods like furnishings, sporting apparel and equipment, personal care items, toys, and furniture.

Balenciaga: Even Balenciaga, a long-standing name in the fashion industry, has evolved to meet modern tastes. Currently, the company’s top priority is investigating the potential for business in the Metaverse.

Coca-Cola: In 2021, Coca-Cola created its first NFT and partnered with Decentraland to experiment with the Metaverse.

Nike: Regarding consumer brands, Nike was one of the pioneers in the virtual world. The company boasts that its Nikeland virtual store in the Metaverse has seen tremendous growth and impressive metrics.

What Does the Future of E-commerce and Retail in the Metaverse Look Like?

With metaverse eCommerce store development comes an increasing number of brand-new possibilities. There is no doubt that the Metaverse, with its emphasis on personalized engagement and experiences, will significantly alter the way we interact with many eCommerce businesses.

Nike, Balenciaga, and Walmart, all household names in the retail industry, have hopped on the metaverse bandwagon and appear to be reaping the benefits of this unique technology. For this reason, many other brands will likely enter the Metaverse, all vying to outdo one another by providing shoppers with more cutting-edge forms of entertainment and interaction.


In conclusion, the Metaverse could revolutionize how we shop online. By creating immersive and personalized experiences, retailers can engage with customers on a deeper level and increase sales. As technology evolves, the Metaverse will become an increasingly important platform for eCommerce. Retailers who embrace it early will have a competitive advantage.

How to make the CKeditor of supports HTML, iFrame and scripts in Opencart editor?

We were trying to add the google map iframe HTML code in the CKeditor of Opencart but by default, the HTML encode output is disabled on Opencart 4+, so to enable we need to change the CKeditor configuration and make the CKeditor support the HTML and iframe code. The General HTML Support allows for adding markups like elements, attributes, classes, and styles to the source and prevents it from being filtered from the editor window and the output.

Enable the General HTML Support for CKeditor in Opencart 4

Go to admin >> view >> javascript >> ckeditor and open config.js

CKeditor Opencart

In the config.js file find config.htmlEncodeOutput = false, and change it to true.

config.htmlEncodeOutput = true;

And also make sure there is

config.allowedContent = true;

With this config change and clearing the website cache, now you can add the iframe and HTML code in the CKeditor.

If you still are not able to add the iframe or other HTML code then download the following code and unzip it and replace the ckeditor folder at admin >> view >> javascript >> ckeditor

Demo example of google map iframe

We added the iframe of google map in the HTML module and show it in the contact us page

In this way, you can configure the CKeditor to add the iframe, scripts and HTML markups like elements, attributes, classes, and styles. Please let us know if you have any other issues that you are facing then we can look at it, you can email us at webocreation.com@gmail.com. Hope you liked this tutorial, please subscribe to our YouTube Channel and read more about Opencart Documentation. You can also find us on Twitter and Facebook.

OpenAI ChatGPT uses in eCommerce business

You may be thinking about how we can use the OpenAI ChatGPT in your eCommerce business, here we are showing you how you can use or benefit from the OpenAI ChatGPT in your eCommerce business like copywriting, writing product descriptions, titles, emails, social media content, responses, personalized product recommendations, getting products information like popular ones, and many more. ChatGPT is simply a new tool, so it needs to be carefully used and trained on a relevant dataset of questions and responses. You can use it to get ideas and suggestions but creating content as naturally as possible is always good. Let’s start with copywriting.

Copy-writing with OpenAI ChatGPT

You can use OpenAI ChatGPT for copywriting. Based on a given prompt or conversation environment, OpenAI’s ChatGPT language model can be used to produce text responses that resemble those of a human. ChatGPT can be used to come up with concepts or content for marketing pieces like product descriptions, blog entries, or email campaigns. A copywriter might give ChatGPT a list of keywords or a broad theme, for instance, and the model might then provide a list of concepts or a draft of the copy based on that input.

Read more: 12+ Artificial Intelligence ideas that you can use for your eCommerce website

Here is one example of how OpenAI ChatGPT gives a response when we ask: “Can you please provide copywriting content for the Buddha statue?”

Copywriting OpenAI ChatGPT

We were looking for small copywriting content, but ChatGPT gives us multiple paragraphs, so we again ask “Can you please provide short copywriting content for the Buddha statue?”, here is the response:

small copywritin OpenAI ChatGPT

The more detailed information you gave the more exact answer you will get, but take in mind it is still in preview mode.

Read more: Final year college projects ideas for student

OpenAI ChatGPT can help you to write product descriptions

ChatGPT can be used to generate ideas or rough drafts of product descriptions based on input provided which you can review the output and refine to create a final product description that is clear, compelling, and accurate. Here is one example of how we asked the ChatGPT to provide the product description: “Write a product description of bronze Nepali Buddha statue from Nepal, price $400, 10cm height 10 cm width and 10 cm breadth, materials used bronze” and the response is like below:

Product description OpenAI ChatGPT

Again, ChatGPT is simply a tool for generating text, and it is up to the writer to use their skills and expertise to craft a product description that meets the desired tone and style of your brand.

Read about: How to build a free eCommerce website using Opencart 4 user manual in 2023?

Email writing with ChatGPT

Every eCommerce uses multiple email touch points for promotions, signup, forgot password emails, vouchers, order confirmation, etc. You can use the ChatGPT by providing information about the purpose of the email, the intended audience, and any relevant context, and the model could generate a list of ideas or a draft email based on that input. Here is one example of how we ask ChatGPT to provide the signup email. We asked ChatGPT “Write a signup success email for webocreation.com an eCommerce website?” and the response is like below:

Signup email written by OpenAI ChatGPT

As you see, it provides you with overall ideas and drafts to start with the content, which you can use as per your requirements.

How to fix email which is not working in Opencart?

Getting products information like popular ones

We cannot be 100% sure but we can get some overall ideas, we asked OpenAI ChatGPT to provide popular kitchen products by asking like “popular products in kitchen appliances” and the result is like below:

popular products in kitchen appliances category

Use OpenAI ChatGPT for social media content

We can use OpenAI ChatGPT for social media content. We asked ChatGPT to provide the social media promotion content for our ebook “OpenCart Theme and Module Development” and it provides us the following content:

Social media content generated from OpenAI ChatGPT

But, we cannot promote this content on the Twitter because of the word limits so we asked ChatGPT to provide us the Twitter promotion text by asking “Write a twitter social media promotion content for ebook “OpenCart Theme and Module Development” and here is the response:

Twitter promotion content generated from ChatGPT

13 proven tips and tricks to boost eCommerce conversions

Translate the content to multiple languages

For the above Twitter promotion, we need to share in Nepalese and Spanish languages so we asked the ChatGPT to translate it just by typing “Translate it into Nepalese” here is the result which is not totally good but it provides the starting points:

Translation by ChatGPT

Personalized products recommendations

You can set up related products as per the personalized product recommendations. We asked ChatGPT to provide us the product recommendations who bought those ebook “product recommendations who bought the ebook “OpenCart Theme and Module Development”, here is the response:

Product recommendations by ChatGPT

Show related products at the cart page in the Opencart site


In conclusion, OpenAI’s ChatGPT is a potent language model with the potential to be applied in a number of eCommerce-related applications and processes. ChatGPT can be used for copywriting, writing product descriptions, titles, emails, social media content, responses, personalized product recommendations, getting product information like popular ones, and many more. However, it is crucial to keep in mind that ChatGPT is merely a tool for producing text responses; it is up to the user to use it carefully which helps your eCommerce business. The ChatGPT gets trained on a relevant dataset of queries and responses in order to reach a high level of accuracy and efficacy but for now, we all need to use it carefully. Are you using ChatGPT, if yes let us know how you are using it and if no check it, it amazes you most of the time.

Let us know if you have any other ways or ideas of AI that you have used in eCommerce websites or have any questions or suggestions, please subscribe to our YouTube Channel and read more about eCommerce, Web 3.0, blockchain, NFT, and the metaverse. You can also find us on Twitter and Facebook.

Master Product and Variant Product in Opencart

In Opencart we can create a variant product based on the master product. A product variant is a pre-defined option product. For example, let’s say we add a product with red and blue options (product id 50), now we can create a variant based on this product and select the option red only to make the red variant product (product id 51 with master id 50).

How to add the product variant in Opencart?

Go to products listing or Catalog>>Products and click the dropdown near the edit button in the Action column and you will see the “Add Variant”, click it and you are ready to add the variant.

Add Variant Opencart

Once you clicked the “Add Variant”, all the data of the master product is copied and a new product is created where you can override the data as per your need. Please note that when you override the variant product data, the field data which is changed will not get replaced with the master product data when the master product data is changed and saved. If the field data is not overridden then when master product data is changed the changes will be seen on the variant product as well.

How to override the variant product data?

In the Variant product, you will see a toggle icon for every field where you can click On it and change the field data as per your need.

Opencart Product Variant

Let’s say you change the product name but did not change the product description of the product variant, then when you changed the product name and description of the master product then the changes will be seen only on the product description but not on the product name. Variants products are pre-selected options so you cannot change the options on the variant product.

Note: if you save the product variant after the master product’s data is changed then the variant product overridden data is replaced by the master product’s data, so be careful.

Select the Option:

Option selection for product variant

Change the SEO URL:

Product Variant SEO URL

Now click save and you have added the product variant.

Opencart product variant

As the product variants are also added like new standalone products so you can view them on the category page as well.

Improvements needed:

  • When we select the option in the master product and have the product variants, then it would be better to show the product variant page.
  • When the option price is added, it is better to show the added price on the product variant page, right now it is showing as the product price instead of the Option price.
  • SEO improvements for the product variants.


In this way, you can easily create product variants from master products and customize your own data except for options and making it easy to create product variants. Please let us know if you have any kind of projects, you can email us at webocreation.com@gmail.com. Hope you liked this tutorial, please subscribe to our YouTube Channel and get more Opencart free extensions. You can also find us on Twitter and Facebook.

How to handle a large number of products in a sitemap for Opencart?

One of our clients had products around 50k because of which the sitemap could not load and always throw 500 errors as Opencart tried to load all the products’ sitemap URLs on one page. So, our solution is to show the sitemap URLs in a chunk of 500 and use the sitemap index.


Although a single sitemap limit is 50MB or 50k URLs, mostly the hosting providers or servers cannot handle showing all of those 50k URLs on one page so our solution is to create chunks to 500 URLs as one sitemap and list all sitemaps using sitemapindex and submit this one sitemap which includes the sitemapindex.

Here is an example of sitemapindex:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

When you see one of the sitemap URLs, for example, this URL https://webocreation.com.com/index.php?route=extension/feed/google_sitemap&amp;start=0&amp;end=500 then you will see the sitemap code like below of 500 products:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
            <image:caption> Walnuts</image:caption>
            <image:title> Walnuts</image:title>

Code changed for the Google sitemap extension

Open file catalog/controller/extension/feed/google_sitemap.php, remove all code, and paste the following:

class ControllerExtensionFeedGoogleSitemap extends Controller {
	public function index() {
		if ($this->config->get('feed_google_sitemap_status')) {
			if(isset($_GET['manufacturers']) && $_GET['manufacturers']=='active'){
				$output = $this->getManufactureresSiteMaps();
			}elseif (isset($_GET['start'])) {
				$output = $this->getProductsSiteMaps($_GET['start'], $_GET['end']);
				$output ='<?xml version="1.0" encoding="UTF-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';

				$totalProducts = $this->model_catalog_product->getTotalProducts();
				for($i=0; $i<$totalProducts; $i=$i+500 ){
					$output .= '<sitemap><loc>'.HTTPS_SERVER.'index.php?route=extension/feed/google_sitemap&amp;start=' . $i . '&amp;end=500</loc><lastmod>2023-02-19T18:23:17+00:00</lastmod></sitemap>';
				$output .= '<sitemap><loc>'.HTTPS_SERVER.'index.php?route=extension/feed/google_sitemap&amp;manufacturers=active</loc><lastmod>2023-02-19T18:23:17+00:00</lastmod></sitemap>';

			$this->response->addHeader('Content-Type: application/xml');

	protected function getCategories($parent_id, $current_path = '') {
		$output = '';

		$results = $this->model_catalog_category->getCategories($parent_id);

		foreach ($results as $result) {
			if (!$current_path) {
				$new_path = $result['category_id'];
			} else {
				$new_path = $current_path . '_' . $result['category_id'];

			$output .= '<url>';
			$output .= '  <loc>' . $this->url->link('product/category', 'path=' . $new_path) . '</loc>';
			$output .= '  <changefreq>daily</changefreq>';
			$output .= '  <priority>0.7</priority>';
			$output .= '</url>';

			// $this->load->model('catalog/product');

			// $products = $this->model_catalog_product->getProducts(array('filter_category_id' => $result['category_id']));

			// foreach ($products as $product) {
			// 	$output .= '<url>';
			// 	$output .= '  <loc>' . $this->url->link('product/product', 'path=' . $new_path . '&product_id=' . $product['product_id']) . '</loc>';
			// 	$output .= '  <changefreq>daily</changefreq>';
			// 	$output .= '  <priority>1.0</priority>';
			// 	$output .= '</url>';
			// }

			$output .= $this->getCategories($result['category_id'], $new_path);

		return $output;

	protected function getProductsSiteMaps ($start, $end) {
		$output = '<?xml version="1.0" encoding="UTF-8"?>';
		$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';


		$filter_data = array(
			'start' => $start,
			'limit' => 500,
		$products = $this->model_catalog_product->getProducts($filter_data);
		foreach ($products as $product) {
			if ($product['image']) {
				$output .= '<url>';
				$output .= '  <loc>' . $this->url->link('product/product', 'product_id=' . $product['product_id']) . '</loc>';
				$output .= '  <changefreq>daily</changefreq>';
				$output .= '  <lastmod>' . date('Y-m-d\TH:i:sP', strtotime($product['date_modified'])) . '</lastmod>';
				$output .= '  <priority>1.0</priority>';
				$output .= '  <image:image>';
				$output .= '  <image:loc>' . $this->model_tool_image->resize($product['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')) . '</image:loc>';
				$output .= '  <image:caption>' . (str_replace('&', 'and', $product['name'])) . '</image:caption>';
				$output .= '  <image:title>' . (str_replace('&', 'and', $product['name'])) . '</image:title>';
				$output .= '  </image:image>';
				$output .= '</url>';
		$output .= '</urlset>';

		return $output;

	protected function getManufactureresSiteMaps(){
		$output = '<?xml version="1.0" encoding="UTF-8"?>';
		$output .= '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';


		$output .= $this->getCategories(0);


		$manufacturers = $this->model_catalog_manufacturer->getManufacturers();

		foreach ($manufacturers as $manufacturer) {
			$output .= '<url>';
			$output .= '  <loc>' . $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer['manufacturer_id']) . '</loc>';
			$output .= '  <changefreq>daily</changefreq>';
			$output .= '  <priority>0.7</priority>';
			$output .= '</url>';

			//$products = $this->model_catalog_product->getProducts(array('filter_manufacturer_id' => $manufacturer['manufacturer_id']));

			// foreach ($products as $product) {
			// 	$output .= '<url>';
			// 	$output .= '  <loc>' . $this->url->link('product/product', 'manufacturer_id=' . $manufacturer['manufacturer_id'] . '&product_id=' . $product['product_id']) . '</loc>';
			// 	$output .= '  <changefreq>daily</changefreq>';
			// 	$output .= '  <priority>1.0</priority>';
			// 	$output .= '</url>';
			// }


		$informations = $this->model_catalog_information->getInformations();

		foreach ($informations as $information) {
			$output .= '<url>';
			$output .= '  <loc>' . $this->url->link('information/information', 'information_id=' . $information['information_id']) . '</loc>';
			$output .= '  <changefreq>daily</changefreq>';
			$output .= '  <priority>0.5</priority>';
			$output .= '</url>';
		$output .= '</urlset>';
		return $output;

This is the rough way to do it for now but no worries we will soon create an extension for it and provide you guys, for now, this is the quick way to achieve it.

In this way, you can submit the sitemap for a large number of products and submit it to google, bing, or other search engines. Please let us know if you have any kind of projects, you can email us at webocreation.com@gmail.com. Hope you liked this tutorial, please subscribe to our YouTube Channel and get more Opencart free extensions. You can also find us on Twitter and Facebook.

How to set free shipping, flat rate shipping, shipping as per item, or pick from a store in Opencart?

In this Opencart tips and tricks, we are showing you to set different shipping methods like free shipping on Opencart, similarly flat rate shipping, shipping rate as per item, free shipping after some amount is reached on total orders, pick from store setup, flat rate up to 100 and then free shipping and so on. We are using Opencart version for demo purposes but it is similar to other Opencart versions. Let’s start with a free shipping setup.

How to set up free shipping in the Opencart store?

To set up the free shipping, log into the admin section >> Extensions >> Extensions >> select Shipping, where you will see lists of available shipping extensions, install the “Free Shipping” extension if it is not installed, after that click the edit and you will see a form like below where you can enter total as 0, select the geo zone as “All Zones”, toggle to enable the status and sort order to 0 and click the blue button to save the setting. With this your free shipping extension is active.

free shipping opencart

Now, when someone checkout, they will see the free checkout option on the Shipping methods.

Free shipping method Opencart

Read more: Set up taxes with geocodes US tax for California residents 8.75%

How to set up a flat shipping rate in the Opencart store?

You can set the flat shipping rate similar to the free shipping, log into admin >> Extensions >> Extensions >> select Shipping >> install “Flat rate” extension and edit it. You will see a form like below, where you enter the amount in the Cost field for flat shipping.

Flat shipping rate Opencart

Now, let’s set up a combination of free shipping and flat-rate shipping.

Read more: Show multiple flat rates shipping as per total

How to set up free shipping for over $100 and for below it will be $5 flat-rate shipping?

First, we need to install both free shipping and flat rate extensions, which you can do like above. Once extensions are installed, then edit the free shipping extension and enter the setting in the form as shown below, the only change is the Total field is set to 100. That 100 is the sub-total amount needed before the free shipping module becomes active.

free shipping after 100

You can set the flat rate cost of 5 and you are good to go. Now free shipping is shown only when the sub-total reached 100.

How to set the shipping rate per item?

in some cases, you need to set the shipping rate per item, in that case, also Opencart provides default extensions, log into admin >> Extensions >> Extensions >> select Shipping >> install “Per Item” extension and enter the cost for each item.

Per item shipping Opencart

With this now if you order two items then shipping will be 20. Here is one example, we order 2 Macbooks and the shipping is 20.

Shipping rate calculation per item

How do you can set up pick up from the store shipping in the Opencart store?

Similar to other extensions, you can install the “Pickup From Store” extension and edit it, enable the status and you will see the Pick up from store option in shipping methods.

Pick from store Opencart setting

How to set up a weight-based shipping rate?

First, you need to set up weight classes and then add the weight for each product. Once the weight is added for products you can use the weight-based shipping rate. You can install the “Weight Based Shipping” extension, edit it and you will set up the general options like below:

weight based shipping

Learn about: What is ‘Zone Shipping’ and how do we set it up?

You will see a general tab and other Zone shipping tabs. In the general tab, select the tax class, enable the status and enter the sort order as you like to show in the Shipping methods. In the Zone shipping let’s select the UK shipping tab, you can enter the rates in the format of weight:cost comma weight:cost and enable the status. Here is an example:

weight based shipping rate

Let’s say your weight setting is Kilogram at Settings >> Local tab >> Weight class. Then, with that rate setting, it means that 5 kilograms of product cost 10 and 10 kilograms, and more costs 15. So you can set those options as many as you want.

In this way, you can set shipping methods in Opencart. Please let us know if you have any questions or comments so that we can add extra topics. You can follow us at our Twitter account @rupaknpl, subscribe to our YouTube channel for opencart tutorials, and click to see all Opencart user manuals.

Tips and tricks to improve Pardot form select fields with JavaScript

After completing multiple projects in Pardot, here are some of the tips and tricks to improve the form select fields of Pardot with Javascript. There is no default value shown in the Pardot form select, so if you want to add some default value like for the country field: “Please select your Country” then you need to add some JavaScript. Here is the default form select field in Pardot.

No default select in Pardot form

Here is the JavaScript that you can add to the form

    window.addEventListener("load", function (event) {
        var countryoption = document.querySelector(".country select option");
        if (countryoption) {
            countryoption.innerHTML = "Please select your Country";

You can add the above JavaScript in the Pardot form, one way is you can add the JS by editing the form >> Look and Feel tab >> Below Form tab >> Click the Source icon and paste the Javascript.

Pardot form custom javascript

Now the form looks like the below:

Please select country default

Read more: Marketo form administration tool – add or update field for all forms at once

If you did not see the value then you may need to customize the following line of code:

document.querySelector(".country select option");

Change that country to your form field name. You can see it by inspecting it. In the browser, right-click near the form field >> then click inspect >> see what is the field name in the class

Following is one example:

form-field  country pd-select required    form-field-primary

With that, we can say the class is country so we use .country

find form field name

How to set a default value for a custom dropdown in a Pardot form?

You wanted a default value to be selected, for example, the USA country needs to be selected by default.

When we inspect we find that the value of the option is 7683158

option value of USA country pardot form

Now adding the following JavaScript in the below form will select the USA by default.

    window.addEventListener("load", function (event) {
        var countries = document.querySelector(".country select");
        for (var i = 0; i < countries.options.length; i++) {
            if (countries.options[i].value == ‘7683158’) {
                countries.options[i].selected = true;

Here is the final result:

auto option selected

Read more: Pardot, Mailchimp, and website integrating Marketing system

Let’s make the select label a placeholder

CSS that makes the label lower can be like below:

#pardot-form .pd-select .field-label {
    position: relative;
    top: 35px;
    padding-bottom: 5px;
    padding-left: 10px;

Now select the field that looks like below:

select label placeholder

Now, with the following JavaScript, the select form label is pulled up when the option value is changed.

   window.addEventListener("load", function () {
       var inp = document.querySelector(".country select");
       inp.onchange = function (e) {
           if (this.value != '439913') {
               document.querySelector(".country.pd-select > label").style.cssText =
                   "top:-1.5em;font-size: 12px;position: relative; min-height: 55px";
               document.querySelector(".country.pd-select > select").style.cssText =
                   "padding-left: 15px !important;";
           } else {
               document.querySelector(".country.pd-select > label").style.cssText = "";

Here is the result

Move Label in form field

Read more:  How to integrate Pardot on the website easily?

How to add custom form field validation in Pardot form?

Let’s say you need to validate a phone form field and allow more than 7 digits, then something like the below JavaScript can do the trick.

    window.addEventListener("load", function () {
        var inp = document.querySelector(".phone input");
        var element = document.querySelector(".phone div");
        inp.onkeyup = function (e) {
            if (inp.value.length < 7) {
                element.innerHTML = "<p class='error'>Phone number is too short</p>";
                element.style.display = "block";
phone validation pardot form

How to add the placeholder form field in Pardot form?

Pardot form placeholder

As Pardot doesn’t have a placeholder by default, so you can add the placeholder from JavaScript code like below, let’s say your field’s class name is first_name then the code is:

var firstname = document.querySelector('.first_name input');
    firstname.placeholder = 'John';

In this way, we helped multiple clients to make form layouts, landing page layouts, and email layouts and made them as per their brand guidelines. Please let us know if you have similar kinds of projects, you can email us at webocreation.com@gmail.com. Hope you liked this tutorial, please subscribe to our YouTube Channel and read more about Salesforce, Pardot, Marketo, and Hubspot. You can also find us on Twitter and Facebook.

25 SEO best practices for Opencart 3 with 3 free SEO Opencart 3 module

In this Opencart tutorial, we list out more than 25 best practices for SEO for Opencart 3 and find out 3 free SEO Opencart 3 modules. In near future, we will try to come up with some free module for Opencart that addresses most of them but for now, have a look at the following and let us know if you have comments and suggestions.

We list out 25 free best practices for SEO for Opencart 3

  1. Rename the .htaccess.txt to .htaccess

    Go to your hosting root folder where Opencart is installed and find .htaccess.txt and rename it to .htaccess

  2. Admin Setting section changes for the SEO

    – Go to Admin >> System >> Settings >> Edit your store
    – In the General tab, enter the Meta Title, Meta Tag Description, and Meta Tag Keywords, they are for the Home page of your store website.
    – Go to the Server tab, and Choose Yes for “Use SEO URLs”

  3. Enable the sitemap extension

    Go to Admin >> Extensions >> Extensions >> Choose the extension type >> Feeds then install the Google Sitemap extension and then edit it and change the status to “Enabled” and save it. Now your sitemap URL will be given there which looks like:

  4. Submit the sitemap to Google webmasters and Bing webmaster

    Create a Google Webmasters account and Bing Webmaster account and submit the above sitemap URL in them.

  5. Create robots.txt in the root folder where Opencart is installed, and in that robots.txt place following text, here change the sitemap URL to your website URL

    User-agent: *
    Disallow: /admin
    Sitemap: https://yourwebsiteurl.com/index.php?route=extension/feed/google_sitemap

  6. Opencart supports canonical URL automatically, be sure to check it, it removes the duplicate content penalties.

    https://yourwebsiteurl.com/cateogryname/productname and https://yourwebsiteurl.com/productname, these both URL point to the same product page, so google may take it as duplicate content so canonical URL need to set up. One example when you view source the code you will see the canonical URL something like below:

    Opencart canonical URL

  7. Product name and Description – Content is the key for Search Engines

    – Product description, as best practices for SEO, you should aim to write at least 300 words but be clear and write as much as possible.
    – Name the images as the product name, in Opencart most of the images alt tags are either product name in the product page, category name in category image and so on.

  8. Enter SEO information for Products, Categories, Information page, Manufacturers also.

    For entering the Products SEO information, go to Admin >> Catalog >> Products >> Add/Edit >> then in General tab, enter the Meta Tag Title, Meta Tag Description, and Meta Tag Keywords, likewise go to SEO tab and enter the keyword for each store.
    While entering the Meta Tag title, consider the following best practices:
    – Google only shows around 50–60 characters of a title tag so make the title tag around 50-60 characters
    – Put important keywords in title and meta description
    While entering the Meta Tag Description, consider the following best practices:
    – 160 characters long
    – We have seen search engine alway do not pick the meta description but enter them.
    – Better not to include double quotation marks
    While entering the SEO keyword:
    – Include the main keyword or product name and better to use the lowercase and not to use the prepositions words
    – Better not to use underscore (_), instead use dashes (-)
    – Better not to include double quotation marks or single quotation and special characters

    Follow same for Admin >> Catalog >> Categories and Admin >> Catalog >> Information and Admin >> Catalog >> Manufacturers

  9. Use social proof to gain user trust and keep your visitors engaged in your website

    Link to your website on all social media profiles. Social proof is for customers’ confidence. Footer has options to keep the user engaged (social media, phone number, etc)

  10. Internal linking is also important

    In product pages, we can do it by adding the related products

  11. Page Speed: Choose your hosting server properly

    Use the right cache module to get more benefits like we missed Litespeed plugins in our WordPress website by which site was slow, so better to ask your hosting server which caches are supported.
    Check with the google page speed and follow their suggestions to improve the page speed. Improving the Google PageSpeed insights score will help a lot to show in the search results.

  12. For improved performance: Minify HTML, Minify CSS, and Minify JS

    – To minify the HTML you can use this free module
    HTML Minify | Compress code | SourceCode Compressor
    For CSS and JS minification use the developer help.

  13. Use srcset for images which help on properly sizing the images as per the screen

    Load images properly as per the screen like with srcset you can load different images for different screens. one example image code:
    Opencart Srcset Image optimization
    See the code srcset=”https://i1.wp.com/webocreation.com/wp-content/uploads/2019/08/out-of-stock-admin-setting.jpg?w=800&ssl=1 800w, https://i1.wp.com/webocreation.com/wp-content/uploads/2019/08/out-of-stock-admin-setting.jpg?resize=300%2C229&ssl=1 300w, https://i1.wp.com/webocreation.com/wp-content/uploads/2019/08/out-of-stock-admin-setting.jpg?resize=768%2C586&ssl=1 768w, https://i1.wp.com/webocreation.com/wp-content/uploads/2019/08/out-of-stock-admin-setting.jpg?resize=80%2C60&ssl=1 80w, https://i1.wp.com/webocreation.com/wp-content/uploads/2019/08/out-of-stock-admin-setting.jpg?resize=696%2C531&ssl=1 696w, https://i1.wp.com/webocreation.com/wp-content/uploads/2019/08/out-of-stock-admin-setting.jpg?resize=551%2C420&ssl=1 551w” this loads the images as per the width of the screen.
    We didn’t find any module for this, we will try to provide it soon, so for now, developer help needed.


  14. Speed up the repeat visit by serving static assets with efficient cache policy 

    You can serve static assets with efficient cache policy by adding the following code in the .htaccess file, these are just our idea, you can make changes as per your requirement:

    # Set up 1 week caching on javascript and CSS
    <FilesMatch “\.(js|css)$”>
    ExpiresDefault A604800
    Header append Cache-Control “proxy-revalidate”
    SetOutputFilter DEFLATE

    # LBROWSERCSTART Browser Caching
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/gif “access 1 year”
    ExpiresByType image/jpg “access 1 year”
    ExpiresByType image/jpeg “access 1 year”
    ExpiresByType image/png “access 1 year”
    ExpiresByType image/x-icon “access 1 year”
    ExpiresByType text/css “access 1 month”
    ExpiresByType text/javascript “access 1 month”
    ExpiresByType text/html “access 1 month”
    ExpiresByType application/javascript “access 1 month”
    ExpiresByType application/x-javascript “access 1 month”
    ExpiresByType application/xhtml-xml “access 1 month”
    ExpiresByType application/pdf “access 1 month”
    ExpiresByType application/x-shockwave-flash “access 1 month”
    ExpiresDefault “access 1 month”

  15. GZIP for more efficient transfer to requesting clients. Compression level must be between 0 – 9.

    To enable the text compression in Opencart, go to Admin >> System >> Settings >> Server tab >> Add the “Output Compression Level”. The value should be 0-9, what we find out is most of the time it works above 5 but hit and trial is the only option that we see. With these, it minimizes the byte size of network responses and fewer bytes means page loads fast.

  16. Developer or Designer tasks: Ensure text remains visible during Webfont load

    Follow the idea provided at https://developers.google.com/web/updates/2016/02/font-display. Just for information, we tried that and in our case, we used font-display: swap and only works. Something like below:
    @font-face {
    font-family: ‘Arvo’;
    font-display: swap;
    src: local(‘Arvo’), url(https://fonts.gstatic.com/s/arvo/v9/rC7kKhY-eUDY-ucISTIf5PesZW2xOQ-xsNqO47m55DA.woff2) format(‘woff2’);

  17. Look for Critical CSS: Defer unused CSS, remove all unused CSS in a page, try to target CSS for each page.


  18. Fix broken links

    Broken links on the website are harmful to SEO. So one freeway to check the broken link is https://www.brokenlinkcheck.com/
    Once it found the broken links then fix them.

  19. 301 Redirect For Opencart 3 free module

    Install this free module 301 Redirect For Opencart 3.0.x – Beta and you can redirect old URLs to new URLs, so if you have to change the SEO URL keyword then don’t forget to add the 301 redirects.

  20. Add your Business to Google

    Open https://business.google.com and add your business details.

    Opencart Google Business
    Best practices for SEO as they relate to local searches include creating a Google My Business page. This practice is especially important for brick-and-mortar businesses as it shows a rich result on local Google SERPs.

  21. Add an SSL certificate to your site and redirect to the same host

    For safety, security and customer confidence.
    All domains to be redirected to the same host as https://yourwebsiteurl.com, choose www or non-www and redirect to one and use one.

  22. Mobile-first approach and Use a responsive, mobile-friendly design

    Mobile-friendly is for mobile fitness, as google search started to index the mobile-first, so be sure you don’t hide things in mobile phone and show in desktop, if it is hidden in the mobile then google search will no see it, what we found is it checks for the content, links count to see if it is similar with desktop view and mobile view.

  23. Make AMP page for Opencart

    Consider creating and using AMP versions of your product pages for the fastest experience. Check this free module:
    AMP for Product Pages

  24. Schema structured data markup for Opencart product page

    Schema structured data markup https://developers.google.com/search/docs/guides/intro-structured-data
    Testing tool: https://search.google.com/structured-data/testing-tool/u/0/
    But we did not find for Opencart version 3, we are working on it to provide you for version 3, here is for 1.5

  25. Monitor website activities, get notified for downtime, setup SEMrush account and set google analytics

    Check this blog post “Free Automated Testing and monitoring of Opencart functionalities and sites” which will monitor the downtime and send the notification and monitor for any errors by automated testing.
    For adding google analytics, Go to admin >> Extensions >> Extensions >> Choose Analytics >> Install the Google Analytics extension and edit add the analytics tracking code.
    Setup the free Semrush account and you will get 100 pages scanned every month, we found it valuable for a free account also so added here

  26. Remove index.php?route= in OpenCart for contact, home, and other

    Go to this blog post and download the module to remove index.php?route= in Opencart 3

  27. Setup Cloudflare for Opencart

    Visit https://webocreation.com/how-to-setup-cloudflare-easily-for-ecommerce-websites-like-opencart/ to setup Cloudflare for your website. It helps with security, performance, and reliability.

Thanks a lot.

Best practices to prevent e-Commerce Fraud

It’s no secret that e-commerce fraud is on the rise. From phishing scams to fraudulent chargebacks, online businesses often struggle with high levels of fraud and lost income due to theft and misuse of their services. But don’t worry – there are some steps you can take to help reduce the chances of becoming a victim. 

 This guide will explore the best practices for preventing eCommerce fraud and keeping your business running smoothly and securely. So let’s get started! 

25 website security measures for eCommerce developers

Put a limit on order quantities

Keeping your e-commerce business safe from fraud is all about prevention, so why not start at the checkout? Limiting order quantities can help you spot suspicious orders right away. For example, if someone’s trying to buy five of the same item in one go, that could be a potential warning sign.

Regarding specific rules, it’s wise to limit how many items an individual can purchase in one day or week and restrict orders for certain expensive items. This way, you can help ensure that legitimate customers are ordering what they need without giving criminals a chance to take advantage of your shop. Plus, it can help prevent over-ordering, leading to excessive returns and unhappy customers. 

Be strict about verification 

To protect your e-commerce store from fraudsters, you must have a strict verification process in place. This means ensuring that customers provide accurate information, such as a valid shipping address and phone number. You can also require customers to provide a current photo ID or credit card to verify their identity. Wondering why this is an essential practice in your business? 

Well, the truth of the matter is that fraudsters are always on the lookout for an opportunity to take advantage. They can quickly identify and manipulate vulnerable systems with ease. By having strict verification measures in place, you’ll be able to protect your eCommerce store from any fraudulent activity. On top of that, you also make eCommerce customers feel safe since strict verification ensures the legitimacy of your website. 

Setup Cloudflare easily for eCommerce websites

Keep an eye out for risky orders

While it’s not always possible to tell if an order is suspicious at first glance, taking extra time and doing a little extra digging can go a long way. In the case of e-commerce fraud, it’s always better to be safe than sorry. If you spot something that looks a little off, don’t hesitate to check it out immediately. 

Reach out to suspicious clients to settle your doubts and judge whether to continue with the transaction. This way, you’ll be able to protect your business from fraud and scams. Some common ‘red flags’ include customers outside your typical customer profile, multiple purchases from one IP address, and orders for expensive items without verification. 

Always check and update site security 

It’s a no-brainer: constantly checking and updating site security is the best way to protect your e-commerce business from fraud. This means ensuring that your website’s code is up-to-date and free of any vulnerabilities that hackers could exploit. This also includes renewing your SSL certificate to encrypt customer data or regularly monitoring for any signs of phishing scams and malicious activities.

In addition, look for any outdated or vulnerable versions of software and plugins and any new threats that may have been discovered since you last checked. Don’t forget to have an updated form of two-factor authentication for logging into customer accounts and adopting new measures to monitor IP addresses. All of this help stave off fraudsters who use loopholes to exploit weaknesses in your website system.

Post clear policies on your website 

When it comes to protecting your e-commerce website from fraud, it pays to be proactive. One of the most important steps you can take is to post clear policies on your site so that customers know exactly what they should expect when making a purchase. From shipping times to potential taxes or fees, ensure it is all clearly stated and easy to find. 

Aside from this, don’t forget to entail potential fraudulent policies on your website, including how you’ll deal with them. This way, customers who are trying to scam you will know that their actions won’t be tolerated and that they can expect swift action from you should anything suspicious occur. 

Rely on anti-fraud tools

If you’re handling an e-commerce business, it’s absolutely essential to have the right anti-fraud tools in place. Not only will they help keep your customer’s data safe and secure, but they can also prevent many headaches down the line. Remember, these tools are designed to recognize suspicious activity and alert you to any potential threats. 

They come in all shapes and sizes, ranging from traditional data analysis techniques like anomaly detection and machine learning algorithms to more advanced methods like facial recognition and biometrics. Some can even help you prevent cryptojacking, ensuring the safety of site visitors and customers alike. With them in place, you’re sure to have an extra layer of security against many types of fraud attempts. 

Create detailed order records

No matter how big or small your e-commerce business is, it’s important to have detailed order records. Of course, it’s beneficial since it allows you to trace orders without any hassle. However, it’s also a great practice if you want to save yourself from many fraudulent attempts. 

Doing so can help you quickly spot suspicious activity in requests, such as orders placed using stolen credit cards or duplicate ones from the same customer. Tip: ensure to include information such as the customer’s name, address, and order details in your records so that you can easily reference them if needed. You should also keep a record of any refunds or cancellations to support you in resolving any disputes that might arise. 

In conclusion

Following these practices can help ensure that your e-commerce business is secure and protected from fraud. You can also provide a safe shopping experience for your customers, which is crucial if you want to pave the road to success! 

How to create Opencart 4 modules or extensions?

With the launch of Opencart 4, there are changes in extensions or module management and code structure so we are creating Opencart 4 extension tutorial to create Opencart 4 modules or extensions and try to understand the flow and ways to develop Opencart 4 extensions. We will create a new module called “showallproducts” and others will be similar to it. Check Opencart 4 demo.

Files and folder structure of the Opencart module

The modules are in the extension folder in Opencart 4, now it is available in the root folder. When you see in the extension folder, by default there is an opencart folder and index.html, in the opencart folder, you will see all default extensions provided by default.

Files and folder structure opencart extensions
  • The file name should be between 1 letter and up to 128 letters.
  • The filename should end with “.ocmod.zip”
  • The uploaded file should not exceed the max file size: of 32 megabytes
  • Opencart extension installer checks if the file already exists, if it exists then it will throw an error.
  • It validates if the file can be opened and if there is an install.json that can be read. So, every extension should have install.json

How to create an install.json file in the Opencart extension?

Create a folder, in our example, it is “showallproducts” and inside it create a file name called install.json. It supports the following keys: name, version, author, and link. 

As per our module, the following is an example:

	"name": "Show all Products OC 4",
	"version": "0.1",
	"author": "Rupak Nepali",
	"link": "https://webocreation.com"

Once install.json is inside the folder, you can zip it and name it that ends with .ocmod.zip, then uploads it from the Opencart extension installer.

For our example we named it show_all_products.ocmod.zip and uploaded in Admin >> Extensions >> Installer and click the upload blue button and we get details like the below:

Opencart module extension installer

While uploading, if you don’t get anything then you need to go to the storage folder and inside it see the marketplace folder and remove the existing zip file.

With this, you are ready to start coding and adding files for your module. Now, in our next opencart tutorial we will create all the files needed for the showallproducts module and start adding code to install it and create an admin form and show the link in the header when activated.

It will contain files and folders like the below:

Files and folder Opencart module

Looks like we need to create a unique filename as well so for example as we are creating these files so our extension will be like webocreation_showallproducts.php and similar naming conventions.

In this Opencart 4 tutorial, we set up install.json for the opencart module and upload it, and we are ready to install it and create a way to add the functionalities. Please don’t forget to post your questions or comments so that we can add extra topics. You can follow us at our Twitter account @rupaknpl, and subscribe to our YouTube channel for an opencart tutorial. Click to see all Opencart 4 tutorials.

HubSpot CMS certified developer – how to make three columns module in Hubspot

Today, I took HubSpot CMS certified developer exam because it was free, and luckily able to become a Certified Hubspot CMS Developer. With knowledge of HTML, and CSS and going through the Hubspot courses, and making some themes and email templates provided an overall idea to pass the HubSpot CMS developer.

Hubspot certified developer

How to make three columns module in Hubspot?

We are showing how to make three columns module in HubSpot with Hubl, HTML, and CSS. Login to the HubSpot app >> Click Marketing menu >> Files and templates >> Design Tools and right-click the theme where you need the three columns module >> Click New file.

New file modules creation Hubspot

Then, select the Module and click Next.

Hubspot module

Enter the detail of the new module, check the checkbox where you want this module, here we want for Pages so only Pages is checked and module content scope is chosen Local module. Enter the file name and click Create button.

Module details HubSpot

Once you created the modules, you will see the module.html, module.css, module.js file section and in the right section you can add the fields. Add two fields, one for image and another for text.

Add fields text

Once you created two fields, now you have to group them. Click on the Actions dropdown and select the Group.

Group fields hubspot module

Once you selected the Group, you select all the fields and click the “Create group” button, to make it a group and name it.

Grouped field Hubspot

Once, you create the group, make the group fields repeatable by toggling like below and enter the minimum count, maximum count and default value.

Repeatable fields group

After that copy the code snippet.

Code Snippet Hubspot module

Now you can modify that code to make it three columns, so for us as per the fields name below is the code that we made and added on the module.html

<div class="three-columns-module">
    <h2>Our Team</h2>
  <div class="three-columns">
  {% for item in module.field_group_team %}
    <div class="column">
        <div class="img">
          {% if item.image_1.src %}
            {% set sizeAttrs = 'width="{{ item.image_1.width }}" height="{{ item.image_1.height }}"' %}
            {% if item.image_1.size_type == 'auto' %}
              {% set sizeAttrs = 'width="{{ item.image_1.width }}" height="{{ item.image_1.height }}" style="max-width: 100%; height: auto;"' %}
            {% elif item.image_1.size_type == 'auto_custom_max' %}
              {% set sizeAttrs = 'width="{{ item.image_1.max_width }}" height="{{ item.image_1.max_height }}" style="max-width: 100%; height: auto;"' %}
            {% endif %}
             {% set loadingAttr = item.image_1.loading != 'disabled' ? 'loading="{{ item.image_1.loading }}"' : '' %}
            <img src="{{ item.image_1.src }}" alt="{{ item.image_1.alt }}" {{ loadingAttr }} {{ sizeAttrs }}>
          {% endif %}
         <div class="team_details">
            {% inline_rich_text field="team_1_detail" value="{{ item.team_1_detail }}" %}
  {% endfor %}

Following are the CSS that we add on the module.css

.three-columns:after {
  content: "";
  display: table;
  clear: both;
.column {
  float: left;
  width: 33.33%;
@media screen and (max-width: 900px) {
  .column {
    width: 50%;
@media screen and (max-width: 600px) {
  .column {
    width: 100%;

Here is how it looks:

Full code hubspot three columns

After that we publish the module and it is ready to use. Now, create a landing page and click the three-columns module section and you will see objects like below which you can change and edit as per the needs.

Three columns hubspot module

In this way you can create three columns module in hubspot you can solve part of the HubSpot CMS for Developers Practicum for making the module

  • Team module
    • Must use repeating groups of fields to allow editors to add and subtract team members
    • Must be at least 3 columns on large screens with at least one media query to change the layout to 2 columns on screens below 900 pixels

Please let us know if you have any questions or suggestions, please subscribe to our YouTube Channel and read more about Salesforce, Marketo, Pardot and Hubspot. You can also find us on Twitter and Facebook.