34 votes
Accepted

How to display correct configured product image in shopping cart

Monocat, Magento have a existing feature to show simple product images at shopping cart. In order to show simple product image instead of configurable ,please goto admin ->System -> ...
user avatar
  • 75.5k
28 votes
Accepted

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

Copy the folder app/design/frontend/RWD/default/template/configurableswatches/ and its content to app/design/frontend/DEFAULT/default/template/ (or your package template folder) Copy the file ...
user avatar
  • 3,582
22 votes

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

Right. I detect problem on Mage_ConfigurableSwatches_Helper_Mediafallback::attachConfigurableProductChildrenAttributeMapping function. I make some changes on it. This increase performance. Try: ...
user avatar
  • 341
13 votes
Accepted

"Undefined Index Notice" in EavAttribute.php when adding a swatch option

Looks like problem in server settings. Please try increase max_input_vars setting to 100000 and try reproduce problem.
user avatar
  • 20.1k
11 votes

Execute JavaScript code after swatches are displayed in category view

I used the event 'swatch.initialized' to fire a function after swatches are loaded in the product page: $(document).on('swatch.initialized', function() { // do something }) The event is triggered ...
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> <...
user avatar
10 votes
Accepted

How to display swatches on homepage Magento 2

Create simple module for display swatches in configurable product in homepage. You have to follow below steps to get swatches on homepage product collection, app/code/Test/Homeslider/registration....
user avatar
10 votes
Accepted

Create Visual Swatch Attribute

Disclaimer: Parts of this code were taken from Magento_SwatchesSampleData core module. Also you might not need colorMap but I just put it there. This code was tested on Magento 2.1.4. I assume you ...
user avatar
9 votes
Accepted

Magento 2 replace a core javascript

Try below code in your requirejs-config.js var config = { map: { '*': { swatchRenderer: 'Muaw_CustomSwatches/js/SwatchRenderer' } }};
user avatar
  • 2,245
9 votes
Accepted

Don't display swatches on product listing in Magento 2

Finally I found the answer to my question, and I'm going to share it because maybe it helps somebody in the future: 1.- Enter to admin panel 2.- Stores (left menu) 3.- Product (under attribute ...
user avatar
  • 771
8 votes
Accepted

Don't display swatches on product listing

In System > Configuration > Catalog > Configurable Swatches set Product Attribute to Use for Swatches in Product Listing to -- Please Select --
user avatar
8 votes

Magento 2 replace a core javascript

The code works for me on Magento 2.1.5 var config = { map: { '*': { 'Magento_Swatches/js/swatch-renderer':'Vendor_Module/js/swatch-renderer' } } };
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:...
user avatar
  • 345
8 votes

Don't display swatches on product listing in Magento 2

Make sure in your theme you have a directory & file inside of your theme, this will overwrite the core code. Like so. Vender/Theme/Magento_Catalog/Layout/catalog_category_view.xml Once you ...
user avatar
8 votes
Accepted

Stop simple product images overriding main product gallery after clicking swatches

By adding the following code to the theme's view.xml the image from the simple product is now added to the product gallery rather than replacing the one associated with the configurable product. <...
user avatar
  • 172
7 votes
Accepted

Why does magento need to load all labels from universe to build color swatches?

I've created a module to override \Mage_ConfigurableSwatches_Model_Resource_Catalog_Product_Attribute_Super_Collection::_loadOptionLabels with the following: protected function _loadOptionLabels() { ...
user avatar
6 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\Model\Swatch')->load($swatchId); $...
user avatar
  • 17.4k
6 votes
Accepted

Magento 1.9 preselect of configurable options (swatches)

Assuming you are using rwd theme, it can also be achieved by adding below jQuery code to your catalog/product/view.phtml file. <script type="text/javascript"> jQuery(document).ready(function(){ ...
user avatar
5 votes

Configurable Swatches products in magento 1.9.0.1 version

Use Easylife Switcher and it workes for all version from 1.7 - 1.9.0.1. After these version your required features comes by default starting from 1.9.1.x. Donwload link: https://github.com/tzyganu/...
user avatar
  • 4,647
5 votes
Accepted

How can I stop other attributes changing my swatch image?

Facing with the same problem, today I wrote the following fix, it works both with attribute selectors and configurable swatches. $j(document).ready(function() { if (typeof ConfigurableMediaImages ...
user avatar
5 votes
Accepted

Configurable product image not switching with swatch change

After another day of digging I did get this working. I was on the right path to finding out what was broken, I was just in the wrong file. In the end, the JS that drives the image swap is the object ...
user avatar
  • 4,133
5 votes

Magento 2 create custom swatch attribute programmatically

This is similar to Magento 1, with a few differences. 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\...
user avatar
  • 310
5 votes

How to get visual swatch image from attribute_id?

Use Below code to get swatch image. <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $swatchHelper=$objectManager->get("Magento\Swatches\Helper\Media"); $...
user avatar
  • 6,159
5 votes
Accepted

How to add swatch data in Layered navigation aggregations in graphql?

I have override aggregations GraphQL API. Below code is working for me File:-Custom/Module/registration.php use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register( ...
user avatar
  • 3,131
4 votes

Swatch images on Magmi imported products removed when viewing product

Following way is working for me.Hope it will work for you! Setup of image attribute Following is way to add the media image(media/import) "P4102/2.jpg;P4102/3.jpg;P4102/4.jpg;P4102/5.jpg;P4102/6....
user avatar
4 votes

Magento color swatch images have black background when created from product image with transparency

I solved this problem by calling Varien_Image::keepTransparency(true) on the before it does the resize. Unfortunately, there's no event we can observe here, so we have to extend/override ...
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 ...
user avatar
4 votes
Accepted

Can Magento Configurable Swatches be disabled if not used?

You can disable Mage_ConfigurableSwatches without further ado. This module has been added on top in Magento 1.9.1 and no other core modules depend on it. It is integrated in the default RWD theme, ...
user avatar
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 ...
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 */...
user avatar
  • 391

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