Skip to main content

Also Bought

version Magento Adobe Commerce

☆☆☆☆☆ Leave review to help in further development

VCT Also Bought Logo

Overview

This module allows adding a block of products known as "Frequently Bought Together" or "Who Bought This Also Bought". These Also Bought products can be further displayed using a custom widget in a location of your choice or/and in Related, Up-Sell, Cross-Sell products.

This module will automatically create a list of products that were present in other customer orders, along with the currently viewed product. These products list is updated automatically according to the Cron schedule you configure or manually in the Admin or using CLI command.

Tasks performed

  • Collect products that were present in other customer orders along with the product being viewed in a separate table using:
    • Automatically according to the Cron schedule.
    • Update Products button in Admin.
    • CLI command.
  • Show Also Bought products in a custom widget(s) for:
  • Show or hide Also Bought products in Related, Up-Sell, Cross-Sell products.
  • Show random Also Bought products instead of last purchased products in a custom widget(s), Related, Up-Sell, Cross-Sell products.
  • Configure Also Bought widget(s):
    • Set title for widget(s).
    • Show or hide the following product card elements in Also Bought widget of your choice separately for each widget:
      • Product image, Prices.
      • Reviews summary i.e. products rating and number of reviews.
      • Add To Cart, Add To Wish List, Add To Compare buttons.
      • Configurable products options in case of Visual Swatch or Text Swatch.
    • Set Also Bought widget location of your choice from the following containers:
      • After Page Header, After Page Header Top, Alert Urls.
      • Before Main Columns, Main Content Top, Main Content Container, Main Content Area, Main Content Aside, Main Content Bottom.
      • Mini-Cart Promotion Block.
      • Page Header, Page Header Container, Page Header Panel, Page Top, Page Bottom.
      • Product Auxiliary Info, Product Info Auxiliary Container, Product Social Links Container, Product View Extra Hint, Review Form Fields Before.
      • Sidebar Main, Sidebar Additional, Compare Link Wrapper.
      • Before Page Footer, Page Footer, Before Page Footer Container, Page Footer Container, CMS Footer Links.

Features

Install

Use Composer to install the module or get the code for review:

composer config --auth http-basic.repo.magento.com <Public Key> <Private Key> # Add or update Access Keys in auth.json
# e.g. composer config --auth http-basic.repo.magento.com 39b747b8ab1d624582bb3n1a09deb489 31b9fce4cb78f523fd34aa3abb90c89c
  • Execute the following commands:
composer require vct/alsobought # Install the module using Composer
bin/magento setup:upgrade --safe-mode=1 # Update the database schema and data
bin/magento setup:static-content:deploy --force # Deploy static view files
  • The module was installed in vendor/vct directory.
Info

Optional execute in production mode:

bin/magento setup:di:compile # Recompile the code in production mode
Tip

Help for common issues is on the FAQ page.
For further assistance, contact me by email vct.vendor@gmail.com.

Get your authentication keys and install an extension in the Adobe Commerce Documentation.

Update

Use Composer to update the module or get the code for review:

composer require --update-with-dependencies vct/alsobought # Update the module using Composer
bin/magento setup:upgrade --safe-mode=1 # Update the database schema and data
bin/magento setup:static-content:deploy --force # Deploy static view files

Execute only in production mode:

bin/magento setup:di:compile # Recompile the code in production mode

Upgrade an extension in the Adobe Commerce Documentation.

Uninstall

Execute the following commands to uninstall a module:

bin/magento module:uninstall Vct_AlsoBought # Uninstall module
bin/magento setup:upgrade --safe-mode=1 # Update the database schema and data
bin/magento setup:static-content:deploy --force # Deploy static view files

Uninstall modules in the Adobe Commerce Documentation.

Configure

Important

Flush Magento Cache in System Cache Management after configuration change to see the changes!

Clean and flush cache types in the Adobe Commerce Documentation.

Tip

Use Use System Value / Use Default / Use Website checkbox to the right of the setting to set the default value.

Use system value in the Adobe Commerce Documentation.

Add Widget

Use a custom VCT Also Bought widget in Content Widgets Add Widget Settings Type to display Also Bought products.

Info

Each widget can be configured separately.

Creating and managing widgets in the Adobe Commerce Documentation.

Widget Options

Widget Block Title

ConfigWidget Block Title
Admin pathContent Widgets <VCT Also Bought Widget> Widget Options
TypeString
DefaultNone
DescriptionWidget block title in the frontend. Empty by default.

Random Products

