Virtual categories

Virtual categories

Virtual categories

The add-on turns a regular catalog category into a virtual one: products are not linked to it manually but selected by conditions — price, discount, features, stock quantity, creation date, vendor and others. Conditions are combined into groups with "all" and "any" logic, so a single category can describe a selection of any complexity.

What the add-on does out of the box:

  • two modes: virtual, where products are selected the moment the category is opened, and hard linking, where products are actually linked to the category;
  • up to eighteen selection conditions — some of them appear only when the reviews, bestsellers and suppliers add-ons are installed;
  • nested condition groups with a choice of "true / false" and "all / any";
  • linking started manually or by a cron job on a schedule;
  • a combined list of the store categories with a filter by the virtual flag;
  • a filling for the Products block that takes products from a virtual category;
  • transfer of the virtual flag and the conditions along with the category import and export.
This documentation describes add-on version 2.9.0.
Compatibility

The add-on is compatible with CS-Cart 4.3.1 and newer, with such editions as CS-Cart, CS-Cart Ultimate, Multivendor, Multivendor Plus, Multivendor Ultimate.

Some of the selection conditions appear only when other add-ons are installed:

  • Product sales — with the Bestsellers add-on;
  • Product reviews count, Product average rating and It's been days since the last review — with the reviews add-on. On CS-Cart 4.13.1 and newer the add-on works with Product reviews, on earlier versions — with Comments and reviews;
  • Supplier — with the Suppliers add-on.

The Product amount condition takes the Warehouses add-on into account: when stock is split by warehouses, the total quantity is used. Reviews of product variations count as reviews of the whole variation group unless the reviews add-on is set to keep them separate.

Compatibility has also been checked with third-party solutions: the UniTheme2 theme and the AB Category banners add-on.

At the moment there is no information about incompatibility with any theme. In case of a conflict with your theme, please contact our support center.

Add-on installation

After success payment, your order will be automatically marked as Paid within a few minutes. Once order changed to Paid status - add-on License activation passed success and you will received an e-mail with confirmation the receipt of payment and a second e-mail with a  download add-on link. You can also download the add-on in our License Management section of our website. To install the add-on on your website, please follow these steps:

  1. Download the latest version of the add-on on our website in the "License Management" section or via the link sent by e-mail.
  2. Go to Add-ons → Manage Add-ons and in the gear button, select Manual Installation.
  3. Select the downloaded file and complete the installation of the add-on.

Add-on installation is completed. To go to the add-on settings page, select the installed add-on in the top menu Add-ons → CS-Commerce add-on

Add-on management

Once installed, the add-on adds the following to the administration panel:

  • Add-ons → CS-Commerce Addons → Virtual categories — the add-on settings and a combined list of categories;
  • the Virtual categories tab on the category editing page — this is where the product selection conditions are set;
  • the Virtual categories filling for the Products block in layouts.

Most of the work happens not on the settings page but on the page of each category: the add-on has only two global settings, everything else is defined for a particular virtual category.

The sections below walk through these pages step by step.

General settings

The settings are located in Add-ons → CS-Commerce Addons → Virtual categories. The add-on settings button on the Add-ons → Manage add-ons page leads to the same place.

Mode

The global mode, shared by all virtual categories of the store:

  • Virtual (realtime) mode — products are selected at the moment the customer opens the category;
  • Hard linked mode — products are really linked to the category when linking is run.

The default is the virtual mode. The next section explains how the modes differ in practice and which one to choose.

Console command

Shown only in Hard linked mode. This is not a setting but a ready-made cron command for running the linking on a schedule: the add-on fills in the path to the store and the cron password from the CS-Cart settings. Two variants are shown — the console one (recommended) and an alternative one using wget.

Hide virtual categories on pickers

Shown only in the virtual mode. Removes virtual categories from category drop-downs and pickers — on the product editing page, for example. This keeps managers from accidentally linking a product by hand to a category that is filled by conditions.

The add-on settings are shared by the whole store. There are no separate values for storefronts, vendors or Ultimate stores: the storefront switcher is not displayed on the settings page.

Add-on modes

The mode is chosen once for the whole store in the add-on settings and defines when exactly the contents of a virtual category are calculated.

Virtual mode

Products are not linked to the category. When a customer opens a virtual category, the add-on injects its conditions right into the product selection query, and the category is filled at the moment it is displayed.

  • the catalog is not modified: the product keeps its own categories;
  • a change of price, stock or feature immediately changes the contents of the category — nothing has to be recalculated;
  • the category is not treated as empty even if no products have made it there yet, and does not disappear from the menu;
  • promotions and discounts set up for a virtual category apply to the products that made it into the category.

