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 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 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 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 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).

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