I added swatch images for my brand. Swatch view

I get swatch data in my template:

$swatchData = $block->getSwatchData();

Next step - I show image inside my template:

$swatchThumbPath = $block->getSwatchPath('swatch_thumb',
                        $swatchData['swatches'][$option]['value']); ?>
<img src="<?=$swatchThumbPath?>" alt="<?= /* @escapeNotVerified */ $label['label'] ?>">

But on page I have compressed picture 110x78 pixels:

enter image description here

How can I get full-sized picture from swatch data?

1 Answer 1


You can try using swatch_image

 $swatchImagePath = $block->getSwatchPath('swatch_image',
  • 1
    I just delete 'swatch_thumb' block, and it works.
    – Ashen One
    May 8, 2019 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.