Skip to main content

Product Info Switcher

version Magento Adobe Commerce

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

VCT Product Info Switcher Logo

Overview

A configurable product appears to be a single product with lists of options for each variant. However, each option represents a separate product.

By default, when selecting a configurable product option, you see almost the same information as for a configurable product. With this module, when selecting a configurable product option, your customer will see exactly the information about the selected product. You can decide which information you want to take from the configurable product and which information from its option.

You have a new store and related products have not been added for all variants of configurable products. It doesn't matter, display the related products of the configurable product for such products. Now the customer will always have recommendations, and they will be the most relevant.

Configurable products will become more useful and convenient. Instead of dozens of products in a category or search that differ only size e.g. S, M or volume e.g. 500ml, 1L that only complicate the search and choice, make one configurable.

Tasks performed

  • Show the following selected product data instead of the configurable product data, when an option is selected:
    • Page Title, Name, SKU, Availability.
    • Description, Short Description.
    • Additional Attributes.
    • Add To Wishlist, Add To Compare button.
    • Review Summary, Reviews, Submit Review Form.
    • Related, Up-Sell products.
  • Show the relevant data of a configurable product when a selected variant has no data for:
  • Allow writing reviews for products that are Not Visible Individually.
  • Show switchable product data in the browser console for debugging.

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/productinfoswitcher # 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/productinfoswitcher # 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_ProductInfoSwitcher # 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.

Switchable Elements

ConfigSwitchable Elements
Admin pathVCT Product Info Switcher General
TypeNone
Page title
Name
Review Summary
Availability
SKU
Add To Wishlist Button
Add To Compare Button
Short Description
Description
Additional Attributes
Reviews
Review Form
Related
Up-Sell
DefaultNone
DescriptionShow the selected child product (variant) data instead of the parent product data, when an option is selected on the configurable product page.
No items are selected by default.
Tip

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

Element Fallbacks

Info

Element fallbacks are optional and can be selected for each element separately.

ConfigElement Fallbacks
Admin pathVCT Product Info Switcher General
TypeNone
Review Summary
Short Description
Description
Related
Up-Sell
DefaultNone
DescriptionYes to display relevant product data of a configurable product when a selected variant has no data.
No to display relevant product data of a selected variant even if no data.
Tip

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

Element selectors

The module allows you to change jQuery Selector of elements for compatibility with different themes. It is necessary to specify the correct element selector for your frontend theme to display selected product data instead of the configurable product data on the configurable product page, when an option is selected.

For example, element selector for the product SKU in Luma theme is .product.attribute.sku .value:

Frontend selector devtools

Warning

By default, SKU selector is specified for the default Luma theme.

Selector validation in Admin

The module has jQuery selector validation in Admin for selector input fields when Save Config.
For example, element selector for the product SKU:

Selector validation in Admin

where ..value is an invalid jQuery selector. Use .value instead of ..value.

Tip

Ensure that the correct jQuery Selector is specified, if after configuring the module and clearing the cache, element switching still does not work.

Name Selector

ConfigName Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.page-title .base
DescriptionProduct Name element selector.

Review Summary Selector

ConfigReview Summary Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.product-reviews-summary
DescriptionProduct Review summary element selector.

SKU Selector

ConfigSKU Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.product.attribute.sku .value
DescriptionProduct SKU element selector.

Availability Selector

ConfigAvailability Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.product-info-main .stock.available span
DescriptionProduct Availability element selector.

Short Description Selector

ConfigShort Description Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.product.attribute.overview .value
DescriptionProduct Short description element selector.

Add To Wishlist Selector

Info

Only products with visibility other than Not visible individually can be added to a wishlist.

ConfigAdd To Wishlist Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.towishlist
DescriptionAdd to wishlist button element selector.

Add To Compare Selector

Info

Only products with visibility other than Not visible individually can be added to a comparison.

ConfigAdd To Compare Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.tocompare
DescriptionAdd to compare button element selector.

Description Selector

ConfigDescription Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default#description .description .value
DescriptionProduct Description element selector (Details tab or block).

Additional Attributes Selector

ConfigAdditional Attributes Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default#additional
DescriptionProduct Additional attributes element selector (More Information tab or block).

Reviews Selector

ConfigReviews Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.review-list
DescriptionProduct Reviews element selector (Reviews tab or block).

Review Form Selector

Info

Reviews are allowed for all child products, even if they are Not Visible Individually.

ConfigReview Form Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.review-add
DescriptionProduct Submit review form element selector (Reviews tab or block).
Warning

Update status for reviews to see reviews in the frontend.

ConfigRelated Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.related
DescriptionRelated products element selector.

Up-Sell Selector

ConfigUp-Sell Selector
Admin pathVCT Product Info Switcher General
TypejQuery Selector
Default.upsell
DescriptionUp-Sell products element selector.

Debug

Enable

ConfigEnable
Admin pathVCT Product Info Switcher Debug
TypeYes No
DefaultNo
DescriptionYes to show or No to hide the module configuration and data of product variants in the browser console, and highlight elements with selectors from the configuration.

For example:

Log

Warning

Debug Enable config should be set to No in production and used only for debugging!

Configure product layout

Choose the design that you want to use for product pages.

Info

Depending on the product layout, tab or block will be empty or not be displayed if the product has no data for: Description, Additional Attributes, Reviews, Related, Up-Sell products.

Default Product Layout

Default Product Layout config in Stores Configuration GENERAL Web Default Layouts determines the layout used by default for product pages.

Configure default product layout in the Adobe Commerce Documentation.

Product Design

Design section in Catalog Products <Product> allows you to apply a different layout to the product page.

Product settings - Design in the Adobe Commerce Documentation.

Examples

Page Title

Page Title

Name, SKU, Availability etc.

Name, SKU, Availability etc

Description

Description

Additional Attributes

Additional Attributes

Reviews, Review Form

Reviews, Review Form

Related

Up-Sell

Up-Sell