Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer able to use my theme's enroll button template override - // TEST code in codebase #584

Open
waltersonntag opened this issue Dec 14, 2024 · 1 comment

Comments

@waltersonntag
Copy link

// Test
$singleCourseTemplate = SingleCourseTemplate::instance();
$course = CourseModel::find( get_the_ID(), true );
$user = UserModel::find( get_current_user_id(), true );
echo $singleCourseTemplate->html_btn_purchase_course( $course, $user );
return;
// End test

Why is this here? Should this // Test code be here?

It breaks my ability to override the enroll button template file with a custom override file that exists in my theme. The return line at line 188 prevents the code further down the function which checks for custom theme template override files.

@tungnxt89
Copy link
Collaborator

Hi waltersonntag,

We need to improve the old code that has existed for a very long time. To fix some cases where the developer overrides files, we have encountered errors such as when we want to change variables or logic. The overridden file cannot adopt these new changes, it always retains the old logic and variables, making it difficult to control all override cases via files, which can lead to Fatal errors.

In the new code, we are changing the way we override templates. Developers should use the hooks provided by LearnPress instead of overriding files. This approach makes it easier to debug, maintain, and update the code.

Thanks.
Best Regard!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants