In this tutorial, I’ll show you how to change the links in the SureCart customer dashboard. Specifically, we’ll update the “Back Home” button and the store logo URL to direct users to a specific page or an entirely different website. This customization can enhance the user experience by directing customers to relevant areas, such as a membership page or community platform.
Prerequisites
Before we begin, ensure that you are using a child theme for your WordPress site. If you’re not familiar with child themes or need to create one, you can find tutorials online specific to your WordPress theme.
For this tutorial, I’ll be using the Astra theme with a child theme already enabled. Astra has a Child Theme generator that you can use to customize a Child Theme. Enter your information download the theme, install it like you would any other theme, and activate it. Make sure you have Astra installed alongside it.
Step-by-Step Guide
1. Accessing the Theme File Editor
- Log in to WordPress: Log in to your WordPress dashboard.
- Navigate to Theme File Editor: On the left-hand side menu, go to
Appearance
and then selectTheme File Editor
.
2. Editing the functions.php
File
- Select
functions.php
: In the Theme File Editor, find and click onfunctions.php
from the list of theme files on the right. - Add the Functions: Scroll down to the bottom of the
functions.php
file and add the following functions:
add_filter('sc_customer_dashboard_back_home_url', function( $url ) {
return 'https://members.convology.com/';
});
add_filter('sc_customer_dashboard_store_logo_url', function( $url ) {
return 'https://members.convology.com/';
});
These functions use the add_filter
hook to change the URLs for the “Back Home” button and the store logo in the SureCart customer dashboard. Replace 'https://members.convology.com/'
with the URL you want your users to be directed to.
3. Updating the File
- Save Changes: After pasting the code, click
Update File
to save your changes.
4. Verifying the Changes
- View the Customer Dashboard: Navigate back to your WordPress dashboard, go to
Pages
, and find your customer dashboard page. - Click
View
: ClickView
to see the customer dashboard. - Test the Links: Click on the “Back Home” button and the store logo to ensure they direct you to the new URL you specified.
Example Use Cases
Redirecting to a Membership Page
You might want to send users to a specific membership page rather than the root of your website. For example, if you have a members-only area where users access their content or their purchase, you can set the URL to that page.
Redirecting to a Community Platform
If you’re integrating SureCart with a community platform like Circle or BuddyBoss, you can direct users back to their community dashboard. This creates a seamless experience where users can manage their purchases and subscriptions without leaving the community environment.