ConfigRandom Products
Admin pathContent Widgets <VCT Also Bought Widget> Widget Options
TypeYes No
DefaultNo
DescriptionYes to display random and No to display newest Also Bought products in the widget.

Product Number

ConfigProduct Number
Admin pathContent Widgets <VCT Also Bought Widget> Widget Options
TypeInt
Default5
DescriptionNumber of displayed Also Bought products in the widget.

Number Of Columns

ConfigNumber Of Columns
Admin pathContent Widgets <VCT Also Bought Widget> Widget Options
TypeInt
Default5
DescriptionNumber of columns displayed in the Also Bought widget.
Tip

To display products in a single row in the widget, set the Number Of Columns value equal to or greater than Product Number.

Displayed Product Elements

ConfigDisplayed Product Elements
Admin pathContent Widgets <VCT Also Bought Widget> Widget Options
TypeProduct Image
Reviews Summary
Price
Swatches
Add To Cart
Add To Wish List
Add To Compare
DefaultProduct Image
Reviews Summary
Price
Swatches
Add To Cart
Add To Wish List
Add To Compare
DescriptionShow or hide selected product elements in the Also Bought widget.
Tip

Use CTRL+a to select all elements or hold CTRL to unselect an element in Admin.

Update

Update Products

Important

Changes to Also Bought products will only be visible in the frontend after updating using:

  • Cron (Scheduled Tasks) according to schedule in Stores Configuration ADVANCED System Cron (Scheduled Tasks) Cron configuration options for group: vct_alsobought.
  • Update Products button in VCT Also Bought Update.
  • bin/magento vct:alsobought:update command.
vct_alsobought Cron group

Configure a schedule for Also Bought products updates in Stores Configuration ADVANCED System Cron (Scheduled Tasks) Cron configuration options for group: vct_alsobought.

Info

By default, Also Bought products are updated every hour with Cron.

Cron (scheduled tasks) in the Adobe Commerce Documentation.

General

Show By

ConfigShow By
Admin pathVCT Also Bought General
TypeNone
Related
Up-Sell
Cross-Sell
DefaultNone
DescriptionSelect where to add Also Bought products.
Tip

Use CTRL+a to select all elements or hold CTRL to unselect an element in Admin.

Show Random Products

ConfigShow Random Products
Admin pathVCT Also Bought Related
TypeYes No
DefaultNo
DescriptionYes to display random and No to display newest Also Bought products in Related products.

Product Position

ConfigProduct Position
Admin pathVCT Also Bought Related
TypeBefore After
DefaultAfter
DescriptionShow Also Bought products Before or After Related products.

Product Number

ConfigProduct Number
Admin pathVCT Also Bought Related
TypeInt
Default2
DescriptionNumber of Also Bought products in Related products.

Up-Sell

Show Random Products

ConfigShow Random Products
Admin pathVCT Also Bought Up-Sell
TypeYes No
DefaultNo
DescriptionYes to display random and No to display newest Also Bought products in Up-Sell products.

Product Position

ConfigProduct Position
Admin pathVCT Also Bought Up-Sell
TypeBefore After
DefaultAfter
DescriptionShow Also Bought products Before or After Up-Sell products.

Product Number

ConfigProduct Number
Admin pathVCT Also Bought Up-Sell
TypeInt
Default2
DescriptionNumber of Also Bought products in Up-Sell products.

Cross-Sell

Show Random Products

ConfigShow Random Products
Admin pathVCT Also Bought Cross-Sell
TypeYes No
DefaultNo
DescriptionYes to display random and No to display newest Also Bought products in Cross-Sell products.

Product Position

ConfigProduct Position
Admin pathVCT Also Bought Cross-Sell
TypeBefore After
DefaultAfter
DescriptionShow Also Bought products Before or After Cross-Sell products.

Product Number

ConfigProduct Number
Admin pathVCT Also Bought Cross-Sell
TypeInt
Default2
DescriptionNumber of Also Bought products in Cross-Sell products.

Known issues

Issue

Add To Cart button in products card can cause a JavaScript error in containers containing a form tag e.g. Review Form Fields Before container.
This is happening because the button itself already contains a form tag.

Fix

Set Content Widgets <VCT Also Bought Widget> Widget Options Show Add To Cart to No to disable Add To Cart button in containers with a form tag.

Examples

Sidebar Main container

Mini-cart Promotion container

Mini-cart Promotion container

Before Page Footer container

Related products block

Up-Sell products block

Up-Sell products block

Cross-Sell products block

Cross-Sell products block