In this article, we describe how to create a utility that combines the capabilities of an order controller, statistical reports on site attendance and information on the current state of the shopping basket. The utility will be of interest to managers, managers of IM, who want to get more information about what is happening with customers on their sites.
The basis of the already working PHPShop modules were:- Order Agent Controller API, which allows you to manage orders in real time.
- The Stat module, which records every step of visitors and gives statistics on site visits, by analogy of well-known informers Yandex-metrics and others.
- VisualCart module. This module allows you to keep the shopping cart is not in the browser session, and in the store database. At any time the basket will be restored from the database if the user has closed the browser. It also carefully stores the information that is now added to users in the baskets and allows you to operate with this information.
So, we have potatoes and onions. What do we have to fry them on? At the moment we are actively using Delphi for implementing graphical utilities. Previously, we widely used the language Gentee.
The trick is that we wrote our request format for remote database management, based on the
XML-RPC format and our own PHPShopOrm library. This library receives / returns in a certain way the generated XML, with the commands embedded in it, and passes all this through the ORM, receiving a clear SQL query at the output, observing all the subtleties and rights to data management.
')
In other words, to ensure security, dependencies are specified for the request. They indicate which tables can be used to collect information and which commands should be executed with the table. If sampling by goods is allowed, changing the system settings and editing the order table is prohibited. For example, our
partner module allows you to operate with the database of goods, but access to it in the tables of users or orders is denied. Thus, we get all the necessary information from our modules.
So, if someone from the readers was engaged in cooking, he knows that you need to pour oil not a lot and not a little, otherwise everything will burn, or it will be slowly prepared. In our case, the amount of oil determines the server ping / polling parameter for receiving information - it can be controlled from 1 second to N. This will unload the server and at the same time receive fresh data from it.
Voila! A dish called "fried potatoes" is ready.

What prompted us to make the "Monitor"?
We communicate daily with our customers, and from all our users we have identified a circle of clients who do not have certain knowledge to manage the store, but who want to have a general picture of what is happening on the site. This group can be called "managers-managers". In fact, they do not need to sit in the admin panel with a bunch of functions to edit orders - it’s convenient for them to have before their eyes a summary of what is happening on the site. Therefore, we called the utility "Monitor".
On the other hand, there are users whose eyes are full of all kinds of programs and reports, and their daily routine work: “come here, log in, press a button, go here, log in, look at the report ...” - agree, it tires. By “monitor” we have brought together the most important reporting functions into a single program. Need to see what was ordered in the order? -You are welcome! Print the order form? - Here he is! Calculate how many visitors are currently on the site? - You are welcome. All messages hang in the tray and always keep the user informed of what is happening.
In addition, all reports and messages are customizable: you can turn off unnecessary ones, change the order form and logo.
By the way, the idea to simplify the work of managers and couriers we visited before: according to the same plan, at one time, the
Windows Order Agent ,
Mobile Agent ,
Windows Order Gaget ,
1C Monitor were used, and to this day. So, there are no difficulties with the implementation right now - all the server polling functionality has been honed on previous utilities.




Development plans
We are not going to stop at this: we are planning to give delivery and purchasing departments the opportunity to connect to this monitor. We want to allow them a couple of clicks to place orders with accompanying documents, find the right product and immediately advise the buyer on the properties of the product. For managers, it is planned to bring the correspondence, which the managers have in
Chat , to the tray, so that managers can quickly adjust the answers to customer questions.