Getting Started

Welcome to the Dynamic Category documentation.

Whether you are a new or an advanced user, you can find some useful information here.

Go ahead, dive in!

Firstly, please, find our extension in My Downloadable Products section of our store. Learn how to install extension, and proceed with Quick Start, which will guide you to set up your Dynamic Category service.

How to install the extension

How to install the extension using composer

  1. Backup your store's database and web directory.
  2. Login to the SSH console on your server and navigate to the root directory of the Magento 2 store.
  3. Copy the installation instructions from the page My Downloadable Products to the SSH console and press ENTER.
  4. Run command php -f bin/magento module:enable Mirasvit_Core Mirasvit_DynamicCategory Mirasvit_Merchandiser to enable the extension.
  5. Run command php -f bin/magento setup:upgrade to install the extension.
  6. Run command php -f bin/magento cache:clean to clean the cache.
  7. Deploy static view files

    rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy

How to install the extension manually

  1. Backup your store's database and web directory.
  2. Download archive from My Downloadable Products.
  3. Unzip the extension locally.
  4. Copy unzipped folder to the root directory of the Magento store.
  5. Run command php -f bin/magento module:enable Mirasvit_Core Mirasvit_DynamicCategory Mirasvit_Merchandiser to enable the extension.
  6. Run command php -f bin/magento setup:upgrade to install the extension.
  7. Run command php -f bin/magento cache:clean to clean the cache.
  8. Deploy static view files

    rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy



Dynamic Category

The Dynamic Category extension automatically assigns products to categories. It frees up store managers’ time and reduces the potential for error when assigning products to categories.

Checking if the extension is active

In the Magento admin panel sidebar, navigate to Stores > Configuration > Mirasvit extensions > Developer. Verify that Mirasvit_DynamicCategory in ON.

image

If the extension is OFF, then run in the command line interface the fifth command in the list How to install the extension manually: bin/magento module:enable Mirasvit_DynamicCategory.

image

Automatically assign categories

Navigate to Catalog > Categories using the Magento admin panel sidebar. Locate the existing category or add a new subcategory where you want to use the automatic category assignment.

image

While editing this category, expand the drop-in menu Products in Category. Activate the Dynamic Category option and create the conditions for automatic product selection. Specify these conditions under the section Products Selection Conditions.

Press the Save button to commit changes.

Using additional custom product attributes

With the Dynamic Category extension, you can use product attributes beyond the standard list. To apply the attributes your store created, they must have activated the option Use for Promo Rule Conditions.

image

Navigate to Stores > Attributes > Products and select the attribute you need to use for dynamic categories. On the attribute page, open the tab Storefront Properties and scroll down the page to the option Use for Promo Rule Conditions. Move the option activation switch to Yes.

image

Using smart attributes and Multi Source Inventory 

In addition to default Magento product attributes, the Dynamic Category extension creates a set of its own attributes to use in conditions for assigning products to the category. These are:

  • Is New

  • Has Active Special Price

  • Rating [1...5]

  • Number of reviews

  • Source

image

Is New

The attribute Is New monitors the product attribute Set Product as New From. It assigns the product to the category if the current date is between the dates specified in attribute Set Product as New From for the particular product.

image

The standard Magento New attribute is applied to products that have activated the attribute option New.

image

Has Active Special Price

With this attribute, a product can be assigned to a category if the current date is in between the dates of Special Price From parameter. This parameter is located on the Advanced Pricing page.

image

Rating [1...5]

Using this attribute, you can segregate products with the desired user rating. You can specify decimal fraction number from 1 to 5 and condition that the product rating was exactly that specified number, higher or lower.

image

Number of reviews

Assign products that have a specified number of user reviews.

image

Put only an integer number if you want to match the exact number of reviews using the condition is.

Source

For multi-channel inventories, you can select products that are located in the same physical location (warehouse, brick-and-mortar store, drop shippers, distribution centers, etc.).

image

When using the Source parameter, you can specify only one source at once. Add the new Source parameter to add one more source to condition.

Quickly distinguish dynamic categories

