Redirect to course page from product page

Home Forums Legacy Support Support queries Other issues Redirect to course page from product page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #261350
    stevenheong
    Spectator
    Hi support team, I followed the instruction here and problem happened: https://wplms.io/support/forums/topic/redirect-product-page-to-course-page/  
    1. the code did work for redirecting the product page to course page, when clicking the product link both in the cart page and my order page

    2. however, after adding the code, the take this course in the course page will be not working, and only reload the page only. Therefore, students can not add the course to the cart and subscribe to the course.

    #261521
    Veronica
    Moderator
    hi, please provide the exact information according to your site. like product page url to which you want to redirect it and course page url on which you want to redirect it i will try to take a look
    #265753
    ICHARS
    Spectator
    I am facing a similar issue, so instead of creating another thread I am just sharing the steps to recreate the problem:
    1. Create a course (A) and add a woocommerce product (A) to the same

    2. Now you will notice that there is a Course Page (A) and also a Product Page (A). On the course page (A) when you click the take this course button, it works perfectly.

    3. Now redirect Product Page (A) to Course Page (A) using any redirection plugin or code in htaccess file or the code mentioned on https://wplms.io/support/forums/topic/redirect-product-page-to-course-page/ 

    4. Now try visiting the Product Page (A), it will redirect to Course Page (A). So the redirection works perfectly but on the Course Page (A) now the take this course button no longer works.

    Kindly suggest. If you would like me to create another thread do let me know, but it is the exact same issue that the thread creator and I seem to be facing.

    #266118
    Anshuman Sahu
    Keymaster
    Please set wp-admin -> wplms -> miscellaneous -> direct checkout -> skip product page . This will remove the user from going to product page clicking on product link in the cart .
    #266190
    ICHARS
    Spectator
    Skipping the product page and going directly to checkout page works perfectly but that is not the problem that I am referring to. I am not sure if you understand what we are trying to do.  Maybe I have not been able to explain this clearly so let me try to go step by step. Current Behaviour: When a course is created that has a woocommerce product associated to it, there are two pages that get created on the website.
    1. Course Page

    2. Woocommerce Product Page

    The wocommerce product page really does not contain any useful data as the complete course information is on the course page. Desired Behaviour: If a user visits the product page I would like to redirect them back to the course page. My initial thoughts were that any redirection plugin in wordpress or a simple 301 redirect from product page to course age should do the trick. The problem is when a 301 redirect is done from the product page to course page, the take this course button on the course page stops functioning. To recreate the issue, kindly follow the steps mentioned here

    #266355
    Anshuman Sahu
    Keymaster
    Yes the redirection with .htaccess will make the direct checkout to stop working . I got the issue now . remove your .htaccess redirection and please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :     add_Action('woocommerce_before_single_product',function(){   $courses = get_post_meta(get_the_ID(),'vibe_courses',true);   if(!empty($courses) && count($courses)){     echo  '    <meta http-equiv="refresh" content="0;URL=\''.get_permalink($courses[0]).'\'" />';   } });
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Redirect to course page from product page’ is closed to new replies.