Questions tagged [swatches]

Alternative way of presenting the selection of options for configurable products

Filter by
Sorted by
Tagged with
2
votes
4answers
821 views

Warning: array_merge_recursive() expects at least 1 parameter, 0 given

Warning: array_merge_recursive() expects at least 1 parameter, 0 given in /home/WEBSERVER/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 336 #0 [internal function]:...
0
votes
3answers
6k views

Magento 2 - Setting “Text Swatch” or “Visual Swatch” does not work. Attribute still shows as dropdown on frontend

I am trying to create basic text swatches for an attribute (instead of dropdowns). I created an attribute (for example, "size"), set the "Catalog Input Type for Store Owner" to "Text Swatch" and ...
0
votes
0answers
415 views

How to change and get minimum sale quantity in the qty box dynamically in configurable product view page

How I can change my configurable minimum sale quantity in the qty box dynamically when one option is selected, right now the product name, description, image is changed, I need to do the same with the ...
2
votes
0answers
883 views

How to create a custom product view page in a custom url in Magento 2

I need to create a custom product view page in a different custom url. So, i created a custom module for this. But it didn't loads configurable, grouped, bundle swatches. Added the module below: ...
2
votes
0answers
657 views

Magento 2 : How to save swatch_text attribute options programatically?

I'm creating a product attribute with input type 'swatch_text'. But I'm able to save option value but swatch text value is not saving. Can anyone help me in saving the marked field in screenshot ...
1
vote
0answers
177 views

Issue in product image color in magento 2.2X?

I have two swatches i.e., red and black And when a user clicks red colour it changes the colour of the image But in cart the image is base image only. So the issue is, Selected options image isn'...
0
votes
2answers
1k views

Stop simple product images overriding main product gallery after clicking swatches

I've upgraded from 2.1.9 to 2.2.3. Now on a configurable product page when a swatch is selected the product page gallery images get overridden by the simple product image for each swatch. This didn'...
3
votes
3answers
1k views

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

I am trying to disable a swatch, once after it has been selected. So it should not be deselected... How to do it in Magento2.2.x ?
2
votes
1answer
769 views

Product attribute don't save in backend

When trying to save the backend product attribute, it says saved but the same settings are there. I try to change from visual swatch to text swatch, and it saves the text swatch but doesn't update the ...
1
vote
1answer
2k views

Magento 2 Uncaught SyntaxError: Invalid or unexpected token

When I tried to select the product color swatch and product size I got this error in production mode. Uncaught SyntaxError: Invalid or unexpected token at new Function (<anonymous>) at ...
0
votes
2answers
230 views
0
votes
0answers
929 views

Can't change dropdown attribute to visual swatch on Magento 2

I tried to change a dropdown attribute, for color, to a visual swatch on a test magento2 environment but cannot get it working, does anyone have some advice? When I changed the color attribute to a ...
1
vote
0answers
146 views

Magento : Multiple Configurable Swatches on Product Listing Page

I want to show multiple configurable swatches on product listing page. For that I created configurable_category.phtml where I replicated configurable.phtml file to showing the configurable swatches ...
0
votes
1answer
2k views

Magento 2 - Removing swatches.css from theme

Its a pretty simple and straightforward question, at the moment my theme seems to be pulling through the following: Vendor/default/en_GB/Magento_Swatches/css/swatches.css this isn't in my theme, ...
1
vote
1answer
385 views

Magento : Remove Swatch Selection

This has probably been asked before but I can't seem to find it. Is there a way with javascript to clear or reset a configurable swatch selection?
3
votes
1answer
1k views

Magento 2 Init script after page load

Is there any option to init (text/x-magento-init) script after page load? Example, I am working on a simple quickview feature and my controller returns my a layout - phtml file - with rendered html ...
3
votes
3answers
2k views

How to Auto Select The Color as Swatch Option for Products with Only One Color (on Magento 2.1 Product View)?

I'm trying to have swatch option value of color auto-selected for Products that only have one color. If a user selects some product from the category page, the product page is displayed with ...
0
votes
0answers
287 views

Configurable Product image swapping with swatch image?

I want to know that if, we select any swatch color for configurable product it will add feature image of product but it also show the default image in thumbnail gallery. Like i have one product "kids ...
1
vote
1answer
455 views

Ordering attribute options on product page

We have a site with a number of colour swatch options. We have ordered the options in the attribute edit section but this does not seem to be taken into account when Magento renders the swatch options ...
3
votes
1answer
2k views

How to handle click event on configurable product attribute swatch on product page?

