11 votes

How can i disable Color Swatches Tooltip in Magento 2?

This was hell of a pain from trying to find the CSS, creating a mixin for swatch-renderer.js etc. Anyway, by looking at the code I found show_swatch_tooltip in system.xml and config.xml in magento-...
Gabor Juhasz's user avatar
10 votes
Accepted

Magento 2: How to change image size of swatches?

You have to apply changes under app/design/frontend/{Package}/{themename}/etc/view.xml file. For changes value of swatches you have to add your tag inside view.xml files <media> <...
Rakesh Jesadiya's user avatar
9 votes
Accepted

How can i disable Color Swatches Tooltip in Magento 2?

Make your theme extend Magento_Swatches. Copy swatch-renderer.js to your Magento_Swatches/web/js folder. Edit js file, comment out or delete the $.widget('mage.SwatchRendererTooltip' ... part.Then ...
Doru Petruc's user avatar
8 votes

Magento 2: How to change image size of swatches?

1) Copy and create template vendor/magento/module-swatches/etc/view.xml into your theme app/design/frontend/[Vendor]/[Theme Name]/Magento_Swatches/etc/view.xml 2) Clear cache : php bin/magento cache:...
Sondre's user avatar
  • 343
7 votes
Accepted

Magento 2: Get image from the swatch id

You can get swatch Image from this, $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $swatch = $objectManager->create('Magento\Swatches\Helper\Data')->...
Keyur Shah's user avatar
7 votes

Magento 2 error in swatchRenderer.js at 'updateData' property

As I can't replicate this issue it's hard for me to say what the issue is exactly but following the code from the error it seems to be when $('[data-gallery-role=gallery-placeholder]').data('gallery') ...
Ben Crook's user avatar
  • 15.6k
6 votes

How to show visual swatch color on product listing page magento2

