18 votes
Accepted

Hide Configurable product images from details page when color swatch is selected

Try to use etc/view.xml file in your theme, with this configuration: <vars module="Magento_ConfigurableProduct"> <var name="gallery_switch_strategy">replace</var> </vars> ...
user avatar
  • 681
12 votes
Accepted

Magento 2 : How to display swatches in related products?

In app/design/frontend/MyCompany/mytheme/Magento_Catalog/templates/product/list/items.phtml please add below code : <?php if($_item->getTypeId() == \Magento\ConfigurableProduct\Model\Product\...
user avatar
8 votes

How to change product name dynamically in configurable product when click swatches Magento 2.3

Module Method Working For me in Magento 2.1 / 2.2 /2.3 :: The below Code is to change Name & Description both. 1. app/code/[VendorName]/[ModuleName]/registration.php <?php \Magento\...
user avatar
7 votes
Accepted

How to change product name dynamically in configurable product when click swatches Magento 2.3

You must create a module that will override the "ConfigurableProduct" and "Swatches" modules of Magento. I made you something based based on a solution from an author of this forum (As soon as I ...
user avatar
6 votes

Magento 2 : How to display swatches in related products?

In 2.2.5 we're doing the following to achieve the swatches, essentially it replicates the code from the Mage_Catalog::product/list.phtml template where swatches are by default. Firstly you need to ...
user avatar
4 votes

Magento 2 : How to display swatches in related products?

To display Swatches along with the product name, thumbnail, etc, just like on the Category product lists, I did this in my Theme: Create this file: app/design/frontend/MyCompany/mytheme/...
user avatar
  • 1,277
4 votes

Magento 1.9 - How to debug - Configurable product price changed to 0 if chooses colors attribute

The most likely issue is that you are using an extension which is changing how configurable products work or your theme is doing it. Most extensions regarding configurable products change the ...
user avatar
  • 2,707
3 votes
Accepted

change product detail based on configurable product dropdown

you need to override configurable.js file in your theme app/design/frontend/Vendor/Theme/Magento_ConfigurableProduct/web/js/configurable.js /** * Copyright © Magento, Inc. All rights reserved. * ...
user avatar
3 votes
Accepted

Color swatches in filter layered navigation

https://www.templatemonster.com/help/magento-how-to-use-color-swatches-in-layered-navigation.html This link will be helpful....
user avatar
  • 3,160
3 votes

Want to display label or respected value on the visual swatch attribute at Layered navigation?

If you want to add text in swatches then you should use "Text Swatch" instead of "Visual Swatch". Refer below screenshot:
user avatar
3 votes

Magento 2 - Show swatches of simple products (out of stock) in configurable product

I've found this workaround: I've overridden in my custom theme this phtml vendor/magento/module-catalog/view/frontend/templates/product/view/form.phtml Around line 35 you find <?php if ($...
user avatar
2 votes
Accepted

how to change an attribute value after clicking swatches based on sku in magento 2.1

Here are the steps to change value of sku on base of option selection: Step 1: (override class using di.xml) <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
user avatar
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 ...
user avatar
  • 172
2 votes
Accepted

Magento2 Swatch change Image does not slide to first Image

... I think, I found the bug. Magento removed sliding to first image in swatch-render.js: updateBaseImage: function (images, context, isInProductView) { var justAnImage = images[0], ...
user avatar
  • 413
2 votes
Accepted

Custom swatch message 'This is a required field'

This is what exactly you are looking for. @max pronko has describe everything in detail here how to change custom validation with magento mixin. Full Youtube Video Guid Here Thanks to Max Pronko
user avatar
  • 2,038
2 votes
Accepted

Dropdown swatch has to display the concerned text

you need to override swatch-renderer.js file in your theme app/design/frontend/Vendor/Theme/Magento_Swatches/web/js/swatch-renderer.js Download file from this link : Swatch Renderer Note : run ...
user avatar
1 vote

Magento2 swatch image change Ajax return 404

Stumbling upon the very same issue, after upgrading a Magento 2.1.6 installation to 2.3.5, was able to retrace the cause. As stated by @Narendra Vyas, make sure every rewrite (for example, custom ...
user avatar
  • 86
1 vote
Accepted

How magento 2.3 generates swatch images?

vendor/magento/module-swatches/etc/view.xml path to override app/design/frontend/{Package}/{themename}/etc/view.xml example : <?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. ...
user avatar
  • 2,152
1 vote

Magento 2 configurable product price not update

You have not provided information that how you have created variations. Have you assigned price to different price to all variants? I have created configurable product with 4 variants as you shown ...
user avatar
  • 456
1 vote
Accepted

In Magento 2, how to bypass cache for a custom block template extended from \Magento\Swatches\Block\Product\Renderer\Listing\Configurable?

I resolved using a different approach. As the logic I previously used is within the template, cache caused the problem. Now I injected the additional parameter into "jsonSwatchConfig" array and tried ...
user avatar
1 vote

Magento swatch is not disabled when configurable product is not on stock

Try indexing : php bin/magento indexer:reindex php bin/magento cache:flush
user avatar
  • 111
1 vote
Accepted

Magento 2 : How to get product size Swatches in Configurable product page?

Found the Answer Add appropriate block in your Product page <block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" name="product.info.options.swatches_inside_modal" template="...
user avatar
1 vote

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

You could do this with modifications to the swatch-renderer.js. Adding a couple of lines of code to the _OnClick event within here like below will disable pointer events and drop the opacity so the ...
user avatar
  • 5,215
1 vote

Unavailable configurable swatches on product page showing available on load until mouseover

You can find var swatchesConfig declared in template/configurableswatches/catalog/product/view/type/options/configurable/swatches.phtml. On the latest Magento 1.9.4.5 it should be declared in template/...
user avatar
1 vote
Accepted

Configurable Swatches Not Showing on Category Page

Incase anyone is experiencing the same problem, the problem was the catalog.xml file - items were missing from this.
user avatar
1 vote
Accepted

Configurable Swatches: Uncaught Error: Call to a member function provide() on null

I was only able to fix this with a core hack. Above: $swatchAttributes = $this->swatchAttributesProvider->provide($product); Put this: if (!isset($this->swatchAttributesProvider)) { $this-...
user avatar
  • 11
1 vote

Magento 2: Swatch image upload not working due to js error

I have a solution for your issue. It cause is the role of admin .. Please change ADMIN_RESOURCE from Magento_Swatches::iframe to Magento_Backend::admin in file Magento\Swatches\Controller\Adminhtml\...
user avatar
1 vote

How to change custom image on change of configurable product option change

As you can see in app/design/frontend/Magento/luma/etc/view.xml. <vars module="Magento_ConfigurableProduct"> <var name="change_only_base_image">false</var> </vars> <...
user avatar
  • 1,688
1 vote
Accepted

Configurable product image resolution issue

I was basically overthinking it. The solution is dead simple: 1. Go to Configuration > Catalog > Product Image 2. Change the product Small Image Width to the width you need 3. Clear cache 4. ...
user avatar
  • 51

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