Skipping drip content for single purchase

Home Forums Legacy Support Support queries How-to & Troubleshooting Skipping drip content for single purchase

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #200358
    erickpaulino
    Spectator
    Hi, I am using WPLMS to sell online courses and I want to make my courses available in two different ways:
    1. Monthly subscription that give access to all courses
    2. Single course purchase (one time payment)
    When someone buy the monthly subscription, I want the content to be delivered with the drip content feature. But when someone buy a single course, I want to make it available without the drip content. Is it possible? How can I configure that? Thanks, Erick
    #200514
    logan
    Member
    Hello, No this is not available in wplms yet but you can achieve this by following steps below. 1) enable drip feed for all courses and then Please add this code in your wplms-customizer.php file in wplms customizer plugin : add_filter('wplms_course_drip_switch',function ($drip,$course_id){ if(!is_user_logged_in()) return $drip; $user = wp_get_current_user(); if(wplms_user_course_active_check($user_id,$course_id)){ $product_id = get_post_meta($course_id,'vibe_product',true); if(wc_customer_bought_product($user->user_email,$user->ID,$product_id)){ $drip = 'H'; } } return $drip; }); 2) you can use this plugin to achieve your goals. Please have a look on this tutorial: https://www.youtube.com/watch?v=5zXJzcyfUXY
    #201516
    erickpaulino
    Spectator
    Hi, Sorry, I didn't understand. Where exactly do I place this code? I can see that the plugin is installed but where do I find it's config page? Thanks
    #201545
    erickpaulino
    Spectator
    Hi, I found out where to add the code lines. But unfortunately it didn't work. As we dig into this, is it possible to manually turn off the drip content for a specific course and user? Thanks Erick  
    #201807
    Anshuman Sahu
    Keymaster
    To offer courses with full and partial access you can use pmpro with woocommerce . Woocommerce product purchase will give full access and... membership level purchase will give access to all courses (memberhsip level should be connected in all courses) refer this to know in detail and settings : https://www.youtube.com/watch?v=5zXJzcyfUXY   When someone buy the monthly subscription, I want the content to be delivered with the drip content feature. actually this is not available in wplms so we provided the code snippet to you to avail that. what code will do is : it will detect if user has purchased the full access to course using the woocommerce product and not with pmpro membership . checking this it will disable the drip if enabled for the course for that student .    
    #201920
    erickpaulino
    Spectator
    Hello, I will need your help to find a different solution because my payment gateway doesn't work with PMPRO, only with Woocommerce. To sell a subscription, I am using a Woocommerce Subscriptions product (Simple Subscription), and to sell a single course, I use a Woocommerce Simple Product (with Virtual option checked). Would you please help me change the access mode (with and without drip content) based on these two types of WC products? Thank you, Erick
    #202052
    Anshuman Sahu
    Keymaster
    Well yes the same will work simply follow this tip : https://wplms.io/support/forums/topic/bundle-multiple-courses/#post-57959 to sell the subscription . and the main product which will have one associated course only and the same product will be connected back to the course also in associated product settings in course edit page .
    #202071
    erickpaulino
    Spectator
    Hi Alex, What about the dripping? I'm afraid you did not understand. I need to remove the dripping for simple products and keep it for the subscription product.
    #202076
    erickpaulino
    Spectator
    I think I am almost accomplishing what I want based on the code you provieded me. Can you just please clarify what does this line means: $drip = 'H'; And what other options I have for the variable $drip? Thank you, Erick
    #202160
    Anshuman Sahu
    Keymaster
    well S means drip is enabled in settings and H means disabled .So we are forcefully disabling the drip by setting it to " H " there in that code . By default you will have to enable the drip for all your courses in course settings in front end course edit .
    #202357
    erickpaulino
    Spectator
    Hi, I am having an issue. I am associating two different products to the same course, using the code that I got from here: https://wplms.io/support/knowledge-base/show-multiple-pricing-for-course-via-woocommerce/ The problem is that the drip skipping code that you have provided me only works for the product set up in the first Associated Product field. The courses I set on the second Associated Products field are not skipping the drip. Can you please help me fix the code? Thanks, Erick  
    #202374
    erickpaulino
    Spectator
    Hello guys, I think I did it. I have made some preliminar tests and it seems to be working. The code below checks both fields of Associated Products and, because of my own needs, only disables the drip option for simple products. Hope this may help someone.   /* CODIGO PARA REMOVER DRIP CONTENT DOS COMPRADORES DE CURSO AVULSO https://wplms.io/support/forums/topic/skipping-drip-content-for-single-purchase/#post-201516 */ add_filter('wplms_course_drip_switch','checaDrip',10,2); function checaDrip($drip,$course_id){ if(!is_user_logged_in()) return $drip; $user = wp_get_current_user(); if(wplms_user_course_active_check($user_id,$course_id)){ $product_id = get_post_meta($course_id,'vibe_product',true); $more_products = get_post_meta($course_id,'vibe_more_products',true); // primeiro campo de associate products if(wc_customer_bought_product($user->user_email,$user->ID,$product_id)){ $product = get_product( $product_id ); if($product->is_type('simple')){ $drip = 'H'; } } // segundo campo de associate products if(!empty($more_products) && is_Array($more_products)){ foreach($more_products as $product_id){ if(isset($product_id) && $product_id !='' && function_exists('get_product')){ if(wc_customer_bought_product($user->user_email,$user->ID,$product_id)){ // primeiro campo de associate products $product = get_product( $product_id ); if($product->is_type('simple')){ // somente se o procuto for simples $drip = 'H'; } } } } } } return $drip; };
    #202479
    Anshuman Sahu
    Keymaster
    Well yes the code we provided will not work with this tip :   Thanks for sharing the updated code . hope this works for others looking for same .
Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Skipping drip content for single purchase’ is closed to new replies.