The downside is that every visit to the category runs a heavier database query. On large catalogs with complex conditions this is noticeable.

Hard linked mode

The add-on creates real product-to-category links. The link is an additional one: the main category of the product does not change, the product simply also appears in the virtual category. The contents do not update on their own — linking has to be run.

There are three ways to run it:

  1. the Run virtual linking button in the gear menu on the add-on settings page — all virtual categories are recalculated;
  2. the same button in the gear menu on the category editing page — only this category is recalculated;
  3. by a cron job on a schedule — the ready-made command is shown in the add-on settings.

Categories are processed in the order of the Position field. This allows one virtual category to rely on the result of another: if the second category refers to the first one in its conditions, the first one is already filled by the time the second is processed.

On every run the add-on first deletes the additional links to the categories being processed and then creates them anew. Products for which the virtual category is the main one are not affected.

Lost products

After every linking run the add-on looks for products that ended up with no categories at all and puts them into the service category "Virtual categories" lost products. It is created automatically, disabled, separately for each vendor or store. Products in it are not lost and do not disappear from the admin panel — you can see them and sort them into the catalog by hand.

If you clear the "Make category virtual" checkbox in hard linked mode, the links that were already created stay in place. This makes the mode usable for a one-time automatic distribution of products across regular categories.

A single run links at most 100,000 products to a category.

Setting up a virtual category

A virtual category is a regular catalog category — the add-on does not introduce a separate entity.

  1. Go to Products → Categories and create a new category or open an existing one.
  2. Switch to the Virtual categories tab.
  3. Tick the Make category virtual checkbox — the condition tree appears below it.
  4. Build the selection conditions and save the category.

The condition tree

The tree works the same way as promotion conditions in CS-Cart and is built with the same two links:

  • Add condition — adds a single condition: you choose the product property to select by, the comparison operator and the value;
  • Add group — adds a nested group with its own logic. Groups can be nested without a depth limit.

The header of every group, including the root one, has two drop-downs: true / false and all / any.

"All" means the product has to satisfy every condition in the group (logical AND), "any" means at least one of them (logical OR).
"False" inverts not the group as a whole but every condition in it separately: "equal to" becomes "not equal to", "greater than" becomes "less than or equal to", "like" becomes "not like". The "all / any" logic stays as it is and is not reversed.

The bin icon on the right removes a condition or a group you no longer need.

A category with no conditions

If the virtual flag is on but no condition is set, the category stays empty. This is a safeguard: without it the whole catalog would end up in the category.

Recalculation

In virtual mode saving the category is enough — the contents are recalculated every time it is opened. In hard linked mode the gear menu on the category page gets a Run virtual linking button that recalculates this category right away.

Product selection conditions

A condition consists of a product property, a comparison operator and a value. Every condition has its own set of operators.

Price and discount

  • Product price — the base price of the product, without user group and quantity discounts. In the Ultimate edition, if the storefront has its own price, that one is used. Operators: equal to, not equal to, greater than, greater than or equal to, less than, less than or equal to.
  • Product discount (%) — the discount in percent, calculated from the list price of the product. Handy for categories like "30% off and more". The operators are the same.

Catalog

  • Categories — the product is or is not in the selected categories. Nested categories are taken into account: by picking a parent you capture its whole subtree. Categories are chosen with a picker; only active and hidden ones are used.
  • Products — a list of specific products chosen with a picker: "in" or "not in". Useful for adding or excluding individual items by hand.
  • Product feature — you first choose the feature and then its value. For the "in" and "not in" operators several values can be selected at once. If the value is left empty, the condition checks whether the product has the feature at all.
  • Product name — a substring search in the name in the current language. Operators: like, not like.
  • Product weight — in the weight units of the store.
  • Vendor — products of the selected vendors or stores, chosen with a picker.
  • Supplier — only with the Suppliers add-on installed.

Stock and availability

  • Product amount — the quantity in stock. With the Warehouses add-on enabled and stock split by warehouses, the total quantity is used.
  • Out of stock actions — what the store does with a product that is out of stock: None, Buy in advance or Sign up for notification. Operators: equal to, not equal to. The condition appeared in version 2.9.0 and, combined with the stock quantity, allows building a pre-order category.

