Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

help overriding template

Home / Forums / Virtue Theme / help overriding template

This topic is: Not Resolved
[Not Resolved]
Posted in: Virtue Theme
August 6, 2016 at 8:35 am

Hi!,
I am using a plugin for wholesale called “wholesale suite premium”. I asked them if it is possible whenever a wholeseller logs in to be obvious somewhere at top of page like “welcome wholesaller” . I mean to make obvious at wholeseller that he is logged in until he signs out. They send me this as reply but i couldnt get it done:

” Hi Dimitris,

Thanks for the email.

Here is the fix that I suggested earlier:

In this case, you need to override your template file and it depends on where you want it to show up. For example, if you want to show it on the header, you need to modify your header.php file. You can do it by using this code:

global $current_user;
if (isset($current_user) && class_exists(‘WWP_Wholesale_Roles’)) {
$wwp_wholesale_roles = WWP_Wholesale_Roles::getInstance();
$wwp_wholesale_role = $wwp_wholesale_roles->getUserWholesaleRole();
//print_r($wwp_wholesale_roles->getAllRegisteredWholesaleRoles());

if (!empty($wwp_wholesale_role)) {
// This is a wholesale customer
$name = $current_user->user_firstname;
if ( !$name )
$name = $current_user->user_login;
echo sprintf( __( ‘Welcome wholeseller %1$s’ , ‘woocommerce-wholesale-lead-capture’ ) , “$name” );
echo ‘ / ‘;
echo ‘Log out‘;
}
}


I tried to copy paste at header.php but nothing changed… Do you have any idea that might help?
Kind regards,
Dimitris

  • The forum ‘Virtue Theme’ is closed to new topics and replies.