Sunday, August 9, 2020

Dev: working here not working there

 Recently Opencart released a new Opencart 3.0.3.6 version where our Ka Extensions module stopped working. The module extends the twig with a few useful functions but Opencart developers changed the location of the twig and you might guess what happened.

We released a new version of Ka Extensions adding a fix to that issue. The new module version worked fine on old stores and on our test environment. Everything looked fine until a couple users reported that the new module version still shows a twig error with unknown t() function. It looked strange, but we could not ignore that fact. One of our clients provided an access to the store where this issue could be reproduced.

Investigation revealed that a new file, which we added to the new twig, contained files and directories with upper letter cases but Opencart can automatically include only files with a lower case in names. After we renamed the files the new ka-extensions module loaded the page correctly.

Tuesday, June 4, 2019

How to start e-commerce with Opencart: Preparations

Preparations

How to start your store? Of course with the idea. What will you sell and to whom. After thinking about a business plan, you can proceed to action. And first of all, to open any web site you need to acquire a domain name.

Domain selection

Simply put, the domain is the name of the site that we type into the address bar of the browser. For example: google.com, yandex.org, sony.ru, etc. Usually a domain consists of the name of the zone (ru, org, com, etc.) and the name of the site itself.

Decide for yourself in which zone you want to open a store and how it will be called. As soon as you come up with a name, it is worth checking whether it is available for purchase. This can be done on many sites, for example here:


A domain costs from $ 10 to $ 20 per year, depending on the zone.

A domain can be purchased separately, or sometimes it is offered for free with the purchase of a hosting plan. Of course, it is more convenient to buy a domain and hosting from one provider, so that they automatically configures for you their bundle.

Let's talk now about hosting purchase.

Hosting selection

Hosting is a server rental service (computer) configured to show your site. There are a lot of types of hosting, they depend mainly on the performance and the software installed there. The most popular and easy-to-use hosting is shared hosting. So it is called, because on one computer several web sites of different users are installed and they share computer resources among themselves. Such servers are serviced by hosting staff and you do not need to think about setting up or updating them.

Opencart is not resource demanding, so it will work successfully on almost any hosting. Of course, it should be noted that if your site is very popular, then the hosting company may tell you that you need to purchase a more powerful hosting plan, but for a start, a simple hosting plan is fine for you.

For example, with namecheap you can buy hosting for your site from $ 31 to $ 100. Do not rush to the cheapest option, because it usually has various limitations. But the most expensive and most likely you will not be useful at the initial stage either. Choose something in between, for example the Stellar Plus plan (see picture below) is quite suitable for the needs of your store.


Please note that many companies offer a large discount for the first year of use, and then the price may increase significantly. Therefore, be careful when reading all the conditions of purchase. Also, companies often make a discount if you pay the entire year of hosting at a time and not monthly.

The second point to which it is worth paying attention is the physical location of the hosting servers. It is desirable that the hosting server located in the same geographical area, or at least on the mainland with your target audience. Since the transfer of data from another continent may have some time delays, poorly noticeable to users, but taken into account by different systems of service quality assessment. As you can see from the picture above, namecheap has servers in the US and UK, and hosting in the UK costs $ 12 more.

Of the mandatory requirements for hosting, you need to pay attention to what is included:
- the ability to configure cronjob (service settings run automatic tasks, such as periodic import or export data)
- support for php 5.6 and newer
- mysql support
- daily backups

SSL certificate

For any more or less serious website, claiming to be known on the Internet requires an SSL certificate. Technically, it allows you to establish a secure connection between the user and the site so that no one can read the data transmitted between them. Some browsers highlight the certificate with a key or a green background. And if it is not, then the opposite is written that the connection is not safe.

SSL certificate consists of two text files with public and private key codes. You can buy it separately, but if there is an opportunity to buy it together with hosting, it will be good.

Currently (2019), namecheap offers certificates from $ 9 for a year. Their choice is large enough, the difference between them is who created it and how many domains it works. For the initial online store any certificate will work, later you can buy a more expensive certificate, if there is a need for it.


Please note: there is a class of certificates called self-signed certificates, they can be created for free to establish a secure connection, but such certificates are not suitable for a commercial web site. The certificate must be issued by a trusted and reputable supplier.

Once you have decided on the hosting and domain, you can proceed to purchase! As we already wrote, it is best to buy in one place. You can choose one of the popular hosting providers, you can find them in google. But still, look at https://www.namecheap.com. Our company trusts this hosting. We have several demo sites there and have never had any problems with them.

Chapter 3: "Installation"

How to start e-commerce with Opencart: Introduction

Introduction

In these series of articles we will try to describe all the steps of opening an online store. Feel free to post your comments and make suggestions to the content.

Why Opencart

There are many platforms for online stores. They differ in functionality, cost, customization options. Opencart distinguishes from other platforms because it is free, popular, has a simple code and low requirements for the server environment.

Opencart is especially well suited to those who wants to customize the store for yourself. Because, thanks to its code, it is easy to expand it creating the necessary functionality for you.

The disadvantages of Opencart include a weak modular architecture, a fairly time-consuming upgrade system. At the moment, the authors of the Opencart platform are looking for ways to simplify this procedure, but meanwhile these prospects are rather vague and we have what we have.

Next chapter: "Preparations"

Saturday, August 8, 2015

Group Prices in Opencart

Hi, Reader!

Recently I met an extension which allowed to define customer group prices under the main product price on the product edit page. Here is a screenshot from opencart 2.0.3.0.


I understand that it might be unclear how to define customer group prices in opencart for new users, but who could believe that this was a commercial extension sold about 100+ times? Amazing marketing, I am impressed...

If you are not sure how to define these prices let me explain. You should use the 'Special' tab on the product edit page. See a screenshot below where the same prices are defined on the 'Special' tab.



But returning to the mentioned extension I have to say that after examining the code I found out another "cool" thing. The extension does not use special prices at all and saves all prices in a serialized array of the product table. Therefore it ignores special prices completely. It is a very bad practice leading to incompatibility issues and other bad results like issues with filtering by prices.

I agree that it may be useful to define customer group prices on the 'General' tab under the main price, but they should be linked to special prices permanently. Maybe I should write a similar extension and publish it at the minimum possible price on the marketplace. Your thoughts?