Showing results for 
Search instead for 
Did you mean: 

How can we push configuration product data(colorswatch image and size

How can we push configuration product data(colorswatch image and size

How can we push colour swatch image and size through API in Magento २ , can someone help me... I have searched more but not found full details about this 


Re: How can we push configuration product data(colorswatch image and size

Hello arijitchotu,


I hope you are doing well!


Swatches are a great and efficient way to add more competitive advantages to your configurable products. Rather than selecting from the dropdown list, shoppers can choose what they like by clicking a swatch. In addition, Color Swatches play an important role in motivating customers to make purchase decisions. The configurable swatches can be used on the product and category pages and in layered navigation.


Text, color, or image swatches have proven effective tools in making product offerings demanding and informative.


You can follow these steps below to push the color swatch image and size through API in Magento 2.


I found the file to change the image and size of Swatches here, and it works:



Path to override: app/design/frontend/name/themename/Magento_Swatches/etc/view.xml


Magento 2 swatch configuration:


Click on the Color Attribute option under Stores Attributes Product.


From there, you can adjust all the available color swatch settings:

  • Catalog Input Type for Store Owner allows you to specify the input type. You can choose from the Dropdown Menu, Visual Swatch, and the Text Swatch.
  • Update Product Preview Image - To update the product image displayed on the catalog page when filtered by this attribute.
  • Use Product Image for Swatch - It allows replacing a swatch image with a product swatch or a base image.


Go to the Manage Swatches section (Values of Your Attribute) when you're done. Set the values for the selected attribute by clicking on the Add Swatch button. For example, if you choose a color swatch, you can add the colors you want and fill them into the text descriptions. You can also replace colors with images. Click on the arrow next to the color box and select Upload a file.


Note: You can define values only as a text for a text swatch. The easiest option is to use a dropdown type with text description values.


Adding a Color Swatch

  • You have to move from Stores -> Attributes-> Product from the Admin.
  • After the above step, you will be able to search for the color attribute and edit the attributes.
  • Then, you simply have to change to Visual Swatch in Catalog Input Type for Store Owner.


Click on the button named choose a color.


Uploading a Swatch Image:

  • From the Admin area, go to Stores> Attributes> Product.
  • You can search for the color attributes under the grid and click on the edit option.
  • Nextly, you will have to change the Catalog Input Type for Store Owner to Visual Swatch.
  • See the various Manage Swatch. Click on the Add Swatch to add a new color to your list.
  • Click on the Upload a file from the swatch menu.


Move to Products > Inventory > Catalog from the Admin

  • From there, you can use the filter to include only the appropriate product list.
  • You can click on the checkbox for all those items in which you wish to apply swatch and adjust the action to Update all the Attributes.


At last, click on Save the Product. To implement the swatch, you will have to tap on the Save button and remember to clear the cache from the Cache Management option.


I hope this helps you to push color swatch images and size through API in Magento 2



Rex M