How to Login & Shop as a Customer in WooCommerce
When creating an online store, there are plenty of elements to consider, but have you given any thought to the login page? You should not overlook presenting a nice one because it immediately affects the customer experience.
You may want to consider using a WooCommerce Login & Shop As Customer plugin to assist you to test the functionality of your online store. Creating an online store will be considerably simpler and straightforward with less failure if you use this plugin.
Apply Login & Shop as a Customer in WooCommerce – Methods
There are two basic methods to apply Login & Shop as a Customer for WooCommerce.
- Login & Shop as Customer in WooCommerce by KoalaApps
- Apply Login & Shop as a Customer in WooCommerce Programmatically
Method #1: Login & Shop as Customer in WooCommerce by KoalaApps
WooCommerce Login & Shop as Customer enables store admins to log in as a customer from the stores’ frontend. This is a helpful plugin to resolve troubleshooting and place orders on behalf of customers. This plugin also keeps a history of all login details for future reference.
Installation
- To install this plugin, search the .zip file from your WooCommerce account and begin the download.
- On the WordPress Admin Panel. Go to the Plugins section and click Add New to Upload Plugin.
- Upload the file to proceed with download.
Select Install Now and then Activate the plugin.
Setup and Configuration
Once the plugin is installed and activated, move on to configuration settings. On the WordPress Admin panel, you will notice a new menu item “Login as Customer”. Click on it to configure the plugin.
Configure General Settings
Click on the general settings of the Login & Shop as customer plugin to configure below settings:
- Enable login as customer settings
- Enable login history record
- Customize switch back button text
As you configure the plugin to your WooCommerce store, login as admin and go to the frontend. A new menu item “Switch to Customer” will appear in the admin header bar under the profile picture menu. Clicking on the “Switch to Customer” will open a new popup window. Here, you will be able to log in as any of your customers.
Enable/Disable Admin Login History
With the WooCommerce Login and Shop as Customer plugin, you can choose to enable or disable admin login history from the general settings tab. This login history provides a detailed record of login history in the form of a separate grid. This helps store owners to track which admin account was used to login as a customer along with recording a timestamp.
Method #2: Apply Login & Shop as a Customer in WooCommerce Programmatically
Below is the program-based implementation of Login & Shop as a Customer in WooCommerce.
add_action( 'wp_head', array( $this, ka_'custom_header_bar' ) );
/**
* Display option in header.
*/
public function ka_custom_header_bar() {
if ( ! empty( WC()->session->get( 'customer_session_set' ) ) ) {
?>
<form method="POST">
<div class="header_bar">
<input type="submit" name="submit_button" value="<?php echo esc_attr( get_option( 'ka_button_field' ) ); ?>" class="header-switch-btn">
</div>
</form>
<?php
}
}
Wrapping Up
We hope the above discussed methods to apply login and shop as customer functionality to your WooCommerce was helpful. For any queries, you can contact our support team.
Leave a Reply