How can i handle click event on configurable product attribute on product page. i am trying to below code but its not work. <script type="text/javascript"> require(['jquery'],function($...
1
vote
1answer
425 views

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

i want to change an attribute value based on swatches selection for example based on swatches selection the SKU gets changes so how to change an attribute value?
1
vote
1answer
13 views

Which version added the core swatch for attributes support via URL hash?

The answer of this question https://magento.stackexchange.com/a/71077/61389 presented a core way to automatically select attributes values using the URL hash. We are developing a module that will ...
1
vote
0answers
498 views

swatches option validation for ajax add to cart issue detail page

I have installed Magento2.1.9 I have enabled ajax add to cart functionalities for product detail page. By following code <script type="text/x-magento-init"> { "#...
2
votes
1answer
1k views

Magento 2 product count in layer navigation for text swatches

I want to show the product count on layer navigation for text swatches. By default Magento providing this feature for normal attributes(Text, Dropdown, and multi-select) in layer navigation but is not ...
1
vote
0answers
917 views

Magento 2 - Get Swatch Image based on swatch label

I want to use a swatch based attribute basically as an image uploader for brand logos. I already have a brand attribute which i want to remain as is so the layered navigation is text however want to ...
1
vote
1answer
981 views

Change configurable product price on Listing Page

I have a configurable product with 3 configurations (Small, Medium, Large). Each configuration has different prices: Small = 10$ Medium = 11$ Large= 12$ When I click the configurations in the ...
1
vote
3answers
1k views

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

I am working on magento 2 and when i try to upload a swatch attribute image but each time i get the below error. Please check the below screenshot. I debug code more and found that image path error. ...
1
vote
1answer
2k views

Magento 2 Swatches issue

I have created a configurable product with multiple options. When clicking on swatches only the first product swatch image was getting displayed but when we click on the other swatches then also the ...
0
votes
1answer
82 views

Magento 2.1: Only admin can upload images to visual swatch

Administrators can upload images to visual swatches but users with limited access can't. I'm trying to find the resource to give this user role access to it but can't seem to figure out which one it ...
2
votes
1answer
423 views

Remove swatches only in layered navigation Magento 2.1.x

I enabled visual swatches for color attribute and they display correctly but I don't want them in layered navigation. I tried to change code in Magento_LayeredNavigation/templates/layer/view.phtml ...
1
vote
2answers
2k views

Load configurable product with preselected options of any one of simple product

How to load configurable product with preselected options of any one of simple product? For example I have a configurable product http://host/product/1. It have 2 associated simple products http://...
1
vote
0answers
204 views

Black and White Magento Visual Swatches displaying Hex instead of color swatch

We have swatches configured for our configurable products for users to select the color of the shirt from, everything seems to work fine except for the two black and white swatches, instead of ...
0
votes
1answer
2k views

Swatches price update in catalog

i'm trying to update price when i change swatches in catalog. I find this solution : from https://github.com/magento/magento2/issues/3150 app/design/CUSTOM/THEME/Magento_Swatches/templates/...
1
vote
3answers
3k views

Magento 2 text swatches sort order not working

I have a problem with the sort order of the text swatches. I use text swatches for configurable products (clothing with sizes) On the manage swatch tab of the attribute I have the following options ...
2
votes
1answer
5k views

How to get visual swatch image from attribute_id?

I want to get the visual swatch image from attribute_id, but I could not find how to get it. I want to get swatch image in getBrand() method, I have got attribute_id and attribute_option_id. <?...
5
votes
1answer
756 views

Change images as per Swatches using Custom Slider on Product Detail page

I have created Custom Slick slider to display product images on Product detail page. But I want to change images as per change on color Swatches. Note : I'm using getGalleryImagesJson() to retrieve ...
3
votes
2answers
2k views

How to create text swatch programmatically?

How to create text swatch programmatically? If, I follow method from saving controller in the product-attribute module (admin) then, I got first and the third field saved but not actual text swatch.
2
votes
2answers
5k views

Create Visual Swatch Attribute

Can anyone provide a working example for creating a visual swatch (or even a text swatch) attribute as part of a setup script. I've tried the example on Magento 2 create custom swatch attribute ...
2
votes
4answers
9k views

Don't display swatches on product listing in Magento 2

I want that the swatches display only in the product detail, but not on the product listing. I'm looking for the option to do not display the swatch options on product list, but I only find how to do ...
2
votes
3answers
2k views

Magento 1.9 preselect of configurable options (swatches)

Is there a way to have Magento 1.9 auto select one of its simple products from a configurable product when page loaded? Pre select first item is good enough for me.
0
votes
2answers
3k views

Magento 2 : How to Import Color and Size Swatch Attributes Using CSV

How to import color and size swatch attributes using csv.
1
vote
0answers
219 views

Configurable Swatches is impacting Performance of the website drastically

We are using Magento 1.9.1.4 CE and struggling to improvise the performance of the web pages primarily on the Checkout Page and Shopping Cart. When analyzing these web pages in terms of performance ...
0
votes
1answer
30 views

magento 2 graphic issue on product page

If I click on "buy" with an empty field, I get this message in the wrong position. Where can I find the template to edit this? Is there a solution? I've been troubling on it for days. Try this here ...
1
vote
2answers
227 views

Loading external JS Module breaks Configurable Swatches / PrototypeJS in Magento 1

I'm using an outside JS library built with Webpack and Babel. The library is self-contained and only adds a single global variable. When this library is loaded onto a product page, the hover-over and ...
3
votes
1answer
4k views

how to get swatches attribute option in magento 2

how to get progmatically swatches attribute option data in magento 2. I tried this:- \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\CollectionFactory $options = $this->...
1
vote
1answer
565 views

Magento - Fatal Error in Mediafallback.php - 1.9.2.4

Two categories on my website mrmobileuk.com are showing the following error: Fatal error: Unsupported operand types in app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php on line 61 ...
0
votes
1answer
217 views

Swatches are in reverse order in listing

So I have been working on getting the swatches functionality from the rwd theme to my custom theme. Everything is working except that the swatches appear in reverse order on the category listing page. ...
0
votes
1answer
1k views

Magento 2.1.3 - no Text Swatches on Frontend [SOLVED]

I created simple importer for attribute's values. It works really easy right now and it was necessary for import configurable products. Importer for attribute values works fine (I'll paste code later)...
6
votes
2answers
4k views

Main Image not updating when swatch is selected Magento 2.0.8

Having an issue on Magento 2.0.8 where I have a configurable product and simple products associated with it. The simple product have images and on the configurable product there are swatches shown ...
8
votes
1answer
7k views

How to display swatches on homepage Magento 2

I have two products sliders (based on \Magento\Catalog\Block\Product\Widget\NewWidget) on my homepage. I would like to add swatches to these product sliders. The sliders are added in my homepage....