-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Color attribute taking swatch instead of Drop down option for configurable options, #9307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am also experiencing this issue, after upgrade from 2.1.4 to 2.1.6. |
+1 I had it working originally as a dropdown. Then changed it to a swatch, now I can't go back to a dropdown. The setting saves but the front end ignores it. I assume is is because the extra attributes are created for the options when it is turned into a swatch, then not removed. No amount of cache clearing fixes it. |
+1 Also had this issue after switching to swatch then back to dropdown. When the product detail page is showing, we're seeing markup with 'swatch-input'. Note, we upgraded from Magento 1.9 to Magento 2.1.6 and imported the data using the magento import tool. It was appearing fine as a drop down until we changed the "Catalog Input Type for Store Owner" from dropdown to Text Swatch. Markup that appeared after switching to text swatch, and remained after switching back to dropdown: |
Any one get resolution ? |
I traced the code back to the isProductHasSwatchAttribute in the Magento\Swatches\Block\Product\Renderer\Configurable class. It's using the SwatchAttributesProvider class to check for swatch data. It looks like there is some leftover data in the eav_attribute_option_swatch table after switching back to the dropdown. Once I cleaned out the swatch values that were created when we switched to the text swatch, it worked as expected again. To see if there is data, and get the swatch_ids, use this sql query:
|
Having this issue also on 2.1.7. |
Me too, same issue in 2.1.7 |
We are also facing the same issues on Magento 2.1.7. If anyone finds a solution for this issue then please share it with all. |
@gclift gave a manual solution above. It will need some db editing. |
Hi @vishveskrish. |
Using your preferred database editor, navigate and find the table eav_attribute_option_swatch Magento will store a row for each of the swatches you have configured in the Magento Admin. Once deleted. Head over to your Magento admin panel, clear the magento cache and static file cache. I was able to solve my issue in 5 minutes. I hope this helps somebody else |
Thanks @sanjeshsodha !! I can confirm this works. |
Thanks @sanjeshsodha your solution worked for us. |
@wildcard27, well, I could tell you why it happens is this scenario: #9923 (comment) But an official fix might take a couple more months to get implemented and released, speaking optimistically. |
@korostii So not as simple as programmatically deleting all of the entries in the eav_attribute_option_swatch table relating to the attribute being saved if the frontend type is changed? If so, this could be implemented in a plugin as a 'quick' fix for now. |
@wildcard27, That might break the actual swatch attributes that should not look like dropdown, so be careful down that road. But yeah, that might work. Personally, I don't think there's a "quick" solutions here. I mean, there were whole classes written around implementing some parts of the swatches' rendering, it seems to be an interdependent a fragile thing. I wish the guys at Magento would test this better though. I mean, they have the resources for it and ytet they release this piece of buggy functionality in a patch version while ignoring hundreds of safe one-liners that await months for a backport. Frankly, that whole routine makes me somewhat angry every time I stumble upon its results, again and again. |
I was able to fix this by: Step 1: Finding my attribute id by: Step 2: Running the SQL Query referenced above to confirm the swatch entries: Step 3: Delete the swatch entries. If you have more complicated setup with legit swatches, you may want to only delete the results from the query in step 2. |
@vishveskrish, thank you for your report. |
Hello @magento-engcom-team, Do we get the resolution? |
I am also experiencing this issue, after upgrade from 2.1.3 to 2.2.0 |
@RakeshJesadiya , Yes I got the resolution |
#mageconf |
Closed because duplicate #12695 |
Thank you very much @saeohioalpha . You save my day. your solution is working fine but i am confused like each time when i will create configurable product then i need to do this step? Still magento not resolved this issue? |
Hi @vishveskrish. Thank you for your report.
The fix will be available with the upcoming 2.2.6 release. |
Temporary work around: Change your attribute to dropdown from swatch from admin go to database >> table delete all related swatch attribute row from this table deploy static content and flush cache. |
Hi @vishveskrish. Thank you for your report. The fix will be available with the upcoming 2.3.0 release. |
@ishakhsuvarov I'm still having this issue on 2.3.0. I'm unable to change my attribute type from Text Swatch to Dropdown, even if I truncate the swatch options table. |
Preconditions
Steps to reproduce
Expected result
Actual result
Kindly see screenshots.


The text was updated successfully, but these errors were encountered: