19
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>
...
13
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\...
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.
For Magento 2.4 add mixin
1. app/code/[VendorName]/[ModuleName]/registration.php
<...
8
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 ...
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 ...
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/...
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 ...
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.
* ...
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....
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:
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 ($...
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-...
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 ...
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],
...
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
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 ...
1
vote
Magento 2 : Get Configurable Product using swatch-option
Following code work for me you can try it.
app\code\Vendor\Extension\etc\di.xml
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
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 ...
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. ...
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 ...
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 ...
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
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="...
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 ...
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/...
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.
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-...
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\...
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>
<...
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. ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
configurable-swatches × 101configurable-product × 42
magento2 × 40
swatches × 19
color-swatches × 17
magento-1.9 × 16
magento2.2 × 8
magento-2.1 × 7
product-images × 7
product × 6
configurable-product-options × 6
magento2.3 × 5
attributes × 3
price × 3
layered-navigation × 3
visualswatch × 3
php × 2
category × 2
product-attribute × 2
magento2.4 × 2
ajax × 2
jquery × 2
requirejs × 2
magento-2.2.5 × 2
wishlist × 2