-
Posted in : Efor
-
Hey Guys,
i got a Problem with the native Tutor LMS Payment Gateway. When i used the testing enviroment everything was fine and working.
But after changing to the Live Enviroment, the checkout Page refreshes when i hit the Pay Now Button…
additional question:
is there a possibility to use the cart icon from woocomerce with the native payment from tutor lms?I tried the Icon Box Witget in the Top Right Bar. I can insert Icons, but the Links are not working on clicking…
Can you help me?
also i got the Problem that my Coupon Code ist not working…
i got some news:
The native Payment ist working. Because of the Guest Purchase, i can´t make a booking with an already registered E-Mail. With a new E-Mail it work´s fine.
Already registered E-Mails have to login themselves first. But it would help if the user could see a error message.
But the Problem with the Linked Icon-Box, not redirecting and the Problem with Coupon Codes still exists.
I tried new Coupons, without any limits, but none is valid when i am testing…
So pls, i still need your help.
Hey there!
It sounds like you’re dealing with a few different issues with Tutor LMS and WooCommerce. Let’s break them down one by one and see if we can find solutions:
Problem: Users with already registered emails cannot make a booking without logging in first, and there’s no clear error message.
Solution: Tutor LMS likely enforces this behavior to prevent duplicate accounts or conflicts. However, you can customize the error message to make it clearer for users.
You can use the following code snippet in your theme’s functions.php file or a custom plugin to display a more user-friendly error message:add_filter('tutor_login_required_message', 'custom_tutor_login_required_message'); function custom_tutor_login_required_message($message) { return __('You must log in to purchase this course. If you already have an account, please log in. Otherwise, use a different email address.', 'tutor'); }
Problem: The links in the Icon Box Widget are not working when clicked.
Check for JavaScript Errors:
Open your browser’s developer tools (F12 or right-click > Inspect > Console) and check for any JavaScript errors when clicking the link.
Disable Plugins:
Temporarily disable other plugins to see if there’s a conflict. If the links start working, re-enable the plugins one by one to identify the culprit.
Test with a Default Theme:
Switch to a default WordPress theme (e.g., Twenty Twenty-Three) to see if the issue is theme-related.Problem: Coupon codes are not working, even when created without any limits.
Check Coupon Settings:
Go to WooCommerce > Coupons and verify the following:
The coupon is published and enabled.
The coupon is applicable to the specific courses or categories.
The coupon has no restrictions (e.g., usage limits, date restrictions).Test with a Simple Product:
Create a simple WooCommerce product (not a course) and apply the coupon to see if it works. This will help determine if the issue is specific to Tutor LMS courses.
Clear Cache:
Clear any caching plugins or server-side caching.
Disable Plugins:
Temporarily disable other plugins to see if there’s a conflict. If the coupon works, re-enable the plugins one by one to identify the issue.
Check WooCommerce Logs:
Go to WooCommerce > Status > Logs and check for any error logs related to coupons or Tutor LMS.
Solution:
If the coupon works with simple products but not with Tutor LMS courses, there might be an integration issue between WooCommerce and Tutor LMS. In this case:
Ensure that Tutor LMS is properly configured to use WooCommerce as the payment gateway.If you’ve tried all the above steps and the issues persist, it might be worth reaching out to the Tutor LMS support team or the WooCommerce support team for further assistance. They can provide more specific guidance based on your setup.
Let me know if you need further clarification or help! 😊
Hey Serkan,
Thank you for your fast reply!
Well i tried to fix the Problems:
1. PROBLEM:
i copied that to the functions.php but the message was not displayed, that code seem not to work,add_filter(‘tutor_login_required_message’, ‘custom_tutor_login_required_message’);
function custom_tutor_login_required_message($message) {
return __(‘Du musst dich einloggen, um diesen Kurs zu kaufen. Wenn du bereits ein Konto hast, melden dich bitte an. Andernfalls verwende eine andere E-Mail Adresse.’, ‘tutor’);
}2. PROBLEM:
The ICON BOX Top Right not clickableThe Console shows me this Errors:
Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
jquery-migrate.min.js?ver=3.4.1:2 JQMIGRATE: Migrate is installed, version 3.4.1
5useUserExtension-7c796cda.js:70 Uncaught (in promise) Error: redacted
at useUserExtension-7c796cda.js:70:27056
complianz.min.js?ver=1728599502:1 opt-in– but it seems to me that this has nothing to do with the ICON BOX.
– After Changing Theme to twnty twnty four, the Icon Box was missing, so i could not Test it.
– Other Plugins don´t seem to make any Impact3. PROBLEM:
Coupon Codes are made with TUTOR LMS itself. I am not using WooCommerce. Therefore i need to much Plugins. Doné want to slow the Site even more down.
I want to use tha TUTOR LMS native eCommerce System!
Thats why the rest of your Suggestions won´t help me.
I already tried to get help from Tutor LMS Support, but they won´t help me. They said that i have to contact you.
4. PROBLEM
i don´t use any caching Tool, none of them even with the lowest cache Setting can Speed up my Site witouht breaking it…
I am looking forword for more help…
Hi,
I will forward this topic to our developer and i will keep you updated.
ThanksHey Guys,
any news?
Hi @Konstantin_
Thank you for your patience! I completely understand your eagerness for an update, and I truly appreciate your understanding as we work to resolve this matter.Our developer is currently addressing your issue as part of their prioritized tasks. While we don’t have a final solution just yet, please rest assured that your request is being actively worked on. We’re committed to providing you with a resolution as soon as possible.
I’ll keep you updated with any progress and will reach out immediately once we have more information. If you have any additional questions or need further assistance in the meantime, feel free to let me know!
Thank you again for your patience and understanding.
Hi, I will forward your questions to the TutorLMS team on behalf of you. Can you please summarize all of your questions and also provide your wp-login details.
Thanks.
Hi,
Problems within the Theme:
– ICON-Box in the Header: both Icons do not redirect to the Link by clicking.
Preblems with TUTOR LMS
1 Problem: Users with already registered emails cannot make a booking without logging in first, and there’s no clear error message.
Solution: Tutor LMS likely enforces this behavior to prevent duplicate accounts or conflicts. However, you can customize the error message to make it clearer for users.
You can use the following code snippet in your them:This Code-Snippet does not work:
add_filter(‘tutor_login_required_message’, ‘custom_tutor_login_required_message’);
function custom_tutor_login_required_message($message) {
return __(‘Du musst dich einloggen, um diesen Kurs zu kaufen. Wenn du bereits ein Konto hast, melden dich bitte an. Andernfalls verwende eine andere E-Mail Adresse.’, ‘tutor’);
}2. Problem: Coupon Codes not working i get this Error: “Coupon Code is not applicable!”
for all Coupon Codes i tried. Even the Codes witouht any limitations.3. Problem: additional Checkbox for the Registration Form for Privacy policy
How to Add a Checkbox for general terms and conditions and a second one for Privacy policyHi, I got a response from the TutorLMS Team, can you try these and see if it works for you;
Issue 1: Custom Error Message for Existing Users
The code snippet you provided seems to have incorrect quotation marks. Ensure you are using the correct PHP syntax. Here is the corrected version:add_filter('tutor_login_required_message', 'custom_tutor_login_required_message'); function custom_tutor_login_required_message($message) { return __('Du musst dich einloggen, um diesen Kurs zu kaufen. Wenn du bereits ein Konto hast, melden dich bitte an. Andernfalls verwende eine andere E-Mail Adresse.', 'tutor'); }
Place this code in your theme’s functions.php file. Ensure that your theme is active and that there are no syntax errors elsewhere in the file.
Issue 2: Coupon Codes Not Working
Check Coupon Settings: Ensure that the coupons are set up correctly in the Tutor LMS settings. Verify that there are no restrictions that might be causing the issue.Plugin Conflicts: Deactivate other plugins one by one to check if there is a conflict causing the coupon codes to fail.
Update Plugins: Ensure that both Tutor LMS and WooCommerce (if used) are updated to the latest versions.
Debugging: Enable debugging in WordPress to check for any error messages that might give more insight into the issue. Add the following line to your wp-config.php file:
define(‘WP_DEBUG’, true);
Issue 3: Adding Checkboxes for Registration Form
To add additional checkboxes for Privacy Policy and Terms & Conditions, you can use the following approach:Custom Code: Add the following code to your theme’s functions.php file to add checkboxes to the registration form:
add_action('tutor_registration_form_before_submit', 'add_custom_checkboxes'); function add_custom_checkboxes() { ?> <p> <input type="checkbox" name="terms_conditions" id="terms_conditions" required> <label for="terms_conditions">I agree to the <a href="your-terms-url">Terms and Conditions</a></label> </p> <p> <input type="checkbox" name="privacy_policy" id="privacy_policy" required> <label for="privacy_policy">I agree to the <a href="your-privacy-url">Privacy Policy</a></label> </p> <?php } add_action('tutor_before_register', 'validate_custom_checkboxes'); function validate_custom_checkboxes() { if (!isset($_POST['terms_conditions']) || !isset($_POST['privacy_policy'])) { wp_die(__('You must agree to the Terms and Conditions and Privacy Policy to register.', 'tutor')); } }
Replace URLs: Make sure to replace your-terms-url and your-privacy-url with the actual URLs of your terms and privacy policy pages.
Testing: After adding the code, test the registration form to ensure the checkboxes appear and function correctly.
Ensure you have backups of your site before making changes to the code.
Btw, I am working on a solution for the icon box issue with the theme.
Hi, about the icon box issue, I replaced your icon boxes in your top bar with the default image widget and added a link, they look the same when adding this custom CSS code (I already added it to your site)
.top-bar img { max-height: 32px; width: auto; }
We will also try to fix the icon box issue with future updates.
Thanks for the feedback!
Hi, thank you for your response,
Issue 1: wp-content/themes/efor/functions.php
I added this:
add_filter(‘tutor_login_required_message’, ‘custom_tutor_login_required_message’);
function custom_tutor_login_required_message($message) {
return __(‘Du musst dich einloggen, um diesen Kurs zu kaufen. Wenn du bereits ein Konto hast, melden dich bitte an. Andernfalls verwende eine andere E-Mail Adresse.’, ‘tutor’);
}but still no message ist shown…
Issue: 2 Coupons setup ist checked, an even codes without any limitation not working….
With almost all Plugins disabled i still get the same error…
All Plugins are up to date
Cant Test the Coupon in Debug mode, i get this error Message on the checkout site: (see private Content)
Issue 3: i added this to the function.php but it made no changes:
add_action(‘tutor_registration_form_before_submit’, ‘add_custom_checkboxes’);
function add_custom_checkboxes() {
?>
<p>
<input type=”checkbox” name=”terms_conditions” id=”terms_conditions” required>
<label for=”terms_conditions”>Mit der Registrierung akzeptiere ich die Allgemeinen Geschäftsbedingungen</label>
</p>
<p>
<input type=”checkbox” name=”privacy_policy” id=”privacy_policy” required>
<label for=”privacy_policy”>Mit der Registrierung akzeptiere ich die Datenschutzerklärung</label>
</p>
<?php
}add_action(‘tutor_before_register’, ‘validate_custom_checkboxes’);
function validate_custom_checkboxes() {
if (!isset($_POST[‘terms_conditions’]) || !isset($_POST[‘privacy_policy’])) {
wp_die(__(‘You must agree to the Terms and Conditions and Privacy Policy to register.’, ‘tutor’));
}
}Thank you for fixing the icon Box!
Hi,
We have forwarded your reply to Tutor LMS support again and we are waiting for a response.
Also, The issue might be that the filter isn’t being applied correctly. Try these improvements:
Make sure you’re using straight quotes (‘) instead of curly quotes (‘ and ’)
Add a priority if needed:add_filter('tutor_login_required_message', 'custom_tutor_login_required_message', 10, 1); function custom_tutor_login_required_message($message) { return __('Du musst dich einloggen, um diesen Kurs zu kaufen. Wenn du bereits ein Konto hast, melde dich bitte an. Andernfalls verwende eine andere E-Mail Adresse.', 'tutor'); }
Also check if:
The Tutor LMS plugin is active
The text domain ‘tutor’ is correct
There are no JavaScript errors on the page that might prevent messages from showing.Issues 2,
For coupon issues:
First, check if coupons are enabled in Tutor LMS settings:
Go to Tutor LMS → Settings → Monetization → Enable Coupons
Try this basic test:
Create a simple coupon with no restrictions (100% off, no usage limits)
Apply it on a course with a logged-in user
Debugging steps:
Check your server error logs for any related errors
Temporarily switch to a default theme (like Twenty Twenty-One)
Disable all plugins except Tutor LMS and WooCommerce (if using)Issues 3,
Your code looks correct, but here are some improvements:
https://ibb.co/C5kzJ8rPThanks
Hi again, here is a new response from the plugin support team;
1-) Custom Error Message for Existing Users To override the message properly, you will need to modify the original template for the modal or page. The provided snippet might not work as expected if it was generated incorrectly. Instead, you can try customizing the error message by editing the template file directly within your theme.
2-) Coupon Codes Not Working Coupon codes will not apply if the course has a sale price set. Please try using the coupon on a course without a sale price and see if it works.
3-) Adding Checkboxes for Terms & Privacy Policy You can follow this step-by-step process to add checkboxes for Terms & Conditions and Privacy Policy to your registration form:
Step 1: Add Required Fields & Save Metadata Add the following code to your theme’s functions.php file:
// Add required fields for terms, newsletters, and privacy policy add_filter('tutor_student_registration_required_fields', 'required_terms_newsletters_callback'); if (!function_exists('required_terms_newsletters_callback')) { function required_terms_newsletters_callback($atts) { $atts['agree_terms'] = 'You must agree to the Terms & Conditions.'; $atts['privacy_policy'] = 'You must agree to our Privacy Policy.'; return $atts; } } // Save checkbox values after registration add_action('user_register', 'save_checkbox_after_registration'); add_action('profile_update', 'save_checkbox_after_registration'); if (!function_exists('save_checkbox_after_registration')) { function save_checkbox_after_registration($user_id) { if (isset($_POST['agree_terms'])) { update_user_meta($user_id, '_agree_terms', 'yes'); } if (isset($_POST['privacy_policy'])) { update_user_meta($user_id, '_privacy_policy', 'yes'); } } }
Step 2: Modify the Registration Form Template
Locate the registration.php file in your theme: yourtheme/tutor/dashboard/registration.php
Add the following checkboxes near line 165 (or wherever the form fields are located):I agree to the Terms & Conditions
I agree to the Privacy Policy
You can find the code reference at https://codefile.io/f/yaXGUvpLC5
Let me know if you need further clarification.
You must be logged in and have valid license to reply to this topic.