Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

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

Open

Description

@waltersonntag

// 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.

Activity

  1. tungnxt89 commented on Feb 21, 2025

    @tungnxt89
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions