📜 ⬆️ ⬇️

Shop-Script 5 Review

Hello! I lead the development of Shop-Script . During the year I collected questions that arise for users and developers who start working with Shop-Script 5 (the latest version of the product), and in this post I designed them as a separate review article. Promo site is a promo site, documentation is also sometimes useful, but it is always easier to get acquainted with the product by reading or skimming through just one article. Under the cut - a detailed review of Shop-Script 5 with a description of key features and how the engine works, 5 MB of screenshots, some statistics and plans for the future.




')
Shop-Script 5 is designed to create retail online stores. To understand the portrait of a typical online store, for which Shop-Script 5 will be useful, you should submit a company with a small staff that is located in a large Russian city, has several warehouses (for example, office, warehouse and point of sale), works with 1C delivers orders by courier and mail. The platform is flexible and can be used for online stores in any country, but the most common type of companies that use Shop-Script 5 today corresponds to just such a portrait.

Shop-Script 5 demo : showcase , backend (enter any username and password to enter the backend)
Download : .tar.gz (4.5 MB) or on GitHub (private repository, access is granted to all developers to fill out the form)
Product site: http://www.shop-script.ru/

Installation


Shop-Script 5 is an application based on the Webasyst framework . Developed based on PHP 5.2+ / MySQL 4.1+ / Smarty / jQuery.

To install Shop-Script 5, you need to download the distribution kit (4.5 MB; the archive already includes the framework and Shop-Script 5), copy all distribution files to a folder on the server, then open the installation script in the browser and enter the database access data.







Detailed installation instructions .

If you do not want to install anything, you can try Shop-Script 5 in action by creating a test store in a web service on the product site.

Start using


Backend (admin):



Front-end (shop window):



You can add products in different ways: one by one via the web interface or you can import many products at once from a CSV file, a YML file (Yandex.Market), 1C, or even drag a pack of photos into the browser. The ability to import from a set of photos is especially useful when there are already many ready-made photos of goods (DIY stores, hand-made), and all that remains is to come up with names and set prices.



Interface


Let's skip the boring part of importing goods and immediately see the backend interface with demo content:











Redactor is used as a WYSIWYG editor. Code Editor - based on Ace .



Default theme of store design with goods:



The default design theme immediately "out of the box" supports many useful features, such as Schema.org micromarking , adaptive design, automatic support for @ 2x-pictures of goods for Retina.

Backend and frontend are best seen in the demo .

File structure and MVC


Shop-Script 5, like any Webasyst based application, is designed in accordance with the MVC design principle. All requests to the backend and the frontend pass through index.php and are further routed according to the routing rules: first - by application, then - by action inside the application.



Read more about how Webasyst applications work in the documentation .

All the code Shop-Script 5 - in the folder wa-apps / shop /



The implementation of all the basic logic of Shop-Script 5 operation is in lib / actions / (screens), lib / classes / (objects) and lib / model / (work with data).

Data structure


The database has 60 tables. General ER-chart of Shop-Script 5:



The product management model is designed to work with various independent types of products within a single store. You can sell in one store, for example, and household appliances, and shoes, while the interface management of goods will not be overloaded.

The main entities on which the management of goods is based:

Type of goods
They serve the internal classification of goods and the independent organization of sets of various characteristics (properties) of goods, the division of goods into showcases (different sites). Example: Household appliances, Auto parts, Shoes.
Product
What is presented in the showcase as a logical single product on a separate page of the online store. This product can belong to only one type.
Example: iPhone 5S
vendor code
This is what you can put in the basket and order. Each product can have many articles. For the article set the price, the balance of the stock.
Examples:
iPhone 5S Gold 16GB , iPhone 5S White 32GB
Product Category
External classification of goods. Each product category has its address on the storefront and can be published (or hidden) on different storefronts of the online store. A category can be static (typesetting) or dynamic (based on some rule). Categories can be nested in each other.
Product List
Allows you to embed separate lists of products in the design templates or on arbitrary information pages of the site. Example: special offers in the slider in the window or in the side column.

The most interesting features


