Often, when a developer chooses the engine for the next store, he usually evaluates this question according to several criteria:
Paid / free (if paid, how much).
What functionality is out of the box.
How easy is it to screw some of its functionality.
How much he will pull the goods, so that the hosting does not go broke.
How flexible are the security policies to ensure that different departments work together?
Which payment systems are supported.
Under the cut, I will talk about the new ready-made assembly of an online store that was developed with these criteria in mind, and I think it can make even sophisticated developers think about it.
At the end of the article video with a brief overview of the engine and two ways to install
Important!!! I forgot to say: who is too lazy to watch the video, but will deploy the assembly, login / password to the default admin panel: admin / admin. ')
I’ll say right away that by deploying this assembly, you immediately get such a site. That is, immediately there is a directory model, registration / authorization through social networks, payment via robokassa, etc. (on its copy itself, it will be necessary to register your robokassa data in the configs and link the site to social programs).
The basis of the engine (as well as a fairly large background)
The framework was based on the MODX Revolution framework. Just do not rush to spit and close the page. This is not exactly the MODX you may have encountered. I have been working with MODX since the beginning of 2009, and I know it far and wide. And yes, I, like many, have come across many of its minuses (such as templates and chunks in the database, brakes, etc.). Plus, before getting to know MODX, I worked a lot with various samopisk and other engines, and on MODX I was left precisely because of its flexibility. Yes, I don’t like everything in it, but it makes it easy to change a lot in it, while not touching the core itself. In the process, I had several components that complement or change a certain MODX functional. Here are a couple of the most important ones: phpTemplates - allows static MODX templates to be called as regular php files. modxSmarty - Connects the Smarty template engine to the front and complements it with some buns, providing close interaction with MODX itself. shopModx is a module for developing online stores.
As a result, MODX gains not only full-fledged template making, but also much greater performance. Sites with tens of thousands of documents work with a response of 0.02 - 0.6 seconds. Plus, you can almost completely score on the syntax of the MODX itself, and if you know how to program in php and know Smarty, then you will have no problems in development.
But one of the most important things in MODX, which exactly holds me with chains, is a system of packages (modules for MODX). She's really cool. I even wrote a module that allows you to create your own package repositories. This is especially useful for various web studios and active developers. At the same time, the most delicious thing is that one can pack not only individual modules, but generally anything on the site, albeit entirely, at least separately, even the whole site in general. This is how the MODX sites snapshots appeared. Initially, this was implemented only on modxcloud.com itself (the official hosting from the MODX developers), but without the documentation and any releases, they laid out the vapor script, which was designed so that anyone could take a picture of their site and throw it. on modxcloud.com . In this case, the feedback was not implied, as it were (that is, to take snapshots from modxcloud.com and deploy on any hosting). I will not go into details, but I took this vapor, modified it and added another script to it (import.php). Now with the help of this script, you can both take pictures of sites, and deploy them on top of a clean site. You can download my vapor from the official repository . And it was with this vapor right that I took a course not only on separate modules, but also on ready-made assemblies of sites.
What is the meaning of such assemblies?
The point is that when several separate components are used at the project, which together must give some expected result, it is important not only their presence, but also fine-tuning to ensure the best effect + maximum flexibility. And it is clear that for this it is necessary not only to know them very well, but also to have experience in using them, to know how to do better, what kind of pitfalls there are, etc. But if you give the developer a ready-made site, where everything is already installed and configured, then the ceiling of entry and the amount of work are reduced significantly. This assembly is just a ready online store based on my and standard modules, providing the best performance, flexibility and manageability.
What is already in this build?
Added billing component. Everything connected with orders, payments, etc. is tied to this module.
The basket has ceased to exist separately. Now the Basket is an order that has not yet been placed. Now even orders that are not placed are stored in the database, which at least allows you to see who is interested in, as well as determine the real conversion percentage and identify possible errors.
The Basket component has remained, but almost everything related to the orders themselves has been moved to Billing. Basket will remain a separate module, and in Billing there will be only the necessary minimum of logic. Calculate that the mechanism of the order, payment, etc. can be implemented in any third-party modules that will interact with the billing.
Added and built a new default template using bootstrap. All sorts of ajaksovyh buns and full JS-API.
Added tabular editor of documents.
Added order management.
Added a user's personal account, registration, password change, password recovery, etc.
Login through Login, password change / reset, etc. are configured.
Added modHybridAuth module (authorization via social networks). While Twitter, Facebook and Google are clearly checked, but others should work.
Robokassa payment service is connected .
Configured security policies:
Content manager;
Store administrator;
Store manager;
Advanced store manager.
What to do next with this site after installation?
Make a copy of the template and change everything in it. Templating on Smarty, input data by arrays, all processors on classes. That is, without touching the core, you can redo the site as you like.
An example of how to add more payment systems
Here we have payment through robokassa, and the task is to tie another method of payment. Let's see how this is done.
This is the base processor for any type of payment.
It is abstract and cannot be called up directly, since each particular payment system has its own payment verification mechanisms. But this class already provides all the necessary logic, and expects only one from the expanding processor: confirmation of the correct payment and setting the amount and other payment data.
But the expanding processor specifically for robocassa:
As you can see, this is only 60 lines of code. But as a result, not only will payment be made taking into account who paid, through what, how much, etc., but the status of the order will be automatically changed to Paid. And here to fasten some other payment method - these are just a few dozen lines.
Results
As a result, it turned out really not a very bad engine. I must say that in addition to flexibility, his performance is also not very bad. Just recently, I came across a topic in which people argued that even 40,000 goods were already straining their shops. I made shops on shopModx with tens of thousands of products without any special tricks, and everything works fine. And even if there are hundreds of thousands of goods (I’ve already made one for 150,000 products), then with minor modifications the store will draw so much.
And most importantly: this assembly is completely free! Of course, we are always open to receive donates from grateful developers, but the de facto engine is completely free.
And finally, a video with a brief overview of the engine and two ways of installation.
UPD: One of the new builds is the storage of the basket in the database. More precisely, the basket ceased to be an independent entity, but turned into a display of a new order. At the same time, a new order is just an uncompleted order.
clickable
Slightly more sign for the status of orders:
New. As soon as a user tries to add an item to the cart, if an order has not yet been created for it, a new order is created and the item is immediately added to this order. That is, all orders can be seen immediately, even if the user is not authorized and did nothing else at all. This allows the marketing department to more clearly see the life of the store, calculate the conversion, evaluate the possible causes of user behavior, etc.
Designed. If the user has created an application (that is, he placed an order, specifying his address and other data), then the order status changes to Designed. From this point on, the manager can take an order for himself. (yes, multi-user work is immediately provided for and different scenarios are possible. Now the logic is laid down so that the manager sees only new and his orders. As soon as one manager has accepted the order for himself, another manager will not be able to accept it. Moreover, if the manager does not have rights , he does not even see the contact details of his orders).
Paid. If the user pays for the order on the website, the order status automatically changes to Paid.
Further, some more typical statuses, such as paid, etc.
Notifications about new orders arrive in the mail. (There is a special group of users, each of which receives notifications).
UPD2: Here is the load still made loadimpact.com test. The test is free and it is not known where it comes from (shows downloads for seconds), but anyone can click on the site and make sure that it’s far from 5 seconds. But the schedule is stable, that on one, that on 50 clients. And even on 50 clients the processor was far from full load, yielding most often 10-25%, and only sometimes 50-70%. (hosting digitalocean.com for $ 10).
UPD4: Yesterday we conducted a ShopModxBox webinar, and although the quality of the recording did not work out very well, I post it too (for general reference).