A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.
33

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 -> Configuration ->Sales -> Checkout -> Shopping Cart -> Change Configurable Product Image value to Product Thumbnail Itself and click on save save config to ...


27

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 app/design/frontend/RWD/default/template/catalog/product/view/type/options/configurable.phtml to app/design/frontend/DEFAULT/default/template/catalog/product/...


22

Right. I detect problem on Mage_ConfigurableSwatches_Helper_Mediafallback::attachConfigurableProductChildrenAttributeMapping function. I make some changes on it. This increase performance. Try: Copy /app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php to /app/code/local/Mage/ConfigurableSwatches/Helper/Mediafallback.php. On /app/code/local/...


13

Looks like problem in server settings. Please try increase max_input_vars setting to 100000 and try reproduce problem.


10

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.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Test_Homeslider', ...


10

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 have an extension called Goivvy_Custom. I also assume you know how to install the extension and have magento run install scripts. The code below will create ...


9

Try below code in your requirejs-config.js var config = { map: { '*': { swatchRenderer: 'Muaw_CustomSwatches/js/SwatchRenderer' } }};


8

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


8

The code works for me on Magento 2.1.5 var config = { map: { '*': { 'Magento_Swatches/js/swatch-renderer':'Vendor_Module/js/swatch-renderer' } } };


7

I've created a module to override \Mage_ConfigurableSwatches_Model_Resource_Catalog_Product_Attribute_Super_Collection::_loadOptionLabels with the following: protected function _loadOptionLabels() { if ($this->count()) { $attributeIds = array(); $productId = false; $filterLabels = false; foreach ($this->_items as $...


6

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> <images module="Magento_Catalog"> <image id="swatch_image" type="swatch_image"> <width>50</width> ...


6

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 in Magento_Swatches/js/swatch-renderer.js $(this.element).trigger('swatch.initialized');


6

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(){ jQuery(".configurable-swatch-list li:first-child a").each(function(){ jQuery(this).children("span").trigger("click"); }); }); </script>


5

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/Switcher


5

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 === 'undefined' || typeof optionsPrice === 'undefined' || typeof Product === 'undefined') return; /** * Returns true, if there is a label-matching ...


5

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:clean 3) Resize images : php bin/magento catalog:images:resize 4) Flush browser cache (F12 in Chrome, then right click refresh icon and choose "Emtpy Cache ...


5

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 ConfigurableMediaImages which is defined and setup in this file skin/frontend/{{vendor}}/{{theme}}/js/configurableswatches/product-media.js. I was de-...


5

You can get swatch Image from this, $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $swatch = $objectManager->create('Magento\Swatches\Model\Swatch')->load($swatchId); $imageName=$swatch->getData('value'); if(!empty($imageName)){ $imagePath=$objectManager->create('Magento\Swatches\Helper\Media')->getSwatchMediaUrl().$...


5

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 have this file add the following referenceBlock <referenceBlock name="category.product.type.details.renderers" remove="true"/> To the body section like so: ...


5

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 section) 4.- Select the attribute you want to edit, for example color 5.- Storefront Properties (in the Attribute Information menu on the left) 6.- Look for Used ...


4

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.jpg;"


4

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 Mage_ConfigurableSwatches_Helper_Productimg::_resizeSwatchImage. Maybe someone else (you?) can propose a more future-proof solution. etc/config.xml: <?xml version="1....


4

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 Mage_ConfigurableSwatches_Model_Resource_Catalog_Product_Attribute_Super_Collection::_loadOptionLabels() will join to each super_attributes option labels and you ...


4

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, but only using its own layout XML and own templates. To disable core modules without changing core files I would recommend adding a new file, for example ...


4

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 if you rewrite the media attribute model. Here is a module that does it, it compares the MD5 hash of uploaded images and reuses existing files: https://github....


4

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\Framework\Setup\UpgradeDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; class UpgradeData ...


4

Use Below code to get swatch image. <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $swatchHelper=$objectManager->get("Magento\Swatches\Helper\Media"); $swatchCollection = $objectManager->create('Magento\Swatches\Model\ResourceModel\Swatch\Collection'); // brand logo is my Visual Swatch attribute $optionIdvalue = 53; ...


3

if you are using ce-1.9.1.0 ee-1.14.1. or higher, the feature is already built in, with the so-called Configurable Swatches which allow "Product Image Swap". You can enable this feature in System > Configuration > CATALOG > Configurable Swatches Swap Images Defined by Option Label One way to configure swap images is to upload images to a configurable ...


3

TL;DR: Don't use Mage_ConfigurableSwatches with Greek letters. Magento tries to transliterate all characters to ASCII, replace remaining non word characters with hyphens and then convert the string to lowercase. The relevant code in Mage_ConfigurableSwatches_Helper_Data is: public function getHyphenatedString($str) { $result = false; if (...


3

I can recommend you and alternative for the default color swatches. This free extension. it allows you to do what the color swatches do and more but without the headache of naming conventions. You can change the dropdowns to labels, colors or even simple product images. and the main image can be changed to the simple product image for all attributes not just ...


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