Shop-Script 5 provides a large number of features at once out of the box, many features can be added using plug-ins, and listing them all here will be meaningless. For the sake of completeness, I will mention some of the key features:


Yandex.Market, data exchange with "1C: Trade Management", support for all major payment systems, etc. - A description of all features is better to look at the product site .


Themes of design: fasten your design


wa-apps / shop / themes / THEME_FOLDER / - the original design theme files, which are completely updated (overwritten) when the design theme is updated.
wa-data / public / shop / themes / THEME_FOLDER / - modified custom design templates that, when updated, do not change the theme (essentially fork).

If there is a copy in wa-data / public /, then it will be used; if not, then the original is from the wa-apps / application folder.

Each design theme is a separate folder with a set of HTML / Smarty templates, CSS, JS, pictures and theme.xml description file.

To implement your design, the easiest way is to use the built-in design editor in which you can edit the basic settings of the design theme (they are defined in theme.xml):



And each individual design theme template (HTML, CSS, JS) directly in the browser:



One of the coolest features of design themes is the ability to get data from another application in the design pattern of one application. For example, in any application you can make such a call - {$ in_the_cart = $ wa-> shop-> cart ()} - and get into the variable {$ in_the_cart} an array of all the goods in the user's basket. Or from another application, for example, from the Blog: {$ best_posts = $ wa-> blog-> posts ('/ tag / best')}.

Plugins: expanding the basic functionality of an online store


The basic functionality of Shop-Script 5 is extended with the help of plug-ins, the implementation of which is located in the wa-apps / shop / plugins / subfolder

To create your own plugin, run in the console:

php wa.php createPlugin shop brands 

Running this command will create in the Shop-Script 5 folder the necessary file structure for the plugin, which is similar to the structure of the application itself: img, js, lib, templates. The architecture of the plug-in almost completely repeats the architecture of the application, all the same MVC and the same approaches.



Plug-ins "cling" to the main functionality and are embedded in Shop-Script 5 using events and hooks. For example:

1. Find a suitable hook in the documentation . Suppose you need to display something in the navigation block in the storefront - the frontend_nav hook is responsible for this.

2. In the lib / config / plugin.php application config file, declare a method that listens for the event associated with this hook:

 'handlers' => array( 'frontend_nav' => 'frontendNav', ), 

