cancel
Showing results for 
Search instead for 
Did you mean: 

Fixing issue with missing color option on search results

Fixing issue with missing color option on search results

Please follow the instructions to fix the issue.

1. Create a new layout XML file in your theme

app/design/frontend/Vendor/theme/Magento_Swatches/layout/catalogsearch_result_index.xml

2. Put content 

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" 
                xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="Magento_Swatches::css/swatches.css"/>
    </head>
    <body>
        <referenceBlock name="category.product.type.details.renderers">
            <block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" as="configurable"
                             template="Magento_Swatches::product/listing/renderer.phtml" />
        </referenceBlock>
    </body>
</page>

3. Save the file and flush the Magento cache

4. Vuala :-)