Hiding Simple Products in Magento Front End: A Comprehensive Guide
In Magento, you can create complex product structures by associating simple products with configurable ones. However, by default, both the configurable and simple products are listed on the front end of your store. This article will guide you through hiding simple products from the main catalog view while still allowing customers to access them via the “View Details” option for associated configured products.
The Current Issue: Both Types Displayed
When you insert products programmatically or import them, Magento lists all available products in the catalog, regardless of whether they are grouped as configurable sets. This is why your simple products might be appearing alongside their configured counterparts on the front-end product listing page.
Understanding Magento’s Product Hierarchy
Before we dive into the solution, let’s clarify how Magento manages these associations:
- Configurable Products: These act as a group or parent for multiple simple products that share common characteristics.
- Simple Products: These are individual variants of the configurable parent. They have different attributes like size, color, or other specifications.
Step 1: Create and Associate Your Products
If you haven’t already done so, ensure you create your configurable product first. After setting its basic details, navigate to the “Associated Products” section under Inventory > Configurations in the Magento admin panel. Here, you can add your simple products as associated items.
Step 2: Hide Simple Products from Catalog
To hide simple products from the catalog, you need to adjust their visibility settings:
- In the Magento Admin Panel, navigate to the product edit screen for each simple product.
- Click on “Visibility” in the left sidebar under General Information.
- Change the setting from “Catalog” or “Search” to “Not Visible Individually”.
This tells Magento not to display these products as standalone items in the catalog or search results, but they remain associated with their parent configurable product.
Step 3: Configure Details Page Display
By default, when a customer clicks on the configurable product’s “View Details” button, Magento displays both the configured and simple variants. To change this:
- Go to Stores > Configuration in the admin panel.
- Navigate to the “Catalog” section under the left sidebar.
- Click on “Inventory”.
- Under “Stock Options”, find the setting for “Display Out of Stock Products”.
- Change this value to “Do not show out of stock products”.
This ensures that only available (in-stock) products, which are typically your simple variants, will be shown when a customer views the details page.
Step 4: Verifying Your Changes
Save your configurations and then refresh your front-end store. You should now see:
- The configured product listed in the main catalog view.
- No standalone listings for the associated simple products.
- When clicking “View Details” on a configurable product, only the available simple variants are displayed.
Conclusion: A Cleaner Front End Experience
By following these steps, you can maintain your desired product hierarchy while providing a cleaner and more organized front-end experience for your customers. This approach also mirrors the standard Magento behavior used in their default themes.
Remember, proper product organization not only enhances user experience but also simplifies inventory management and reduces confusion about available variants.
For further guidance on Magento configuration and customization, don’t hesitate to explore our Laravel Company Blog for a wealth of practical tutorials and troubleshooting tips.