• Resolved Allyson

    (@allysonsouza)


    Hi,

    I wonder if there’s a way to set WooCommerce products will not be accessible, instead the user will be redirected to the course page.

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hello @allysonsouza,

    Students don’t get to see Woocommerce products as Tutor course simply integrates a product from within the course builder option.

    Just remember to select simple, virtual and tutor- under the Woocommerce product data.
    Don’t select variable, grouped, downloadable or other forms of product.

    There is also an option to hide courses from shop page.

    Thread Starter Allyson

    (@allysonsouza)

    Hi @munayam, great, I’ve checked my settings and now courses are hidden in shop page, but if the user clicks on course title in cart/mini-cart they still goes to the product page, there’s a way to prevent that?

    I thinking about the same option. If we are able to redirect woo-commerce products to the course page, so we can easily do also filtering for the woo-commerce products.

    Hi

    I tried to generate the issue in my local environment. But sorry to say that I could not reproduce the issue.
    Can you please share a screencast?
    You can also send a mail at [email protected] for faster support.

    Thread Starter Allyson

    (@allysonsouza)

    Hi @probillals,

    What are you trying to reproduce? In my understanding I’m asking for something Tutor don’t really cover, which is the prevention of user accessing the product single directly, or trough mini-cart/cart links. For now I’m considering a redirect with third-party plugin, to always send users from product to course page.

    Hello @allysonsouza,

    Sorry about the misunderstanding. We have a Trello board to request new features in Tutor LMS- https://trello.com/invite/b/6ad4TJpn/7c3eafbd9687c25b5859d17af508bb2a/tutor-lms-feature-request

    I am not sure if we should override WooCommerce behavior from our plugin. Because there are a good number of people who use Tutor LMS side by side with their physical store and they might not want to have this feature. So, you may add the request to the Trello board. If we get more requests for this feature, we will definitely consider this.

    Paty

    (@patriciafontanillo)

    I made this code to redirect to the course in case the product is associated.

    function redirectTutorCourse() {
        $post_id = get_queried_object_id();
        $is_tutor = get_post_meta( $post_id ,'_tutor_product', true);
        if($is_tutor == 'yes'){
            global $wpdb;
            $results = $wpdb->get_results( "SELECT post_id FROM $wpdb->postmeta WHERE meta_value = " . $post_id ." AND meta_key = '_tutor_course_product_id' ", ARRAY_A );
            if(isset($results[0]['post_id'])){
                wp_redirect( get_permalink($results[0]['post_id']));
            }
        }
    }
    add_action( 'template_redirect', 'redirectTutorCourse' );

    It can be added in the functions.php of the child theme.

    I hope that helps.

    hello @patriciafontanillo Your code worked very well, thanks for your attention.

    The plugin is great, I really think there should be an option to redirect products to courses native to the plugin.
    Can you tell me if the pro version already comes with native payment?

    Hey @foostore,

    We do not have native payment feature yet. We are planning to develop it this year.

    Hi, @SekanderBadsha,

    Tks atetetion

    Mauricio

    (@mauriciogarofalo)

    This code for function.php doesnt work. How can I redirect users clicking in product name (cart) to course instead of woocommerce product page?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Redirect WooCommerce product single to course single’ is closed to new replies.