7 Steps to Enable Compare Products Function in Magento 2

7 Steps to Enable Compare Products Function in Magento 2

Want your customers to make informed product decisions effortlessly? The compare products function in Magento 2 allows shoppers to evaluate multiple products side by side.

In this tutorial, we will explore the workings and steps to enable the product comparison function.

Best Magento Hosting now

Key Takeaways

  • The function helps shoppers evaluate options side by side.

  • Follow the steps to enable the feature for your Magento store.

  • Customers can add products to the comparison list in different ways.

  • Troubleshoot common issues with the compare feature.

  • The feature improves customer satisfaction and boosts conversions.

What is the Compare Products Function in Magento 2?

The compare products function in Magento 2 helps customers evaluate products side by side based on attributes like price, features, and specifications.

Shoppers can create a comparison list by clicking "Add to Compare" on product pages. It is dynamically updated as items are added or removed.

The product comparison feature displays product information in a clear, tabular format. It is displayed either in a pop-up or on a dedicated page.

The Magento compare feature allows customers to identify the best option without switching between pages. Store admins can easily enable this feature in the backend. It helps improve customer satisfaction and conversions.

How does “Compare Products Function” in Magento 2 Work?

1. Adding Products to Compare

Adding Products to Compare

  • Customers can continue browsing and click the "Add to Compare" button. It is available on product listing pages or individual product pages.

  • Once clicked, the selected product is added to the comparison list. The list is updated dynamically.

  • Products can be removed from the list directly on the comparison page or widget. It is done by clicking the "Remove" button.

2. Viewing the Comparison List

  • The comparison list is typically displayed in a sidebar widget for quick access.

  • Customers can also view all compared products on a dedicated comparison page. It offers a detailed layout.

  • Each product name in the comparison list includes a link back to its respective product page. It allows customers to explore further details if needed.

3. View Products in a Tabular Format

  • On the comparison page, products are displayed side by side in a tabular format.

  • Each row highlights specific product attributes such as:

    1. Price

    2. Dimensions

    3. Color or Size

    4. Technical Specifications

  • Unique differences between products are highlighted for easy identification.

4. Making an Informed Decision

  • The comparison function eliminates the need to switch between multiple product pages. It is by clearly displaying attributes. It allows for faster, informed decision-making.

  • After deciding, customers can proceed directly to the selected product's page. They can then add it to their cart and complete the purchase.

7 Different Methods to Add Products to the Comparison List in Magento 2

1. From Category Pages

  • Each product thumbnail includes an "Add to Compare" link or button. It is present on category or search results pages.

  • Customers can click this button to add the product directly to the comparison list. It is done without leaving the category page.

2. From Product Pages

From Product Pages

  • On individual product pages, customers will see the "Add to Compare" button near the product description. It is also present alongside other action buttons like "Add to Wishlist" or "Add to Cart."

  • Clicking this button adds the product to the comparison list. It keeps the customer on the product page.

3. Using Quick View

If the Quick View feature is enabled on the store:

  • Customers can hover over a product and select Quick View. It opens a pop-up with product recommendations.

  • Inside the Quick View pop-up, the "Add to Compare" button is usually available. It allows quick addition to the comparison list.

4. Via Sidebar Widget

  • The products comparison widget on the store’s sidebar displays the current comparison list.

  • Some stores enable an option to add more products directly through this widget. It allows customers to manage the comparison list easily.

5. From Search Results

  • When customers search for products, the results display an "Add to Compare" button for each product.

  • It allows customers to select products for comparison quickly. They are no longer required to navigate to product pages.

6. From Related, Upsell, or Cross-Sell Sections

  • On product pages or in the cart, Magento often displays:

    1. Related products

    2. Upsell products

    3. Cross-sell suggestions

  • These items usually have an "Add to Compare" button. It enables customers to add them to the comparison list directly from these sections.

7. Custom Extensions

If the store uses custom extensions or third-party tools, additional features may be provided, such as:

1. Drag-and-drop functionality to add products to the comparison list.

2. Bulk selection for comparison from category pages.

How to Enable the Compare Products Function in Magento 2

1. Go to Marketing > Automatic Related Products > Rule in the Magento admin panel.

Step 1: Automatic Related Products

2. Create the auto-related product rule for related products.

3. In the Display Setting section, select the Compare Template for showcasing related products.

Step 3: Compare Template

4. Save your changes and verify the display on the storefront.

5. Navigate to Stores > Attributes > Products in the admin panel.

6. Find the desired attribute and switch to the Storefront Properties tab.

7. Enable the following options:

  • Comparable on Storefront

Step 7: Enable Comparable on Storefront

  • Used in Product Listing

Key Attributes To Be Compared Using Magento 2's Compare Products Feature

