www.webdeveloper.com
Results 1 to 2 of 2

Thread: regenerating thumbnails in a multi shop in prestashop

  1. #1
    Join Date
    Mar 2012
    Posts
    40

    regenerating thumbnails in a multi shop in prestashop

    HI there!



    I have a multishop (2 shops), and the watermark module version 0.6 installed.



    Once I have uploaded a new watermark image using that module, I go to “Preferences” → “Images” → “Regenerate thumbnails” to regenerate the thumbnails for a specific shop. In “Multishop configuration for” I have selected the shop which I want to change the thumbnails.



    The problem is that “Regenerate thumbnails” is regenerating the thumbnails for the two shops. I only want it to regenerate the thumbnails for the selected shop.



    Any ideas to fix this?



    Thanks a lot!

  2. #2
    Join Date
    Oct 2014
    Posts
    1
    Hello,

    I just registered and this will be my first post for trying to help someone.

    I searched a lot and only found 1 question to this issue - your question. I need this solution for different reason, but it might help you (maybe with modifications)
    Its been almost a month since you posted it, but answer could still be usefull for you or others with this issue.
    File: classes/ImageManager.php
    PHP Code:
           $temp_str substr($src_filestrrpos($src_file'/')+1);
            
    $image_id substr($temp_str0strrpos($temp_str'.'));

            
    $image_shop_id Db::getInstance()->executeS('
            SELECT p.`id_shop_default`
            FROM `'
    ._DB_PREFIX_.'image` i
            LEFT JOIN `'
    ._DB_PREFIX_.'product` p
            ON i.`id_product` = p.`id_product`
            WHERE i.`id_image` = '
    .$image_id);

            
    // If image is a PNG and the output is PNG, fill with transparency. Else fill with white background.
            
    if ($file_type == 'png' && $type == IMAGETYPE_PNG)
            {
                
    imagealphablending($dest_imagefalse);
                
    imagesavealpha($dest_imagetrue);
                if (
    $image_shop_id[0]['id_shop_default'] != 1)
                    
    $transparent imagecolorallocatealpha($dest_image312623127);
                else
                    
    $transparent imagecolorallocatealpha($dest_image255255255127);
                
    imagefilledrectangle($dest_image00$dst_width$dst_height$transparent);
            }
            else
            {
                if (
    $image_shop_id[0]['id_shop_default'] != 1)
                    
    $white imagecolorallocate($dest_image312623);
                else
                    
    $white imagecolorallocate($dest_image255255255);
                
    imagefilledrectangle ($dest_image00$dst_width$dst_height$white);
            } 
    My code generates different backgrounds for images from different shops. But like i said, you should be able to modify code to get results for your issue.

    I hope I helped someone.

    Best regards, Minis

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles