Customize vendor’s storefront – fix map error – logout redirect
Home / Topic / WCMp Vendor Staff / Customize vendor’s storefront – fix map error – logout redirect
WCMp Vendor Staff
Customize vendor’s storefront – fix map error – logout redirect Resolved
Tagged: Customize storefront, logout redirect, map issue
- This topic has 6 replies, 4 voices, and was last updated 7 months, 1 week ago by
NerdySupportExpert Moumita.
-
AuthorPosts
-
-
December 27, 2019 at 1:59 PM #86905
Rockjohn
ParticipantHello there!
I would like to customize the vendor’s shop page, both by using css and by adding extra fields like the ones added when any of the provided shortcodes is used. I ‘ve tried WCMp > Vendor > Vendor Frontend > Custom CSS, but this section seems to be working only for the vendor dashboard.
Is there any other way for targeting the vendor’s storefront page?Also, I ‘ve seen others (on this support forum) asking about overiding templates but yet I haven’t found any complete guidance about doiong so. What is the proper way to edit templates or add them in a single page (shop + store map for example)?
Another issue is adding filters. The filters are added in a popup (in my product archives) and hence are not appearing on the vendor’s shop page. Could I add another popup in that page as well so that one can filter only vendor’s products this time? Do you have any better suggestions? And on top of that, do you have any product filters plugin in mind that you recommend in order to be more compatible wiht WCMp so I can avoid future conflicts?
3rd issue: After accepting geolocation this message shows up, “This page can’t load maps correctly”. I thought everything was set up fine but turns out there is an error. Do you have any common reasons in mind as to why maps are not showing as they should.
Lastly, is there any way to redirect to home page upon logout (logout from vendor’s dashboard). Current setting leaves vendor on same page and so a login form replaces dashboard after logging out.
Thank you so much for your time!
-
December 28, 2019 at 4:25 AM #86947
NerdySupportExpert Moumita
KeymasterHi Rockjohn, thanks for reaching WCMp support.
Our replies are inline –
– Is there any other way for targeting the vendor’s storefront page?
>> You need to add the css in the style.css of your current active theme, only then they will be reflected on the sho page.
Please note, the css added via WCMp custom css part, will only affect the dashboard area.
– Also, I ‘ve seen others (on this support forum) asking about overiding templates but yet I haven’t found any complete guidance about doiong so. What is the proper way to edit templates or add them in a single page (shop + store map for example)?
>> In order to override the template, you need to follow a certain procedures.
This doc will help you out better:https://wc-marketplace.com/knowledgebase/wcmp-overriding-templates/– After accepting geolocation this message shows up, “This page can’t load maps correctly”. I thought everything was set up fine but turns out there is an error. Do you have any common reasons in mind as to why maps are not showing as they should.
>> This error usually occurs if the Google Map API Keys are not set properly. Kindly make sure that you have set up the API Keys properly. For further help, you may follow this document to set up the API Keys – https://developers.google.com/maps/documentation/javascript/get-api-key
– Lastly, is there any way to redirect to the home page upon logout (logout from vendor’s dashboard). Current setting leaves vendor on the same page and so a login form replaces dashboard after logging out.
>> Currently the vendor upon logout is redirected to this page – https://prnt.sc/qgp0qs. Now, in order to change this flow, you have to do custom code. For this please do follow this code guide :
add_action('wp_logout','auto_redirect_after_logout'); function auto_redirect_after_logout(){ wp_redirect( 'Enter your page link here' ); exit(); }
CopyLet us know if you have any further queries.
-
January 16, 2020 at 4:22 PM #88300
Rockjohn
ParticipantHi,
– I ‘ve managed to resolve most of the issues with your help. Regarding the maps, just in case anyone faces the same problem, I just added the Places API as it is illustrated in the attached images.
– Also, I was able to override the template and add my own CSS but I was wondering whether there is any way to prevent loading default/unused CSS so I can stop using ” !important ” in custom CSS. I could customize the whole page myself if possible.
– In regards to the redirection, it works fine but what if I want it to affect only the logout through the Vendor’s dashboard?
I ‘ve tried this approach but it didn’t work ( I don’t have a lot of experience in this kind of code! ):function logout_redirect(){
$user = wp_get_current_user();
if ( in_array( ‘dc_vendor’, (array) $user->roles ) ) {
wp_redirect( ‘My-home-page’ );
exit();
}
}
add_action(‘wp_logout’,’logout_redirect’);Do you have any idea how to achieve that? Basically, what I want is to hide this login form so that all users (including vendors) are only able to log in via the main login/register form of my site.
Regards,
George
Attachments:
-
January 17, 2020 at 8:31 AM #88359
sumit singh
KeymasterHi, add following code in functions.php of your active theme :-
add_filter('wcmp_vendor_dashboard_header_right_panel_nav', 'redirect_vendor'); function redirect_vendor($nav) { $nav['logout']['url'] = esc_url('add your redirect url here'); return $nav; }
Copy -
January 24, 2020 at 12:10 PM #88818
Rockjohn
ParticipantHi!
Thanks for the code. Now the link redirects vendors to other pages upon clicking but it doesn’t log out them from the site.
-
January 25, 2020 at 8:04 AM #88844
NerdySupportExpert Moumita
KeymasterSorry, use this updated code :
add_filter('wcmp_vendor_dashboard_header_right_panel_nav', 'redirect_vendor'); function redirect_vendor($nav) { $nav['logout']['url'] = esc_url(wp_logout_url('http://wcmpdemos.com/moumita/my-account/')); return $nav; }
Copy -
June 15, 2020 at 11:42 PM #98481
NerdySupportExpert Moumita
KeymasterI presume that your issue is resolved, since, we haven’t heard back from you.
We are marking this thread as resolved.
Kindly open a new thread if you face any further query.
-
-
AuthorPosts
The topic ‘Customize vendor’s storefront – fix map error – logout redirect’ is closed to new replies.