Key Attributes Explanation
1. Product Name It clearly identifies each product in the comparison table. It allows customers to distinguish between products with similar appearances easily.
2. SKU (Stock Keeping Unit) It is useful for customers who are familiar with product codes. These especially include B2B or wholesale environments.
3. Price It displays the regular price of the product. These include any discounts or special prices. It allows customers to compare affordability and value between items.
4. Special Price & Tier Pricing It shows promotional or discounted pricing to highlight savings. It indicates bulk pricing options. These are particularly important for wholesale buyers.
5. Stock Status It indicates whether the product is in stock, out of stock, or available for backorder. It helps customers prioritize products they can purchase immediately.
6. Shipping Options or Restrictions It may show availability for specific shipping methods or regions. It is useful for international stores.
7. Weight It is relevant for items where weight impacts shipping costs or usability. These include luggage and electronics.
8. Dimensions It is essential for size-sensitive products. These include furniture, appliances, or storage items. You should compare product attributes, including Height, Width, and Depth.
9. Color It is important for fashion, home decor, and personal accessories. It displays variations or swatches if configured.
10. Size It displays size options. It is particularly possible for apparel, footwear, or accessories.
11. Material It highlights the material composition of items. These items include clothing, furniture, or jewelry. The attributes may include cotton, leather, and gold.
12. Technical Specifications It may include details like processor speed, battery life, or storage capacity. It is for electronics or machinery.
13. Ratings and Reviews It displays average customer ratings or total reviews for each product. It helps customers make decisions based on social proof.
14. Brand It shows the manufacturer or brand name. It is useful for customers who are loyal to specific brands.
15. Warranty Period It indicates the duration of product warranties. It is especially for electronics or appliances.
16. Energy Efficiency Rating It is relevant for appliances or environmentally conscious products.
17. Care Instructions It is useful for clothing, furniture, or specialty products. These require specific maintenance.

How to Troubleshoot Common Issues With the Compare Products Functionality?

Issue Causes Solution
1. "Add to Compare" Button is Not Visible The feature is disabled in the admin settings. The button is hidden due to a theme or layout customization issue. The product attribute is not configured to allow comparison. Under the Storefront section of the Catalog, ensure Enable Compare Products is set to Yes. Verify the presence of the "Add to Compare" button in catalog_product_list.phtml and product/view.phtml files. If missing, restore the default layout or manually add the button using Magento’s block system. Under Product, ensure the relevant attributes have "Comparable on Frontend" set to Yes.
2. Products Comparison List Not Updating Cache issues may prevent updates. JavaScript conflicts with extensions or custom code. Session storage errors may interfere with the feature. Clear the Magento cache and browser cache via the admin panel. Use browser developer tools to check for errors in the console. Disable recently added extensions or custom JavaScript that might conflict with the feature. Ensure session storage on the server is configured correctly. Check for errors in var/log/system.log or var/log/debug.log.
3. Product Comparison Widget Not Displaying The widget block is disabled in the theme or layout XML. Cache or indexers are not updated. Check your theme’s default.xml layout file. Ensure the block for the Products comparison widget is included. Refresh indexes and cache via CLI.
4. Products Not Appearing on the Comparison Page Product attributes are not set as comparable. Theme or extension conflicts. Under Product, ensure attributes are configured with "Comparable on Frontend" set to Yes. Temporarily switch to the default Magento theme to determine if the issue is theme-related. If resolved, adjust the custom theme’s compare.phtml file or seek developer support.
5. Comparison Table Shows Incorrect or Missing Data Incorrect attribute configuration. Database or cache corruption. Ensure all attributes required for comparison are enabled for the appropriate product attribute set. Reset database cache and reindex.
6. Persistent Comparison List Not Saving Customer sessions are not persistent. Server-side session handling issues. Under Persistent Shopping Cart, enable persistence and configure the appropriate duration for storing sessions. Verify session storage settings in env.php.
7. Errors After Installing Extensions Extension conflicts with existing product comparison functionality. Incorrect extension configuration. Remove the problematic extension using CLI. Test the Compare Products functionality to confirm the issue is resolved. Review var/log/system.log or var/log/exception.log for conflicts or errors. If the extension is essential, reach out to the provider for a compatibility update or fix.

FAQs

1. How can I disable Compare Products in Magento 2?

Disable the compare products feature in Magento 2 by navigating to the admin sidebar configuration. Then, add the following XML code to remove compare products block from the category and product pages. It ensures a cleaner, more user-friendly shopping experience.

2. Why is comparing products important in Magento?

Magento 2 compare products feature helps customers understand the product advantages and differences between multiple products. It provides a detailed comparison chart. It helps users assess the best qualities of each product.

3. What are the best practices for using Magento Compare Products?

Use compare products Magento 2 to highlight the essential features of your products. It also provides a clear attribute comparison. Keep the comparison table simple and easy to read, focusing on product strengths and features.

4. How does Magento Open Source help users easily compare products?

Magento Open Source provides a flexible products template. It allows users to compare product attributes side-by-side. Customers can remove a product from the comparison list without needing a page reload. It simplifies the comparison process for a better shopping experience.

CTA

Summary

The compare products function in Magento 2 presents product attributes in a tabular format for easy comparison. The tutorial explores the several features of the function, including:

  • Customers can add products to the comparison list via buttons on different pages.

  • The comparison page displays products in a table, highlighting key details.

  • Attributes like price, stock status, and ratings can be compared for informed decisions.

  • Admins can enable or troubleshoot this feature easily in the backend settings.

Take your ecommerce store’s features to the next level with compare products function. Pair it with managed Magento hosting for smooth performance.

Ruby Agarwal
Ruby Agarwal
Technical Writer

Ruby is an experienced technical writer sharing well-researched Magento hosting insights. She likes to combine unique technical and marketing knowledge in her content.


Get the fastest Magento Hosting! Get Started