Time

  • Product create date — a comparison with a specific date picked in the calendar. Operators: greater than, greater than or equal to, less than, less than or equal to.
  • Product created, days — how many days have passed since the product was created. Operators: greater than, less than. More convenient than the previous one for categories like "New arrivals of the last 30 days": the date does not have to be changed by hand.

Popularity, sales and reviews

  • Product popularity — the popularity rating accumulated by CS-Cart: views, adding to cart, purchases.
  • Product sales — only with the Bestsellers add-on installed.
  • Product reviews count — the number of approved reviews.
  • Product average rating — chosen from the values 0 to 5.
  • It's been days since the last review — how many days the product has gone without a review. The condition appeared in version 2.6.0.

The last three conditions require the reviews add-on to be installed.

Conditions can be combined: an "all" group of "Product amount greater than 0" and "Product discount (%) greater than or equal to 20", for example, gives a sale category built only from what is actually in stock.

Category list and access rights

The Manage categories item in the sidebar of the add-on page shows a combined list of the store categories, twenty per page.

For every category you can see:

  • the name and the full path in the catalog;
  • the Is virtual flag — yes or no;
  • the status of the category, which can be switched right here.

The name leads straight to the Virtual categories tab of the editing page, so you do not have to reach the conditions through the catalog.

The sidebar has a search by name and an Is virtual checkbox. Tick it to leave only virtual categories in the list: this is the fastest way to see what the add-on is set up to do in the store.

Access rights

The add-on adds the Manage Virtual categories add-ons privilege group with two privileges: view and manage. They are configured in user groups (Customers → User groups) in the Add-ons section with the standard CS-Cart tools, so an employee can be given read-only access.

By default the privileges are not granted to anyone except administrators with full access. The virtual flag and the conditions on the category page are protected by the usual category editing privileges.

Displaying products in a block

The products of a virtual category can be shown anywhere on the storefront as a block, without opening the category itself.

  1. Go to Design → Layouts and choose the layout and the page you need.
  2. Add a Products block or open the settings of an existing one.
  3. Choose Virtual categories as the filling.

The filling has four fields:

  • Category — a drop-down that lists virtual categories only, each with its full path in the catalog;
  • Sort by — date, name or price;
  • Sort order — ascending or descending;
  • Limit — how many products to show in the block, five by default.
The filling works in both modes: in the virtual mode products are selected by the conditions at the moment the block is rendered, in the hard linked mode the existing links are used.

Import and export

If our Import/export categories add-on is installed in the store, the virtual flag and the selection conditions travel together with the categories. Two columns appear in the category file:

  • IsVirtual — whether the category is virtual;
  • VirtualConditions — the whole condition tree in JSON format.

This makes it possible to move virtual categories between stores and to change the conditions of many categories at once by editing the file. The feature appeared in version 2.5.1.

The conditions store internal identifiers of categories, products, features, vendors and suppliers. When moving to another store these identifiers have to match, otherwise the conditions will have to be built again.

Upgrade an add-on

In order to have access to add-on upgrades, you must have an active upgrade subscription. If the subscription period has expired, you will only have access to upgrades released before the expiration date of your subscription. You can renew your upgrades subscription in the "License Management" section on our website.

The add-on supports instant upgrades via the CS-Cart Upgrade Center. The built-in CS-Cart Notification Center (bell) will notify you about new versions release of the add-on. Upgrades via Upgrades Center will allow you to switch to a newer version without losing add-on data and settings.

