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.
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
.
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.
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.
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.
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
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.
The standard Magento New attribute is applied to products that have activated the attribute option New.
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.
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.
Number of reviews
Assign products that have a specified number of user reviews.
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.).
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.
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.
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.
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.
The new Activity category is empty for now:
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.
Specify the condition as:
-
Product attributes – Activity
-
is one of
-
exact value
- specify the activity (Hike, Outdoor, Running, Gym, Climbing, etc.)
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.