3. We write code and output HTML directly in PHP (if HTML is simple):

 <?php class shopBrandsPlugin extends shopPlugin { public function frontendNav() { $feature_id = $this->getSettings('feature_id'); $feature_model = new shopFeatureModel(); $feature = $feature_model->getById($feature_id); if (!$feature) { return; } $values = $feature_model->getFeatureValues($feature); if (waRequest::param('type_id') && is_array(waRequest::param('type_id'))) { $types = waRequest::param('type_id'); } else { $types = array(); } $existed = $this->getByTypes($feature['id'], $types); $html = '<ul class="menu-v brands">'; foreach ($values as $v_id => $v) { if (in_array($v_id, $existed)) { $url = wa()->getRouteUrl('shop/frontend/brand', array('brand' => str_replace('%2F', '/', urlencode($v)))); $html .= '<li'.($v == waRequest::param('brand') ? ' class="selected"' : '').'><a href="'.$url.'">'.htmlspecialchars($v).'</a></li>'; } } $html .= '</ul>'; return $html; } 

Or we transfer the data to the template, we define the formatting in the template:

 $this->view->assign('features', $values); 

And then we output in it in {foreach $features as $key => $val} … {/foreach}

See the detailed tutorial on developing the Brands plug- in in the documentation .

Applications: extend functionality even further.


If the functionality of plug-ins is not enough and you need to write your Shop-Script 5 to do something more ambitious, you can create a separate Webasyst application that appears in the main navigation menu and will work independently of Shop-Script 5.



Like the plugin, you can also create your own dummy application from the console:

 php wa.php createApp mysupercoolapp -name " " -version 0.0.1 

Depending on the specifics of your customers' requests, you will be able to create applications with any logic of work: procurement, project management, traffic jams, routes, a farm.

Look at the detailed guest book development tutorial or ready-made applications for an example.

API


Shop-Script 5 provides 44 API methods for reading and writing data from the outside.

Authorization is based on the OAuth 2.0 protocol. Data exchange formats: JSON and XML.

Depending on the method, the call is made via GET or POST. For example, a method for reading product data: http://demo1-ru.webasyst.com/api.php/ shop.product.getInfo? Id = 65

Introductions and statistics


The largest implementation: Enter Svyaznoy . Shop-Script 5 is used in the infrastructure of the Enter Svyaznoy as a CMS .

At the moment, more than 3,500 licensed installations of Shop-Script 5 have already been registered (free and trial installations are not considered). Despite the fact that the total number of online stores operating on the basis of old versions of the product still significantly exceeds the number of users of Shop-Script 5 ( according to Ruward , today there are 18,600 sites), the dynamics of the transition to the new version is growing.

More than 700 developers have already got access to the Shop-Script 5 private repository on GitHub .

Market


Webasyst store is a market where any developer can publish solutions based on the Webasyst framework. Our commission for presenting the product on the Webasyst website and in the Installer (client application for installing new applications), installing and delivering updates to users is only 20%.

At the moment, our development partners have published 11 applications in the Webasyst store, more than 150 plug-ins and 40 design themes.

Total sales of developers have already exceeded 12 million (!) Rubles , and this is only for the first nine months of the market. The most popular plug-ins and themes of the Shop-Script 5 design: plugin developers earned more than 6 million rubles, more than 5 million rubles designers of the project, and about half a million rubles developers of applications (although the growth potential of applications is certainly the largest).

We invite developers and designers to create products that the owners of Shop-Script 5 and Webasyst users will gladly buy: www.webasyst.ru/developers/store

Licensing


Shop-Script 5 is a paid CMS. To open a running online store, you need to purchase a license worth 9,999 rubles or use a web service worth 798 rubles per month (599 rubles for Shop-Script 5 without access to the source code + 199 rubles for hosting: 2 GB, SSL, domain, and more .d.)

For developers, the license is free.

When developing Shop-Script 5, we considered various monetization options, including the full transition to the open source distribution model, but as a result, we did not implement this option in the final solution for online stores (not in Shop-Script 5), but in its basis and the common platform on which it works - the Webasyst framework - and satellite applications that currently complement the functionality of Shop-Script 5 (although these applications themselves are also full-fledged solutions for their tasks, attitudes and their positioning bye enes still around online stores - I'm talking primarily about the "application site ", " blog " and " Photo ").

about the project




This year, the Shop-Script project is 12 years old. The first version of Shop-Script 1.0 was released back in 2002, and today's generation is already the fifth in a row. Who cares, read the history of the project .

Yes, we know that the outdated versions of Shop-Script products are not very popular among developers, designers, and desktop users. Indeed, there is a reason. Therefore, Shop-Script 5 and the Webasyst framework were developed from scratch and inherited from the old versions only the name and experience.

Little about development plans


It will be boring to talk about specific features that will appear in the next Shop-Script 5 updates, and it is better to say about the general direction of the platform development - these are tools that will help end users to manage not the content, but the development of the business, better evaluate the performance of the company and analyze how boost sales.

For example, in the next versions in the basic version of Shop-Script 5 we will implement support for evaluating the liquidity of goods: instead of the list of best-selling goods, you can work with a more meaningful (in terms of profit) list of the most liquid and profitable products: including and sales during the last time, and the purchase price, and the cost of storage - all this in the basic version of the CMS without any additional analytical applications. This will allow store owners to know better the structure of their sales: to monitor not only what product they buy better, but also on what is more likely to make a profit.

In addition, applications for CRM, customer support, business organization, teamwork, etc. Gradually, the CMS functionality will be added to the intranet functionality. Webasyst has everything for combining these two areas in a single interface.

Thanks for attention!

We invite developers


We invite developers to collaborate on new applications: register in the program for developers and create your own useful tools. We will be pleased to advertise interesting projects on the main page of the Webasyst store (market) and in our blog. Shop-Script 5 already has a large audience who are happy to buy quality and useful solutions!

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


All Articles