The new version OkayCMS 3.1.0
OkayCMS 3.1.0 released
There were quite a few changes, mostly of a technical nature. But so far we have done 80% of what we wanted from modularity. In the coming week, we will do a voluminous, but not too complicated work on modularity, and at the same time we are preparing documentation so that site developers would understand how to make modules for the new version now.
In the meantime, I will superficially, in simple language, try to explain what has been done.
Made modularity of delivery methods
For an illustrative example, we also made a New Mail module. Looking at it, you can, by analogy, understand how the delivery modules work. By making the delivery modular, we also reworked the ajax in the cart so that not the entire HTML changes, but only the elements we need.
Made the so called "modularity of shortcodes".
This is the ability to display certain functionality in the site design by inserting a shortcode in a specific place. For examples of this implementation, we made the "Quick order" module (order in 1 click), and also redesigned the banners. Now banners are a separate module with more functionality than before. This should be discussed separately.
Banners module
First, the settings for banner groups have been moved to the admin. panel. Now you don't need to call programmers for every sneeze and dig into the code.
Secondly, now banners are inserted into the design with one short shortcode, rather than a large piece of code.
Thirdly, it is possible to get an individual shortcode for a group of banners and display this group by text in the description of a product, category, brand, blog entry or just on the page.
Fourth, options for displaying text on the banner have been made.
Modularity of blocks in the admin. panels.
An opportunity was made to add module blocks to different places in the admin panel. For this, pages were marked up in the admin. panels and in the right place in the admin. panel, you can call the display of a specific module. If you enable developer mode in config / cofig.php (dev_mode = true), then such places will be highlighted in red. At the moment, such places have been created only in the product and on the order page, but in the next versions we will cover the entire system with such functionality. As an example, now a functional button "Upload to XML" has been added to the list of products
Modularity of configs
With the release of the current version, it became possible to extend the configuration data located in the config / config.php file through new system modules. To do this, you just need to create a file in the module located at the same address, namely config / config.php relative to the root directory of your module. It should be noted that this functionality works only for expanding configurations, but not for modifying the current state of the main config.php of your project. If you try to modify any parameter in the root configuration file, an exception will be thrown indicating the parameter you are trying to modify.
Indexing Module Tables
Now you can assign indexes to tables that are initialized by installing modules. It should be noted that indexing is currently only possible on one column, which excludes the possibility of adding composite indexes to these tables at the installation stage. In the coming versions, we plan to implement support for composite indexes.
Implemented the functionality of hooks through classes of the Extender type
Extender is a class through which you can extend the functionality of the system, namely the implementation of certain methods in the specified classes. It works as follows. You choose the method of the class you want to extend. Then you check if at the end of the implementation of this method there is an Extender call (for example: ExtenderFacade :: execute (s_METHOD__, $ returnData, func_get_args ()). Suppose this is a method for getting the cart object Okay \ Core \ Cart :: get (). After this you create a class inside your module that will modify the result of Okay \ Core \ Cart :: get (). Let's call this method Okay \ Modules \ Vendor \ ModuleName \ CartExtension :: initCustomDiscount ($ returnCart ) . The created method takes as the first argument the result of Okay \ Core \ Cart :: get (), then modifies it in the way you need and sends the changed object to the output. In our case, this will be the accrued discount. After that we register this method in Init / Init.php of your module in the init () method and now after the Okay \ Core \ Cart :: get () method has worked, the method we have registered will execute. There can be more than one of these methods and they will be processed in the priorities of the modules in the list of the admin panel.
Extending the admin menu from modules
The module now has the ability to create its own menu items in the admin panel on the left. You can see an example of implementation in the OkayCMS \ FAQ and OkayCMS \ Banners modules. If the root item does not have an image, then the first letter of the module name is substituted in its place.
Expanding the settings for working with out of stock items
The following selection has been added to the Settings - Directory Settings section:
Missing products: Show as standard / Move to the end of the list / Hide in the catalog
If the first option is chosen, we do nothing.
If the second option is selected - in the client part in the catalog, we first display the goods that are in stock (quantity is greater than 0), and then the goods are out of stock.
If the third option is selected, we hide such products from the list in the catalog, but leave them available via a direct link.
Missing products are those products in which all variants have a quantity of 0 or negative. If at least one product variant has a quantity greater than zero, it means that such product is in stock.
Products will be moved to the end of the list only in the client area. In the admin. panel sorting will be the same as it was.
Products hidden for display in the catalog will be available to customers and search engines when they click on a direct link.
Added "Training" section
Added a training section, which contains instructions for basic work on the site. This section will be useful for those who are working with OkayCMS for the first time and will relieve the burden on webmasters of training users to work with the system. The information in this section will be updated and added over time.
Other things that have been done in the new version
Improved PageSpeed metrics, especially for the desktop version. But this is not the limit, there will still be work on it.
Replaced materialdesignicons font icons with lighter weight ones
Added display of viewed products
Fixed the incorrect link to the buyer's page from the order (the problem is described here )
Fixed the situation when the specified phone was not displayed in the design settings, but was shown on the site
Fixed the situation when between links to social. an empty line was added to the network, which led to incorrect display of links on the site
Fixed the length of the IP field in the database so that there were no problems with IPv6 addresses
Fixed the problem with cleaning the directory described here
We reworked the loading of product images, removed the old code.
Fixed rating work
Fixed the YandexKassa payment module, added a button to go to payment
Fixed the work of the PayKeeper payment module
Made the correct sending of order statuses by mail
Redesigned the ajax in the cart so that not the entire HTML changes, but only the elements we need
Fixed several translations for templates
Fixed PHP version check in the installer
Fixed the work of shutting down the site through the admin. panel
Fixed a couple of notes on how TinyMCE works with images and videos
You can download the new version by following the link archive with changes in comparison with 3.0.3 by the link
Changes from the config / config.php file need to be transferred manually, and not by replacing the file
The file in the 1DB_changes folder is a request to the database