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
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:
vendor/magento/module-swatches/etc/view.xml
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:
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
Click on the button named choose a color.
Uploading a Swatch Image:
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
---------------
Regards,
Rex M