Practical experience in developing an online store on OpenCart

    In November 2009, I met with www.opencart.com and was very pleased with this CMS built in compliance with the basic principles of MVC. This is just a wonderful system of code which can be easily adapted to your own needs. System files are divided into folders controller, model, view, language.
    image
    Brilliant and simple. It’s so simple that in a matter of hours I understood how the system works and was already able to adapt several controller files to my needs. As a CMS, this system is better not to consider in principle! Everything is very scarce and sad. But the platform for commercial activities is very decent. The main slogan of the site is an online store with minimal development effort.

    An important advantage for me is the high speed of page generation. Simple code with separation into a model, view, controller. Design templates are in folders with a clear structure. A simple system compared to magento commerce in which changing something is very difficult.

    And now a few details that may be of interest to those interested in Opencart. I publish the Old, which in my opinion can be useful and, most importantly, based not on theoretical experience, but on the example of use in a specific project.


    Easy to make code changes

    For example, you see a block with a market price and savings when buying on this page: www.toolsonline.ru/toolsets/allinone/nab.14.12.116it is displayed only for goods of the machine tool import brand. To make this block, it was necessary to add some variables to the file of the controller responsible for the formation of the product card. I can’t say that it’s very usable and I needed to modify PHP files via FTP. But the logic is so transparent that I am sure that in the future I will not get confused about what I have already done or will do later. The block is displayed only for one specific manufacturer. The logic is in a separate controller file. Representation of a block in a design template file where PHP and HTML are mixed up. Opencart templating is the most primitive possible, but it has its own power! Which you understand after you work with other people's design templates on xslt. I added changes to two php files and got the result I need.

    Upload to Yandex.Market in 3 days


    I wrote a code for downloading goods from an online store in the Yandex ML format. This is very simple to do on the basis of the file available in the system for exporting goods to the Google Base format. This is actually easy to do.
    A lot of interesting aspects of this format were revealed to me when coordinating the upload parameters with the Yandex.Market manager. Before he approved the final version, I made changes to the upload 4 times. The Yandex.Market admin helped a lot, where you can check the validity of the upload. Yandexoids did a good job of checking this file. I realized the task of integrating an online store into Yandex.Market in just 3 days and was very proud of it for the next 3 days =) Moreover, I implemented the vendor.model model and made it so that in the admin panel you can choose the minimum price of goods starting from which the goods are unloaded in file.

    For those who do not know exactly how the unloading occurs:
    Goods are automatically unloaded in the YML file on Yandex.Market. A file is uploaded, processed and published approximately every 5 hours. Yandex.Market randomly polls links to site products with a frequency of 1 minute. If the site is unavailable, then it is removed from publication automatically. Therefore, if you click on products in Yandex.Market search, then each click will cost the site owner at least 3 rubles. The stupidity of the YML format is that XML is only accepted in windows-1251, and not in UTF-8. The lion's share of HTML Entity is not supported. The reason for this strange support is incomprehensible to me.

    Work with images


    Look at the additional pictures in the product description: www.toolsonline.ru/toolsets/allinone/nab.14.12.105 they are displayed in 275x275 pixels. A click on the picture opens a picture in the size of 800x800 a watermark is displayed on top of the picture. Image scaling, protective watermarking in OpenCart are built by default. It is only necessary to figure out where the necessary library lies generating images of the required size and add a few lines of code to the image output library. The watermark output is implemented, but it must be included in one of the helper methods in the PHP file.

    A product cannot have fields for individual properties and as a result, in principle, do not implement filters by properties, as in Virtuemart and other engines, but there is a very nice and simple WYSIWYG (I don’t know what it's called), you can add an unlimited number of add-ons. pictures for the goods. A lot of built-in tools for managing the price of goods. You can add options that affect the final price. Each product can be placed simultaneously in several sections of the catalog.

    CNC problems


    This CMS has a number of shortcomings that must be fixed! There are a lot of CNC errors, as I understand it, this feature has appeared since version 1.3.x and has not yet been debugged. One product can be viewed as seo-url from the root of the site www.toolsonline.ru/cs-tk56pmq or in the directory structure: www.toolsonline.ru/toolsets/unisets/cs-tk56pmq i.e. several ways to the same product, which in my opinion is not gud. The total number of pages is greater, but the weight of each page from the point of view of the search engine should be less, because they have the same content. In addition to the option of SEO links, links with parameters also operate in parallel; Here is the link www.toolsonline.ru/index.php?route=information/contact and I didn’t succeed in making a beautiful link / contacts / in a simple way.

    Problem with code 404


    The second important problem is that Daniel, the architect of this very CMS, basically does not give 404 error for non-existent pages i.e. the text “page not found” will be displayed, but the HTTP code 200 OK will be transmitted for the page. The search engine will think that the page exists, but it is not. Slag will not be removed from the search engine index. I solved this problem, but I am surprised why there is no solution in the Opencart community on the official forum.opencart.com website . I am there under my usual nickname jfima and have already posted a couple of my solutions there for this and other problems. I would say that the community is young and fragile and there are few wise people there.

    Total


    In general, OpenCart is well suited for e-commerce, if you focus on the option with minimal investment in development. My level is enough to finish something for this CMS on my own, which means that for many freelancers this system will be available. A simple framework that can be easily customized to the needs of the project.

    Also popular now: