Tiago Barbosa
New Member
How change default avatar for new user and customers? I have a Gravatar account with same e-mail (tiago@noveweb.com.br), but the default avatar remains with the [G].
Yii::app()->hooks->addFilter('customer_get_gravatar_url', function($currentAvatarUrl, $customer, $size){
return '//www.gravatar.com/avatar/'. md5($customer->email) .'?d=identicon&s=' . $size;
});
Yii::app()->hooks->addFilter('user_get_gravatar_url', function($currentAvatarUrl, $user, $size){
return '//www.gravatar.com/avatar/'. md5($user->email) .'?d=monsterid&s=' . $size;
});
Hi, were you able to change the default avatar?How change default avatar for new user and customers? I have a Gravatar account with same e-mail (tiago@noveweb.com.br), but the default avatar remains with the [G].
Use those filters as specified above.Hi, were you able to change the default avatar?
<?php
hooks()->addFilter('customer_get_gravatar_url', function($currentAvatarUrl, $customer, $size){
return '//www.gravatar.com/avatar/'. md5($customer->email) .'?d=identicon&s=' . $size;
});
hooks()->addFilter('user_get_gravatar_url', function($currentAvatarUrl, $user, $size){
return '//www.gravatar.com/avatar/'. md5($user->email) .'?d=monsterid&s=' . $size;
});