Jump to content

Retirer fond blanc image produit Prestashop 1.7


Recommended Posts

Bonjour,

Je souhaite savoir s'il est possible de retirer le fond blanc des images produits sur Prestashop 1.7 ?

J'ai beaucoup d'images et je ne pourrai pas toutes les remplacer une à une...

Est-ce que ce genre de solution pourrait fonctionner avec une adaptation pour la 1.7? :

https://www.majory-cubizolles.fr/blog/supprimer-le-cadre-blanc-autour-de-vos-images-sous-prestashop/

 

En vous remerciant.

Link to comment
Share on other sites

Bonjour.

Faites un override  de imageManager.php

vers la ligne 283 $white >> $transparent

        // If image is a PNG and the output is PNG, fill with transparency. Else fill with white background.
        if ($fileType == 'png' && $type == IMAGETYPE_PNG) {
            imagealphablending($destImage, false);
            imagesavealpha($destImage, true);
            $transparent = imagecolorallocatealpha($destImage, 255, 255, 255, 127);
            imagefilledrectangle($destImage, 0, 0, $destinationWidth, $destinationHeight, $transparent);
        } else {
            $white = imagecolorallocate($destImage, 255, 255, 255);
            imagefilledrectangle($destImage, 0, 0, $destinationWidth, $destinationHeight, $white);

 

Puis dans votre fichier custom.css

#products .thumbnail-container, .featured-products .thumbnail-container, .product-accessories .thumbnail-container, .product-miniature .thumbnail-container {

    background: transparent;
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...