You can easily see which categories have the dynamic category option activated. Such categories in the category tree have a green dot in the left upper corner of the folder icon.

image

Updating indexers

Categories should be automatically updated as the changes are applied when the Save button is pressed.

If the category is still displayed as empty on the frontend of the store, navigate to System > Tools > Index Management. Check to see if the Category Products indexer needs reindexing.

image

To reindex in command line interface, execute the command bin/magento indexer:reindex. This command reindexes one time only. To keep indexers up-to-date, you must set up a cron job.

image

Note

You can reindex dynamic categories with the following command:

bin/magento mirasvit:dynamic-category:reindex

Dynamic category usage example

The task is to segregate available products for physical activity into their own category.

To do so, create a new category Activity as a subcategory of a Default Category. Read the Magento User Guide on Creating Categories for detailed instructions.

image

The new Activity category is empty for now:

image

To automatically fill it with products, activate the dynamic category switch in the drop-in menu Products in Category and this will activate the availability of the option Products Selection Conditions.

image

Specify the condition as:

  • Product attributes – Activity

  • is one of

  • exact value

  • specify the activity (Hike, Outdoor, Running, Gym, Climbing, etc.)

image

Press the button Preview Products to look at the item that will be automatically placed in the Activity category. If some products are missing or wrongfully present – edit the Products Selection Conditions accordingly.

When finished editing the conditions for automatic product assignment for the category – press the Save button.

How to upgrade extension

