Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM › Remove shop link from frontend avatar
Tagged: remove shop link, WC_Product_Vendors_Utils
- This topic has 1 reply, 2 voices, and was last updated 4 years, 7 months ago by WCFM Forum.
- AuthorPosts
- September 18, 2019 at 10:03 pm #82330socialParticipant
Hello,
I would like to remove the link to the shop on the vendor dashboard frontend avatar (top left).
I have overrode the filter wcfm_store_logo as so
add_filter( 'wcfm_store_logo', function ( $store_logo ) { $vendor_data = $WC_Product_Vendors_Utils::get_vendor_data_from_user(); $logo = ! empty( $vendor_data['logo'] ) ? $ven:/dor_data['logo'] : ''; $logo_image_url = wp_get_attachment_image_src( $logo, 'thumbnail' ); if ( !empty( $logo_image_url ) ) { $store_logo = $logo_image_url[0]; $shop_link = get_term_link( apply_filters( 'wcfm_current_vendor_id', $WC_Product_Vendors_Utils::get_logged_in_vendor() ), $WC_PRODUCT_VENDORS_TAXONOMY ); if( $shop_link ) { //replaced a tags with div $store_logo = '<div class="wcfm_store_logo_icon" href="' . $shop_link . '" target="_blank"><img src="' . $store_logo . '" alt="Store Logo" /></div>'; } } return $store_logo; }, 50 );
Although i get a error
Uncaught Error: Class 'WC_Product_Vendors_Utils'
i am using this filter in my theme functions.php file copied the function straight from wc-frontend-manager/core/class-wcfm-wcpvendors.phpFrom what i understand WC_Product_Vendors_Utils comes from the plugin https://github.com/wp-premium/woocommerce-product-vendors/blob/master/includes/class-wc-product-vendors-utils.php which i do not have, although it does not error out when in use from wc-frontend-manager.
Shouldn’t i be allowed to use this class in my functions.php theme file?
Any other way of removing all the links to the vendor shop?
- September 19, 2019 at 6:57 pm #82513WCFM ForumKeymaster
Hi,
Please do not use that code, it was for some other multi-vendor plugin.
Use this code –
add_filter( 'wcfm_store_logo', function( $store_logo ) { $store_logo = ''; return $store_logo; }, 50 ); add_filter( 'wcfm_store_name', function( $store_name ) { $store_name = ''; return $store_name; }, 50 );
Thank You
- AuthorPosts
- You must be logged in to reply to this topic.