Hi
I run a marketplace with wcfm plugins.
Furthermore, each customer can choose a store to affiliate with, the choice is saved in the affiliated_store_id user details
I want that when a user affiliated with shop1 logs in, they see the shop1 logo and not the default one of the site
Same for all users
Previously I used the gizmos theme and the function shown below.
How to adapt it for the current theme?
Thanks
add_filter(‘gizmos_core_filter_get_header_logo_image’, ‘change_header_logo_image’, 999, 2);
function change_header_logo_image($logo_image, $parameters)
{
$user_id = get_current_user_id();
$affiliated_store = get_user_meta($user_id, ‘affiliated_store’, true);
if (!empty($affiliated_store)) {
$store_id = get_user_meta($user_id, ‘affiliated_store_id’, true);
// Get store
$store = wcfmmp_get_store($store_id);
// Get store logo
$store_logo = $store->get_avatar();
if (!empty($store_logo)) {
// unset($logo_image[‘logo_main_image’]);
$logo_image = ‘
‘;
}
}
return $logo_image;
}