Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Display number next to Wishlist
- This topic has 7 replies, 2 voices, and was last updated 4 years ago by Diana.
Viewing 8 posts - 1 through 8 (of 8 total)
-
AuthorPosts
-
March 24, 2020 at 2:03 pm #247107ART-ProvidersParticipantCan we display the wishlist number on the profile menu like the notification message etc show So if there are 5 items in wishlist, it could display (5) next to itMarch 25, 2020 at 7:57 am #247225DianaParticipant@ART-Providers add_action('wplms_logged_in_top_menu','loggedin_login_panel'); function loggedin_login_panel($loggedin_menu){ global $current_user, $wpdb; $count = $wpdb->get_var("SELECT count(*) FROM {$wpdb->postmeta} WHERE meta_key = 'wishlist_course'"); $loggedin_menu['custom']=array( 'icon' => 'icon-exclamation', // Grab icon code from here : yoursite.com/wp-content/themes/wplms/css/icons-reference.html 'label' => __('Wishlist'.($count),'vibe'), 'link' => 'http://yoursite.com/members/'.$current_user->user_login.'/profile/change-avatar/' ); return $loggedin_menu; } Check this code and add in wp-admin > Plugins >Editor > Select WPLMS Customizer Plugin > wplms-cusstomizer.phpMarch 26, 2020 at 5:17 pm #247498ART-ProvidersParticipantThank you. Tried this but this did not seem to work. Could anything be wrong hereMarch 27, 2020 at 2:23 pm #247666DianaParticipant@ART-Providers, That's strange it was working on my localhost. Don't worry let me debugMarch 29, 2020 at 7:21 pm #247882ART-ProvidersParticipantThanks. Also, just to let you know, adding that code had messed up the course creation on our system so can you check that too. We have remove the code to fix itMarch 30, 2020 at 8:24 am #247957DianaParticipant@ART-Providers, I don't want to debug the code on your site diectly. Can you please share cpanel details. So that, I can safely debug the code P.S. mark your reply as privateMarch 30, 2020 at 11:04 am #247971ART-ProvidersParticipantWe do not have cpanel details. Do you mean FTP details?March 30, 2020 at 6:27 pm #248034DianaParticipant@ART_providers, yes, please then share the FTP details if this corrected code will not work add_action('wplms_logged_in_top_menu','loggedin_login_panel'); function loggedin_login_panel($loggedin_menu){ global $wpdb; $user_id = bp_displayed_user_id(); $count = $wpdb->get_var("SELECT count(*) FROM {$wpdb->usermeta} WHERE meta_key = 'wishlist_course' AND user_id = $user_id"); $loggedin_menu['custom']=array( 'icon' => 'icon-heart', // Grab icon code from here : yoursite.com/wp-content/themes/wplms/css/icons-reference.html 'label' => __('Wishlist'.($count),'vibe'), 'link' => 'http://yoursite.com/members/'.$current_user->user_login.'/profile/change-avatar/' ); return $loggedin_menu; } Here is the screenshot: http://prntscr.com/rpnbyv
-
AuthorPosts
Viewing 8 posts - 1 through 8 (of 8 total)
- The topic ‘Display number next to Wishlist’ is closed to new replies.