If you like our themes and support, please SHARE our website! https://theme-sky.com/wordpress-themes/

Okay
  Public Ticket #938290
design problems
Closed

Comments

  •  2
    Pablo started the conversation

    Hello stormit:

    I asked a salesperson registered to use as a tester, load a product through dokan plugin. As expected, the image she chose was very small. But this is something I think will happen frequently. as you will see in the screenshot, everything is misaligned.

    How can i fix this? Thank you..

    the account you have on my site, is administrator.

  •  567
    Stormit replied

    Hi Pablo,

    One customer requested this feature to weDevs team https://wedevs.com/support/topic/minimum-image-size/. Please ask them again about this feature.

    You can also use the custom PHP code below

    add_action( 'admin_init', 'ts_custom_check_uploading_images_from_seller' );
    function ts_custom_check_uploading_images_from_seller()
    {
        if( !current_user_can( 'administrator') ){
            add_filter('wp_handle_upload_prefilter', 'ts_handle_upload_prefilter');
        }
    }
    
    function ts_handle_upload_prefilter($file)
    {
        $img = getimagesize($file['tmp_name']);
        $minimum = array('width' => '800', 'height' => '973'); /* Change image size which you want user to upload */
        $width = $img[0];
        $height = $img[1];
    
        if( $width < $minimum['width'] ){
            $file['error'] = "Image dimensions are too small. Minimum width is {$minimum['width']}px. Uploaded image width is $width px";
        }
        elseif( $height < $minimum['height'] ){
            $file['error'] = "Image dimensions are too small. Minimum height is {$minimum['height']}px. Uploaded image height is $height px";
        }
        return $file;
    }
    

    Best regards,

  •  2
    Pablo replied

    okay. this code is necessary to make some modification ?. I add it as you sent him and anyway allows loading of small images.

  •  2
    Pablo replied

    sorry. This code should be placed where I am placing the other codes? (CSS style sheet in the "child theme")

    or this should go into the code of dokan?
    I remember dokan allows independent control of the administrator in the management of products. (Add, delete, upload photos, check the shipping, stock, etc). I forgot to ask if you used or you tried before?

    thanks

  •  567
    Stormit replied

    Hi Pablo,

    It is the PHP code. You can add it into the functions.php file in your child theme (between the opening and closing php tags).

    This code checks all images which are uploaded by seller. It should be a feature of Dokan. I think it is necessary. So as I said: You should contact weDevs team about this feature

    Best regards,

  •   Pablo replied privately
  •   Stormit replied privately