A few words about the engine of online stores OpenCart

Background


For all the time that I am engaged in web development, somehow there was no need to write, probably, almost the most common version of orders on freelance exchanges - an online store. Such a need came only, in fact, with the departure of freelance. I had the eternal question - which engine to choose. For quite some time, the network was woolly, met various comments, reviews, comparisons on this subject, finally spat and took one of the rather popular, although often unnoticed for the sake of more well-known and sophisticated competitors, the solution is OpenCart. He took it and did not regret it. Usually I really do not like and do not digest various consumer-friendly CMS, but OpenCart turned out to be an exception. I don’t think that my description will be very useful for professionals - the mini-analysis is more likely for those who are trying to decide exactly what to write on,

History


So, I will tell first about what I liked most about the engine.

1. The biggest, bold plus: a good, sane implementation of MVC. Wordpress, Joomla, Drupal doesn’t have such a principle. I'm afraid to lie further (correct, if that), but in my opinion not even Magento and Prestashop. Yes, yes, now they will throw me, they say, what for a goat button accordion. Needed, comrades. An adequate system for separating the template, controller and logic of working with data is the key to success, the convenience of building up functionality on your project and in general. As the saying goes, if you do not like cats, you simply do not know how to cook them. At the same time, you can have several design templates in the folder with the mappings with the ability to select the one you need in the admin panel.

2. Convenient admin panel - nothing more, but there is everything you need. You do not have to embed css and templates through the admin panel (whoever invented this at all, stop smoking). Last but not least, thanks to the things in point 1, any section can be twisted-twisted-customized with the easy movement of the editor (well, come on, tell me how you customized the admin panel in Wordpress). There are and easily screwed / unscrewed filters and validators for any fields. As a result, even communities are not needed - the engine is actually a framework in classical traditions with examples for itself. By the way, the OpenCart community is rather big, so if you happen to be like-minded people, it’s quite possible.

3. There is CNC out of the box (even for WordPress, you need to install an extension for this). But if you do not use them, then the project is not confused by a ton of excessive revraits for the basic functionality to work. I don’t know how anyone, but I was pleased - it’s still easier to learn a new tool when the logic of the paths is transparent.

4. Sharpening for the store makes available out of the box a lot of things you need everywhere: registration and a personal account, complex forms with validations (for placing an order), filters and sorting, reviews, etc. Yes, all this is out of the box or in the modules and for the same Yii, as for any other framework, but it captivates when everything is already implemented, just a little filed.

5. A nice little thing, an important point for store owners is a lot of different order statuses, and it's easy to add a new one.
Total - a good, fast engine, which is actually a hybrid of the classic framework and the classic CMS.

And now a little about the minuses that so far have been noticed.

1. With a good classic MVC, there is no sane implementation of the model. Layers of abstraction, ActiveRecord is all far from OpenCart. Models contain simple queries like $ this-> db-> query ("SELECT * FROM customer").

2. No matter how much you need in the existing filling, at the most inopportune moment it turns out that there is something critical there. For example, the callback function. Or email activation with a code. And other trifles, which, in principle, are not so difficult to do, but you’ll dabble in the improvements, although it seems that the engine itself should be able to do this. There are quite a few different modules for it (including the ones described above), but almost all of them are paid, although prices usually do not go beyond the $ 10 limit. However, I wrote it myself, and now I will have this functionality for subsequent cases.

3. The problem that was written on the Toaster : the engine saves the language in cookies and does not transmit in the link, which leads to problems in the exchange of links and creates obstacles for SEO.

4. The buying process is quite rigidly predetermined, while it contains a lot of excess. For example, out of the box, when placing an order without registering, the user will be asked for the address three times: just the address, delivery address and billing address. Of the three stores, in all three I had to put my hands in a heap of places. Another example is the mandatory field “model” when creating the product. Well, a person doesn’t have a model, it happens - you have to clean it with your hands too. That is, summarizing this point - if you need to cut something superfluous or add something new, you have to do a lot of gestures in a large number of code places.

On this, perhaps, I will finish. Write your comments about the engine, in which I may have made a mistake or did not take into account, write about your work experience.

Thanks for attention.

UPD Thank you very much for clarifying my mistakes and non-obviousness in the comments:
1. Regarding the CNC: for OpenCart you need to register slugs with your hands or install a module (not free). For VP itself, the CNC is turned on from the box, but for transliteration, a plug-in is needed (in fact, we are talking about transliteration. I had to additionally finish the WordPress plug-in for transliteration).
2. The mentioned engines of online stores also have MVC.
3. The purpose of the article, of course, was not to describe MVC as such, but the phrase “sane MVC implementation” should be clarified. Firstly, the MVC in the engine is generally in principle, which is already important in comparison with other solutions. Secondly, it is made in the way that anyone who has worked with popular frameworks is used to seeing, which includes various aspects: the corny directory structure, the naming logic and controller functions, the logic for passing variables ... And so on. That is, you open the code and write, as usual. The only comment is the model, I wrote about it in the first “minus".

Also popular now: