Getting Started

Welcome to the documentation of Related Products for Magento 2 extension.

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

First of all we recommend you check the following link:

How to install the extension

  1. Backup your store's database and web directory.
  2. Login to your server's SSH console 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_Related 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

  8. Run command php -f bin/magento indexer:reindex mst_related_index to reindex extension-related data.

  9. Make sure that the native Magento cron job is configured and working correctly. The Related Products for Magento 2 extension runs all tasks in cron.



Product Selection Rules

Selection Rule - This is the internal function that describes the conditions in selecting some appropriate related products.

Go to Marketing > Related Products > Product Selection Rules. You will see the applicable rules.

You can add a Rule by pressing Add New Rule button. You will see then a Rule edit form, which contains the following basic data:

General information

  • Internal Name - the internal name of the rule.

Products Selection Condition

image

Primary Source

Primary Source - the source of some related products. The Related Products for Magento 2 extension selects related products based on:

  • Whole Catalog - all available products (products from the current product page, last added product in the cart, any already purchased products, possible related products)
  • Bought Together (the same Order) - previous orders (products from current product page, the last added product in the cart, any already purchased products, possible related products were bought in the same order)
  • Also Bought (the same Customer) - previous orders (the same customer bought products from the current product page, the last added product in the cart, any already purchased products, possible related product)
  • Viewed Together - previous product viewing history (the same customer viewed products from current product page, the last added product in the cart, any already purchased products, possible related product).

Note

When using the rule "Other Viewed Products" for the Product Blocks, please note that this rule updates the list of related products only if the option "Enable "Product View" Report" is enabled.

To activate the "Enable "Product View" Report", navigate to Stores > Configuration > Reports where you must first activate the option Enable reports. After that, the option Enable "Product View" Report will become available.

Please note that "Other Viewed Products" only takes into account viewed products of logged-in customers.

Use default Magento collections

Under the Primary Source drop-down menu, three additional options are located that allow you to use the default Magento collections.

  • Include assigned Related Products
  • Include assigned Up-Sells Products
  • Include assigned Cross-Sells Products

When the respective checkbox is activated ,the products are fist added from default source and after that – products are added by the created rule.

Rule

Rule - additional conditions to specify what products will be considered as related products.

# Product Blocks

Product Block - a block that displays related products on the store's pages.

Go to Marketing > Related Products > Product Blocks. You will see some available blocks.

You can add a Block by pressing Add New Block button. You will then see a Block in the edit form, which contains some basic data:

image

General information

  • Internal Name - internal name of the block
  • Active - to enable/disable block
  • Priority - priority of the block. If a few blocks share the same position on the page, the extension will select the one block with the highest priority.
  • Store View

Where To Display

This section defines the page and position to display the block.

After changing the position or creating a block, you should clear the Magento cache to apply your changes.

What To Display

This section defines what products should be added to the block, based on the configured Product Selection Rules.

How To Display

This section defines the general appearance rules: Block title, number of products, etc.

How to upgrade extension

To upgrade the extension, follow these steps:

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

    Note

    There are some cases when the command above is not applicable; it is not possible when updating the current module; neither will it be applicable when upgrading all the Mirasvit modules in a bundle. In this case, the command above will be of 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 module:enable Mirasvit_Core Mirasvit_Related to enable the extension.
  5. Run command php -f bin/magento setup:upgrade to install updates.
  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

  8. Run command php -f bin/magento indexer:reindex mst_related_index to reindex the data related to the Related Products for Magento 2 extension.

Disabling the Extension

Temporarily Disable

To temporarily disable the extension please follow these steps:

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

Removing the Extension

To uninstall the extension, please follow these steps:

  1. Login to your server's SSH console and navigate to the root directory of the Magento 2 store.
  2. Run the command composer remove mirasvit/module-related to remove the extension.
  3. Log in to the Magento backend and refresh the store's cache (if enabled).

Change Log

1.0.17

(2021-06-16)

Improvements

  • Added widget
  • Added slider to the related block

1.0.16

(2021-04-19)

Fixed

  • Fix delete message for m2.4

1.0.15

(2020-12-29)

Fixed

  • Issue with logging

1.0.14

(2020-12-11)

Fixed

  • Condition "Current Product ..."

1.0.13

(2020-12-07)

Improvements

  • Ability to replace blocks in the native blocks

Fixed

  • Zen_Json to SerializeService

1.0.12

(2020-11-23)

Fixed

  • Compatibility with m2.1

1.0.11

(2020-10-13)

Fixed

  • Issue with selecting native related product ids

1.0.10

(2020-09-24)

Features

  • use native collecton (related, up-sells, cross-sells)

1.0.9

(2020-08-28)

Fixed

  • fixed an issue with the error 'cookie is not a function'

1.0.8

(2020-07-30)

Features

  • Added GraphQL implementation

Improvements

  • Support of Magento 2.4
  • Selection rules for non-product pages

1.0.7

(2020-07-28)

Improvements

  • Selection rules for non-product pages

1.0.6

(2020-07-16)

Improvements

  • Bulletproof template
  • Added GraphQL implementation

1.0.4

(2020-02-28)

Improvements

  • Order products

1.0.3

(2020-02-25)

Improvements

  • Apply filter by stock (by default only saleable products are suggested)

1.0.2

(2020-02-20)

Improvements

  • Ability to use custom block position
  • Indexation performance

1.0.1

(2020-02-11)

Fixed

  • Minor fixes

1.0.0

(2020-02-06)

Improvements

  • Indexation performance

0.0.1

(2020-01-22)

Improvements

  • Initial release