Before start an upgrade process, it is highly recommended to make a full backup of the site (database and files) of your store using the server or hosting methods. 

 Upgrade through the Upgrade Center

  1. In the top menu, go to Administration → Upgrade Center;
  2. In the gear menu, click "Refresh available upgrades"
  3. Find and add-on on list of available upgrades and click the Download button and than Install button;
  4. Follow all the instructions that will be shown during the upgrade process;
  5. It is recommended to clear the CS-Cart templates cache after the upgrades are installed by deleting the var/cache folder on your server or adding the ctpl parameter to the address bar (example: https://domain.com/admin.php?ctpl).

Addon Reinstallation by uninstall old and install new:

Reinstalling an add-on means deleting the add-on's settings and data. Reinstallation will allow you to get a clean installation of the latest addon version. To reinstall the add-on with saving the add-on settings and data, please contact us via our Support Center to provide this service.

To completely reinstall an add-on without saving data, follow these steps:

  1. Go to Add-ons → Manage add-ons and find the old installed add-on.
  2. Click the delete button in the gear menu of the add-on.
  3. Download the latest version of the add-on on our website in the "License Management" section.
  4. Go to Add-ons → Manage add-ons and in the gear menu select Manual Installation. Select the previously downloaded file and complete the installation of the add-on.

Technical support

The technical support of the add-on is already included in its price. Before contacting the support center, please make sure you are using the latest released version of the add-on. Old versions of the add-on are not supported by technical support.

To use our technical support, follow these steps:

  1. On our support center site https://helpdesk.cs-commerce.com/, log in with your account;
  2. Click on the "Create ticket" button;
  3. Fill in all the required fields and create ticket (you will receive a confirmation email);
  4. Expect a response from a specialist (a notification will be sent to your e-mail about the response) in accordance with the regulations of the technical support service.

If you have not received an answer within the time frame specified in the regulations, write us a message to the e-mail [email protected] with the subject of the ticket and we will try to resolve your issue as soon as possible.

Technical support via chat on the site, direct phone calls or e-mail letters is not provided. All help discuss goes through the support center. Carefully study the documentation for the add-on and the terms of technical support before creating a ticket. 

Limitations and Warnings

We recommend that you familiarize with the general restrictions:

  1. Fragments of code or some files of an add-on may have a private (encoded) part. The coded part does not create problems on add-on customizations;
  2. The add-on will work only on those domains that are specified in the user's license. If you try to use the solution the domains of which are not included in the license, the add-on will be automatically disabled;
  3. Installing on local machines is not allowed by the licensing system. For the add-on to work on an additional domain (alias), specify this alias on the license management page. Up to three aliases are allowed per domain for testing and development purposes. You can change the main license domain yourself on the license management page.
To have possibility to add or change license domains and aliases, the upgrade subscription must be active. To change the license domain of an expired upgrades subscription, you must first renew your subscription.  

 

Changelog

Version 2.9.0 of September 2, 2026

  • [+] Added the "Out of stock actions" condition: a category can be built from products available for pre-order or notification sign-up, including together with the stock quantity condition;
  • [+] Added compatibility with the third-party AB Category banners add-on;
  • [*] Optimized the scheduled linking of products to virtual categories: the run completes noticeably faster and puts less load on the server.

Version 2.8.1 of April 9, 2026

  • [*] Function optimization for better performance;
  • [*] Basic add-on security updates.

Version 2.8.0 of January 29, 2026

  • [+] Added the "not like" condition for the product name;
  • [!] Fixed product selection for the virtual category block on some site configurations;
  • [*] Basic add-on security updates.

Version 2.7.1 of October 3, 2025

  • [*] Added logic that prevents loading the whole catalog into a virtual category when no conditions are set.

Version 2.7.0 of May 14, 2025

  • [*] Basic add-on updates;
  • [*] Products lost during hard linking are automatically moved to the "Virtual categories" lost products category;
  • [!] Fixed an SQL query error in the virtual linking mode with the "Product price" condition in the CS-Cart Ultimate edition.

Version 2.6.1 of March 22, 2025

  • [!] Fixed a database error that occurred at random when building category conditions.

Version 2.6.0 of October 30, 2024

  • [+] Added the ability to filter products by the number of days passed since the last product review.

Version 2.5.1 of September 3, 2024

  • [+] Added import and export of the virtual flag and the virtual category conditions when the store also uses our Import/export categories add-on;
  • [*] Basic add-on security updates.

Version 2.5.0 of February 1, 2024

  • [!] Fixed the logic of negative feature conditions;
  • [*] Improved the linking of products to a virtual category;
  • [*] Basic add-on security updates.

This is an important update, install it as soon as possible.

Version 2.4.4 of October 12, 2023

  • [!] Fixed the behaviour of the add-on after a virtual category was deleted.

Version 2.4.3 of September 1, 2023

  • [!] Fixed a database conflict with certain combinations of features in virtual category conditions.

Version 2.4.2 of July 17, 2023

  • [*] Basic add-on security updates.

Version 2.4.1 of July 11, 2023

  • [!] Fixed an error in the hard linking script.

Version 2.4.0 of June 30, 2023

  • [+] In hard linked mode categories are processed in the order of the "Position" field, so that some virtual categories can be built on top of others.

Version 2.3.8 of May 2, 2023

  • [+] Added a check that prevents an error when the virtual category conditions are filled in incorrectly;
  • [+] Added compatibility with variation product reviews.