<?php/***********Display Color Attribute************/?> <?php $om = \Magento\Framework\App\ObjectManager::getInstance(); $attribute = $om->get(\Magento\Catalog\Api\...
Baharuni Asif's user avatar
6 votes
Accepted

Hide base product Images when pick a different color in Configurable Products

I get this using etc/view.xml file in my theme, with this configuration: <vars module="Magento_ConfigurableProduct"> <var name="gallery_switch_strategy">replace</var> </vars&...
lpFranz's user avatar
  • 689
5 votes

Visual swatches for attribute with input type multiselect

Let me preface this by saying the solution below is far more invasive than I initially thought it would have needed to be. Most notably the total overwrite of Magento_Swatches/js/product-attributes. ...
Pmclain's user avatar
  • 2,558
5 votes

Magento 2 can't get the selected color swatch value in options.phtml file

It's working fine When i tried like this. $('body').on('click', '.swatch-option', function(e) { alert("hello"); var swatchid = $('.swatch-attribute').attr('option-selected'); ...
Ramesh's user avatar
  • 986
5 votes
Accepted

color picker in configuration Mismatched anonymous define() module in Magento 2

As per your error you want to add adminhtml_system_config_edit.xml on path Vendor/Module/view/adminhtml/layout/adminhtml_system_config_edit.xml in your module and add below code: <?xml version=&...
Charmi Patel's user avatar
  • 1,016
4 votes

Change configurable swatches order in Magento 2

You have to edit configurable product, in configurable tab (product edit page) you can view option for Edit Configurations. Click on Edit Configurations, you can see select attribute screen, go to ...
Suresh Chikani's user avatar
4 votes

Magento 2: How to change image size of swatches?

I have investigated this issue. In file: Magento\Swatches\Helper\Media, we have this method: vendor/magento/module-swatches/Helper/Media.php /** * Merged config from view.xml * * @return array */...
De Nguyen's user avatar
  • 401
4 votes

Configurable swatches

The swatch extensions I know, as well as the 1.9 core module, use images of the simple products, so there is no way around duplicating the images. But you can avoid duplicating the actual image files ...
Fabian Schmengler's user avatar
4 votes

Enterprise 1.14.1 Swatches causing 35 sec plus load time on category pages

Additional way to improve performance configurable swatches when you have a lot of attribute options. For example if you have 2000 options and show 36 products in catalog list, in this case method ...
Yaroslav Voronoy's user avatar
4 votes
Accepted

Magento 2: Choose color via product image

I think in Magento 2 by default provides this functionality. To allow choose color via product image you have to set the "Use Product Image for Swatch if Possible" to Yes on your color attribute. ...
Kishor Thummar's user avatar
3 votes

how to get swatches attribute option in magento 2

You Can get all the swatches attribute option data with below code. <?php $attributes = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product); foreach ($...
Dinesh Yadav's user avatar
  • 6,397
3 votes

Magento 2 error in swatchRenderer.js at 'updateData' property

We had this same issue until we realized we were hiding the price of products on our category listing page. Apparently, swatch-renderer.js relies on classes on the price box to determine if it is on ...
leek's user avatar
  • 117
3 votes

Magento 2 error in swatchRenderer.js at 'updateData' property

I found a pretty efficient way to fix this: Copy the /vendor/magento/module-swatches/view/frontend/web/js/swatch-renderer.js-file to app/design/YourName/YourTheme/Magento_Swatches/web/js/swatch-...
Daan van den Bergh's user avatar
3 votes
Accepted

Unselect Attribute "Is Default" - Color

A work around is all I can seem to achieve. Add a new color. Save the attribute. Then delete the last color. Now the default color is again blank. Not a good solution, but it does work.
dawhoo's user avatar
  • 855
2 votes

How to use Magento 1.9.1.0 Configurable Swatches in Default package theme (or a custom theme)?

your solution is great but not show color swatch in category list or grid. Here I add the solution to show it, tested on magento 1.9.2.4. In : app/design/frontend/CUSTOM-THEME/template/catalog/...
Joso's user avatar
  • 317
2 votes

Configurable Swatches - showing up in product images

Do you maybe use a custom design or a third party extensions that does something with the media gallery? The swatches functionality has been introduced in 1.9, which is relatively recent. It could be ...
Peter Jaap Blaakmeer's user avatar
2 votes
Accepted

Receiving 500 Internal Server Error

That's a known issue I'm pretty sure there's a post about it on Magento SE but can't get my hands on it. Basically there's a speed bug in the attachConfigurableProductChildrenAttributeMapping method ...
Raphael at Digital Pianism's user avatar
2 votes

How can i disable Color Swatches Tooltip in Magento 2?

I wanted to disable the tooltip on just the product listing pages, so the JS solution wouldn't work as it removes them site-wide. For this, I relied on CSS: body.catalog-category-view .swatch-option-...
Geat's user avatar
  • 834
2 votes

Magneto2 : Add color swatch attribute option with colorcode value programmatically

Step 1 Start by creating a basic setup script for it, if you don't already have one. <?php namespace Package\Module\Setup; use Magento\Framework\Setup\UpgradeDataInterface; use Magento\Framework\...
Rakesh Donga's user avatar
  • 5,324
2 votes
Accepted

How can I get the HEX code in Visual Swatch via Rest API

Unfortunatly I didn't find any API to get hex or image of visual swatch attribute. After playing a bit i write a module which use extension attribute for AttributeInterface.... I've tried with ...
gregordonsky's user avatar
2 votes
Accepted

Magento 2 colour swatches not showing on homepage

I solved it myself:- Created a block file:- and add the following class in my constructor \Magento\Catalog\Block\Product\Context $context, \Magento\Catalog\Model\Product\Visibility $...
Gagan's user avatar
  • 1,478
2 votes
Accepted

How to disable a swatch, once it is been selected in Magento2.2?

I managed to stop the swatch being unselected by overriding part of the core swatch-renderer.js. I use Amasty's Color Swatches Pro so I made the change to the swatch-renderer.js in that module. I ...
SilkSpin's user avatar
  • 182
2 votes
Accepted

Magento 2 Get all the colors of a single Product?

Assume that you have configurable product object: Then first you have to get it all child products ids using $childrenIds = $configurableProduct->getTypeInstance()->getChildrenIds($...
Amit Bera's user avatar
  • 77.2k
2 votes
Accepted

Stop swatches from loading images on product detail

Product images are changed by default js file Magento_Swatches/js/swatch-renderer.js on click of swatch options, below is the responsible function for it- /** * Load media gallery using ajax or ...
Shashank Kumrawat's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible