1

I want to add Transparancy in this code line. I'm using Magento 1.9.3.10. I already tried ->backgroundColor(array(0, 0, 0, 0.4)) but this does not seem to work. It just show's black background.

Full code:

$_images = $_product->getMediaGalleryImages();
$_count = 0;
foreach ($_images as $_key => $_image) {
    if ($_count > 3) {
        $_images->removeItemByKey($_key);
        continue;
    }
    $_image->setThumbnailUrl(
        $this->helper('catalog/image')
            ->init($_product, 'image', $_image->getFile())
            ->backgroundColor(array(0, 0, 0))
            ->keepFrame(true)
            ->resize(100, 100)
            ->__toString()
    );
    $_image->setClickUrl(
        $this->helper('catalog/image')
            ->init($_product, 'image', $_image->getFile())
            ->constrainOnly(true)->keepAspectRatio(true)->keepFrame(false)->resize(400)
            ->__toString()
    );
    $_count ++;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.