📜 ⬆️ ⬇️

A few words about the engine of online stores OpenCart

Prehistory


For all the time that I was doing web development, somehow there was no need to write, probably, almost the most common version of orders on freelance exchanges - online store. To such a need came only, in fact, with the departure of freelancing. Before me stood the eternal question - what kind of engine to choose. For quite a long time, the wool network, met with various comments, reviews, comparisons on this subject, finally spat and took one of the rather popular, though often unnoticed for the sake of better known and tricky competitors, the solution is OpenCart. Took and did not regret. Usually I do not like and do not digest various consumer CMS, but OpenCart turned out to be an exception. I do not think that my description will be very useful to professionals - mini-analysis is designed more for those who are just trying to decide on what to write, or who just have not tried.

Story


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

1. The biggest, fat plus: good, imputed MVC implementation. This is not the case with Wordpress, Joomla, Drupal in principle. Then I'm afraid to lie (correct, if that), but in my opinion not even Magento and Prestashop. Yes, yes, they are casting away me now, they say, what for is a goat accordion. Needed, comrades. An adequate system of separation of 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 they say, if you do not like cats, you just do not know how to cook them. At the same time, you can have several design templates in your display folder with the ability to select the one you need in the admin panel.

2. Comfortable admin - nothing superfluous, but all that is needed is there. You do not have to insert css and templates through the admin area (whoever invented it at all, stop smoking). Last but not least, thanks to the things from item 1, any section can be twisted — rotated — to customize with a slight movement of the editor (well, come on, tell me how you custom admin in Wordpress). There are also easily screwed / unscrewed filters and validators for any fields. As a result, even the communities are not needed - the engine is actually a framework in classical traditions with examples for itself. By the way, the community at OpenCart is rather big, so it will be quite possible to find like-minded people in case of anything.
')
3. There is a CNC out of the box (even for WordPress, for this you need to put an extension). But if you do not use them - then the project is not confused with a ton of unnecessary rewright for the operation of the basic functionality. I do not know how anyone, but I was pleased - it’s still easier to master a new tool when the logic of the paths is transparent.

4. Clearance under the store makes available out of the box a lot of things needed everywhere: registration and 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 is captivating, when everything is already implemented, only slightly filed with a file.

5. A pleasant trifle, an important moment for store owners - many different order statuses, and it is easy to add a new one.
Total - a good, fast engine, in fact, a hybrid of the classic framework and the classic CMS.

And now a little about the cons, which so far has been able to notice.

1. With a good classical MVC, there is no imputed implementation of the model. Layers of abstraction, ActiveRecord - it's all far away from OpenCard. Models contain simple queries of the form $ this-> db-> query ("SELECT * FROM customer").

2. No matter how much everything is needed in the existing filling, at the most inopportune moment it turns out that there is nothing critical. For example, the function "callback". Or activation of mail using the code. And other trifles, which in principle are not so difficult to do, but you get stuck in the modifications, although it seems that the engine should be able to do it itself. 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 limit of $ 10. However, I wrote it myself, and now I will have this functionality for the following cases.

3. The problem, which was written on the Toaster : the engine stores the language in cookies and does not transmit to the link, which leads to problems in the exchange of links and interferes with SEO.

4. The buying process is pretty hard 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 the address three times: just the address, shipping address and billing address. Of the three stores, I had to put all my hands in all three in a pile of places. Another example is the required “model” field when creating a product. Well, a person doesn’t have a model, it happens - you have to remove them with your hands too. That is, summarizing this point - if you need to cut out something extra or add something new, you have to do a lot of gestures in a large number of places in the code.

On this, perhaps, finish. Write your comments about the engine, which I may have made a mistake or did not take into account, write about your 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 with your hands slug'i or install a module (not free). For the VP itself, the CNC turns on out of the box, but for transliteration you need a plug-in (in fact, we are talking about transliteration. I had to additionally finish WordPress plugin for transliteration).
2. These online shopping engines also have MVC.
3. The purpose of the article, of course, was not to describe MVC as such, but the phrase “imputed MVC implementation” should be clarified. First, MVC in the engine in general, in principle, is, which is already important in comparison with other solutions. Secondly, it is made as it is customary to see anyone who has worked with popular frameworks, which includes various aspects: trite directory structure, naming logic and controller functions, variable transfer logic ... And so on. Ie, you open the code and write, as usual. The only comment is the model, wrote about it in the first "minus".

Source: https://habr.com/ru/post/225081/


All Articles