Also Bought
☆☆☆☆☆ Leave review to help in further development
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:
- Specific products manually selected.
- All product types, Bundle, Configurable, Downloadable, Grouped, Simple, Virtual products.
- 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
- Wide customization of the Also Bought product block by implementing it with a widget.
- Plugins are used to prevent conflicts among modules.
- Meets Magento Coding Standard.
- Tested and verified by Adobe Extension Quality Program.
Install
Use Composer to install the module or get the code for review:
- Log in to your Marketplace account that purchased the module.
- Add or update your Access Keys i.e.
<Public Key>
and<Private Key>
for Adobe Commerce Marketplace repository inauth.json
using the following command:
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.
Optional execute in production mode:
bin/magento setup:di:compile # Recompile the code in production mode
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
Flush Magento Cache in System Cache Management after configuration change to see the changes!
Clean and flush cache types in the Adobe Commerce Documentation.
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.
Each widget can be configured separately.
Creating and managing widgets in the Adobe Commerce Documentation.
Widget Options
Widget Block Title
Config | Widget Block Title |
Admin path | Content Widgets <VCT Also Bought Widget> Widget Options |
Type | String |
Default | None |
Description | Widget block title in the frontend. Empty by default. |
Random Products
Config | Random Products |
Admin path | Content Widgets <VCT Also Bought Widget> Widget Options |
Type | Yes No |
Default | No |
Description | Yes to display random and No to display newest Also Bought products in the widget. |
Product Number
Config | Product Number |
Admin path | Content Widgets <VCT Also Bought Widget> Widget Options |
Type | Int |
Default | 5 |
Description | Number of displayed Also Bought products in the widget. |
Number Of Columns
Config | Number Of Columns |
Admin path | Content Widgets <VCT Also Bought Widget> Widget Options |
Type | Int |
Default | 5 |
Description | Number of columns displayed in the Also Bought widget. |
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
Config | Displayed Product Elements |
Admin path | Content Widgets <VCT Also Bought Widget> Widget Options |
Type | Product Image Reviews Summary Price Swatches Add To Cart Add To Wish List Add To Compare |
Default | Product Image Reviews Summary Price Swatches Add To Cart Add To Wish List Add To Compare |
Description | Show or hide selected product elements in the Also Bought widget. |
Use CTRL+a to select all elements or hold CTRL to unselect an element in Admin.
Update
Update Products
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.
By default, Also Bought products are updated every hour with Cron.
Cron (scheduled tasks) in the Adobe Commerce Documentation.
General
Show By
Config | Show By |
Admin path | VCT Also Bought General |
Type | None Related Up-Sell Cross-Sell |
Default | None |
Description | Select where to add Also Bought products. |
Use CTRL+a to select all elements or hold CTRL to unselect an element in Admin.
Related
Show Random Products
Config | Show Random Products |
Admin path | VCT Also Bought Related |
Type | Yes No |
Default | No |
Description | Yes to display random and No to display newest Also Bought products in Related products. |
Product Position
Config | Product Position |
Admin path | VCT Also Bought Related |
Type | Before After |
Default | After |
Description | Show Also Bought products Before or After Related products. |
Product Number
Config | Product Number |
Admin path | VCT Also Bought Related |
Type | Int |
Default | 2 |
Description | Number of Also Bought products in Related products. |
Up-Sell
Show Random Products
Config | Show Random Products |
Admin path | VCT Also Bought Up-Sell |
Type | Yes No |
Default | No |
Description | Yes to display random and No to display newest Also Bought products in Up-Sell products. |
Product Position
Config | Product Position |
Admin path | VCT Also Bought Up-Sell |
Type | Before After |
Default | After |
Description | Show Also Bought products Before or After Up-Sell products. |
Product Number
Config | Product Number |
Admin path | VCT Also Bought Up-Sell |
Type | Int |
Default | 2 |
Description | Number of Also Bought products in Up-Sell products. |
Cross-Sell
Show Random Products
Config | Show Random Products |
Admin path | VCT Also Bought Cross-Sell |
Type | Yes No |
Default | No |
Description | Yes to display random and No to display newest Also Bought products in Cross-Sell products. |
Product Position
Config | Product Position |
Admin path | VCT Also Bought Cross-Sell |
Type | Before After |
Default | After |
Description | Show Also Bought products Before or After Cross-Sell products. |
Product Number
Config | Product Number |
Admin path | VCT Also Bought Cross-Sell |
Type | Int |
Default | 2 |
Description | Number of Also Bought products in Cross-Sell products. |
Known issues
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.
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.