Magento: How to show configurable product options in product list page?

Magento: How to show configurable product options in product list page?

July 10, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: How to show configurable product options in product list page?

Showing Configurable Product Options on Magento Product List Page

In Magento, configurable products allow you to offer multiple variations of a single product. However, by default, these options are only visible on the individual product page. If you want to display them directly in your product list view and update pricing accordingly, you’ll need to make some adjustments.

Understanding Configurable Products

Configurable products are a powerful feature that allows customers to customize their purchases. They are composed of simple products with different attributes like color, size, or material. When a customer selects an option, the system determines which simple product to display and update the price.

Displaying Options in Product List View

To show configurable options in your product list view, you’ll need to modify the catalog_product_list block in your theme’s XML layout file. Here’s how:

  1. Navigate to app/design/frontend/[Your_Theme]/[Your_Version]/Magento_Catalog/layout/catalog_product_list.xml and open it for editing.

  2. Look for the <block type="catalog/product_list" name="product_list" template="Magento_Catalog/templates/product/list.phtml"> section.

  3. Add the following code inside this block definition:

<action method="setProductListOptions">
    <argument name="options" xsi:type="string">configurable,swatch_product_attributes</argument>
</action>

This tells Magento to include configurable options and swatch product attributes in your list view.

Updating Pricing Dynamically

To update the price automatically when a customer selects an option, you need to modify the product list template. Here’s how:

  1. Navigate to app/design/frontend/[Your_Theme]/[Your_Version]/Magento_Catalog/templates/product/list.phtml and open it.

  2. Locate the part of the code where the product price is displayed. It should look something like this:

<?php if ($_product->getPrice() != 'No Fixed Price'): ?>
    <span class="price"><?= /* @escapeNotVerified */ $_product->getFinalPrice() ?></span>
<?php endif; ?>
  1. Replace the above code with the following:
<?php $price = $block->getProduct()->getData('special_price');
if ($price == 'No Fixed Price'): ?>
    <span class="price"><?= /* @escapeNotVerified */ $_product->getFinalPrice() ?></span>
<?php else: ?>
    <?php $configurableAttributes = $block->getProduct()->getTypeInstance(true)->getConfigurableAttributesAsArray($_product);
    if (count($configurableAttributes)): ?>
        <div class="price-configuration">
            <?= /* @escapeNotVerified */ $this->configurableOptionsHtml($_product) ?>
            <span id="configured-price" class="price"><?= /* @escapeNotVerified */ $_product->getPrice() ?></span>
        </div>
    <?php endif; ?>
<?php endif; ?>

This code fetches the configurable options and displays them using configurableOptionsHtml(). It also updates the price dynamically in the <span id="configured-price"> element.

Note: Replace [Your_Theme] and [Your_Version] with your actual theme name and version.

Conclusion

Displaying configurable product options directly in the Magento product list view provides a more seamless shopping experience for your customers. By following the steps outlined above, you can easily achieve this without any complex customizations. Remember to clear your cache after making these changes.

For further details on how to customize your Magento storefront effectively, consider visiting Laravel Company’s blog. We provide a wealth of information and best practices for working with the Magento platform.

Happy coding!

Catalog Themes Configuration Customers

Our network