To upgrade the extension, follow these steps:

  1. Backup your store's database and web directory.
  2. Login to the SSH console of your server and navigate to the root directory of the Magento 2 store.
  3. Run command composer require mirasvit/module-dynamic-category:* --update-with-dependencies to update current extension with all dependencies.

    Note

    In some cases, the command above is not applicable, or it's not possible to update just the current module, or you need to upgrade all Mirasvit modules in a bundle. In this case, the command above will have no effect.

    Run instead composer update mirasvit/* command. It will update all Mirasvit modules installed in your store.

  4. Run command php -f bin/magento setup:upgrade to install updates.
  5. Run command php -f bin/magento cache:clean to clean the cache.
  6. Deploy static view files

    rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy

Disabling the Extension

Temporarily Disable

To temporarily disable the extension please follow these steps:

  1. Login to the SSH console on your server and navigate to the root directory of the Magento 2 store.
  2. Run the command php -f bin/magento module:disable Mirasvit_DynamicCategory Mirasvit_Merchandiser to disable the extension.
  3. Log in to the Magento backend and refresh the store cache (if enabled).

Extension Removal

To uninstall the extension, please follow these steps:

  1. Login to the SSH console on your server and navigate to the root directory of the Magento 2 store.
  2. Run command php -f bin/magento module:disable Mirasvit_DynamicCategory Mirasvit_Merchandiser to disable the extension.
  3. Run command composer remove mirasvit/module-dynamic-category to remove the extension.
  4. Log in to the Magento backend and refresh the store cache (if enabled).

Change Log

1.3.22

(2024-04-15)

Fixed

  • Use default checkbox does not work on store_view level
  • Issue related with changing position on products grid on several pages

1.3.21

(2024-03-11)

Fixed

  • All products are assigned to the category when it is created

1.3.20

(2024-02-12)

Fixed

  • Issue with updating of category data

1.3.19

(2024-02-07)

Fixed

  • Description of dynamic category was not saved

1.3.18

(2024-01-17)

Fixed

  • Fix an error on product save - The category does not contain the specified product

1.3.17

(2024-01-03)

Fixed

  • Enterprise edition compatibility

1.3.16

(2023-12-18)

Improvements

  • Adding console command to check if product satisfies category conditions

Fixed

  • Changes to the category are not saved

1.3.15

(2023-11-29)

Features

  • Check and handle url_key_already_exists exception

Fixed

  • Cache invalidate during category assigment
  • Consider parent when saving child product

1.3.14

(2023-11-08)

Fixed

  • Enterprice edition compatibility
  • Error on preview button apply

1.3.13

(2023-11-01)

Fixed

  • Sorting issue with merchandizer m2.4.6
  • Fixed manual assigning from the category page

1.3.12

(2023-10-10)

Fixed

  • Sorting issue with merchandiser

1.3.11

(2023-10-02)

Fixed

  • additional check of product and category existence during reindex

1.3.10

(2023-09-25)

Fixed

  • compatibility with php82

1.3.9

(2023-09-25)

Fixed

  • issue related with updating product via API

1.3.8

(2023-09-13)

Fixed

  • Warning: Trying to access array offset on value of type bool in Mirasvit/DynamicCategory/Service/AttributeService.php on line 108

1.3.7

(2023-09-08)

Fixed

  • Smart Attribute "Is Salable"

1.3.6

(2023-09-06)

Fixed

  • If child product is assigned to dynamic category on product save parent product is assigned as well

1.3.5

(2023-08-29)

Fixed

  • Assign dynamic category from product page

1.3.4

(2023-08-25)

Fixed

  • Updated db_schemawhitelist.json

1.3.2

(2023-08-18)

Fixed

  • Issue with quantity condition

1.3.1

(2023-08-10)

Improvements

  • Added a brand-new sub-module "Visual Merchandizer", which provides a more user-friendly interface and allows for visually ordering products within the category
  • Added the ability to manually assign products to dynamic categories, allowing categories to contain both manually added products and products filtered by rules simultaneously
  • Queue status visualization

1.2.28

(2023-07-28)

Improvements

  • Ability to not automatically include the parent product if its child is included in a dynamic category

1.2.27

(2023-07-24)

Fixed

  • Category data is not saved under certain conditions

1.2.26

(2023-07-13)

Fixed

  • Products are not showing on the preview

1.2.24

(2023-06-13)

Fixed

  • Error "array_diff(): Argument #2 must be of type array, null given in Plugin/Backend/AddDynamicCategoryOnProductSaveM243Plugin"

1.2.23

(2023-06-07)

Improvements

  • Added a warning for manually assigning dynamic categories

Fixed

  • Compatibility with the Enterprise version

1.2.22

(2023-05-16)

Improvements

  • Speed up rule validation

Fixed

  • Reverting data during reindexing

1.2.20

(2023-04-27)

Fixed

  • Validation for multiselect attributes

1.2.18

(2023-04-18)

Fixed

  • Store ID during reindex

1.2.17

(2023-04-04)

Fixed

  • Error "Table mage_catalog_product_category_cl does not exist"

1.2.15

(2023-04-03)

Fixed

  • Compatibility with PHP 8.2
  • Compatibility with Magento 2.3.2
  • Issue with backlog products

Improvements

  • Speedup rule validation

1.2.14

(2023-03-07)

Fixed

  • Error "Unique constraint violation found"
  • Error "You cannot define a correlation name 'tbl_categoryids'"

1.2.13

(2023-03-02)

Fixed

  • Child product validation

1.2.12

(2023-02-22)

Fixed

  • The issue when reindex remove all products from a category

1.2.8

(2023-01-25)

Fixed

  • URL rewrites during dynamic category saving`
  • Console command stops reindex process on the first error

1.2.7

(2023-01-20)

Fixed

  • Removing rewrites

1.2.6

(2023-01-06)

Improvements

  • Memory usage during reindex

1.2.5

(2022-12-15)

Fixed

  • The error "Area code is not set"
  • Removing rewrites during reindex

1.2.4

(2022-12-05)

Fixed

  • The error "Integrity constraint violation: 1062 Duplicate entry for key 'CATALOG_CATEGORY_PRODUCT_CATEGORY_ID_PRODUCT_ID'"

1.2.3

(2022-12-04)

Fixed

  • Website filter (exclude products that do not assign to website)

1.2.2

(2022-11-27)

Fixed

  • Results for "Any" aggregator
  • Preview does not take in the consideration the option "Exclude Products"

1.2.1

(2022-11-08)

Improvements

  • Moved category reindex to Message queues

1.1.13

(2022-11-03)

Fixed

  • Smart conditions

1.1.12

(2022-10-25)

Fixed

  • Rule validation on reindex

1.1.11

(2022-10-10)

Fixed

  • Error "str_replace(): Argument #3 ($subject) must be of type array|string, Magento\Framework\DB\Select given"

1.1.10

(2022-10-07)

Fixed

  • The issue when reindex do not disable on save

1.1.9

(2022-10-05)

Fixed

  • Issue when category does not reindex on save

1.1.8

(2022-09-23)

Improvements

  • Speedup rule validation

1.1.7

(2022-09-05)

Improvements

  • Added option "Run with Reindex Process"

1.1.6

(2022-08-04)

Fixed

  • Condition "Has Active Special Price" does not include catalog rule discount

1.1.5

(2022-07-28)

Improvements

  • Added option "Reindex after save"

1.1.4

(2022-07-11)

Improvements

  • Added the ability to select products by pattern

Fixed

  • Dynamic Category icon for categories with children
  • Timeout issue when saving dynamic category

1.1.3

(2022-06-20)

Improvements

  • remove db_schema_whitelist.json

1.1.2

(2022-06-14)

Fixed

  • Compatibility php7.1

1.1.1

(2022-05-25)

Fixed

  • Assign category when saving product through API

1.1.0

(2022-05-23)

Improvements

  • Migrate to declarative schema

1.0.29

(2022-03-21)

Fixed

  • Issue when cannot disable dynamic category

1.0.28

(2022-02-10)

Improvements

  • Added parent/child conditions

1.0.26

(2022-01-19)

Improvements

  • Added option "Exclude Products"

1.0.25

(2021-12-24)

Fixed

  • Reindex category on save

1.0.24

(2021-11-23)

Improvements

  • Indexation workflow

1.0.23

(2021-11-19)

Fixed

  • Compatibility with m2.4.2

1.0.22

(2021-11-09)

Improvements

  • Decrease reindex time

1.0.21

(2021-11-03)

Improvements

  • Added smart attribute "Created"

Fixed

  • Condition "Has Active Special Price is No"

1.0.20

(2021-10-12)

Improvements

  • Added option "Reindex Mode"

1.0.19

(2021-08-05)

Fixed

  • Assign product to category on product save using REST API

1.0.18

(2021-06-29)

Improvements

  • Validation of the configurable products

1.0.17

(2021-05-28)

Improvements

  • Added new condition "Is Salable"
  • Added the ability to copy rules from other dynamic categories

1.0.16

(2021-04-13)

Fixed

  • Call to a member function isStatic() on bool in vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php (deleted attribute)

1.0.15

(2021-04-12)

Fixed

  • JS error on the category tree (rules)

1.0.14

(2021-01-11)

Fixed

  • Apply Sale rule on configurable products too

1.0.13

(2021-01-07)

Fixed

  • Compatibility with PHP 7.1

1.0.12

(2020-12-22)

Fixed

  • Display of attributes of type "textarea"

Improvements

  • Speedup category reindex

1.0.11

(2020-12-11)

Fixed

  • Rename condition "On Sale" to "Has Active Special Price"

Improvements

  • Added command "mirasvit:dynamic-category:reindex"

1.0.10

(2020-12-01)

Improvements

  • New rule condition by product rating
  • New rule condition by number of reviews

1.0.9

(2020-11-26)

Fixed

  • Rule condition for the attribute "Quantity"

1.0.8

(2020-11-10)

Fixed

  • Compatibility with m2.3.2

1.0.7

(2020-10-16)

Fixed

  • Minor fixes

1.0.6

(2020-10-12)

Fixed

  • Issue with reindex

1.0.5

(2020-10-12)

Fixed

  • Issue with reindex

1.0.4

(2020-10-09)

Improvements

  • Added filter by Product Type

1.0.3

(2020-10-08)

Fixed

  • On sale feature

1.0.2

(2020-10-06)

Improvements

  • New conditions

1.0.1

(2020-09-23)

Fixed

  • Minor fixes

1.0.0

(2020-09-21)

Features

  • Initial release