Change the allowed size of the Vendor Logo

The default image size for the Vendor’s logo is a small 100 x 100 pixels. On my site, I reformatted my vendors page to look exactly like the woocommerce categories shortcode displays them. I therefore hid the cover photos and turned the logo image into a large 400 x 400 pixel square, with the vendor’s name underneath.

Problem I ran into was that WCMp will crop these logos on upload to that 100 x 100 size, and then making them larger with CSS alone makes the images super blurry. This snippet will change the default logo parameter to whatever you want it to be.

Note 1: For this to work, you also have to find the vendor-lists.php template and override it in your child theme. Find the line where it references “100,100” and change that to match.

Note 2: Also, if you’re doing this on a site that is already established, each vendor will have to re-upload their logo to set the new crop. I actually did that on their behalf by using the “User Switching” plugin, but that was only because I separately had their logos.

As always, this is either added to your Child Theme’s functions.php file, or consider using the My Custom Functions Pro plugin to manage and organize all your snippets.

add_filter('wcmp_frontend_dash_upload_script_params', 'change_default_vendor_logo_size');

function change_default_vendor_logo_size( $image_script_params ) {
$image_script_params['default_logo_ratio'] = array(400, 400);    // Change your width and height as per your choice.

return $image_script_params;
}

// MUST ALSO OVERRIDE VENDOR-LISTS TEMPLATE AND CHANGE 100,100 to MATCH, THEN RESAVE FROM VENDOR ACCOUNT TO FIX THE CROP.

Tested and working on Woocommerce 4.6.1, WCMp 3.5.10

Is this no longer relevant or not working? Please let us know in the comments!

Comments on this post

Your email address will not be published. Required fields are marked *