Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Skipping drip content for single purchase
- This topic has 12 replies, 3 voices, and was last updated 5 years, 1 month ago by Anshuman Sahu.
Viewing 13 posts - 1 through 13 (of 13 total)
-
AuthorPosts
-
March 12, 2019 at 12:13 pm #200358erickpaulinoSpectatorHi, I am using WPLMS to sell online courses and I want to make my courses available in two different ways:
- Monthly subscription that give access to all courses
- Single course purchase (one time payment)
March 13, 2019 at 12:24 pm #200514loganMemberHello, 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=5zXJzcyfUXYMarch 21, 2019 at 10:50 am #201516erickpaulinoSpectatorHi, 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? ThanksMarch 21, 2019 at 11:27 pm #201545erickpaulinoSpectatorHi, 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 ErickMarch 25, 2019 at 9:33 am #201807Anshuman SahuKeymasterTo 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 .March 25, 2019 at 3:14 pm #201920erickpaulinoSpectatorHello, 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, ErickMarch 26, 2019 at 1:27 pm #202052Anshuman SahuKeymasterWell 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 .March 26, 2019 at 2:21 pm #202071erickpaulinoSpectatorHi 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.March 26, 2019 at 3:15 pm #202076erickpaulinoSpectatorI 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, ErickMarch 27, 2019 at 10:19 am #202160Anshuman SahuKeymasterwell 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 .March 28, 2019 at 2:58 pm #202357erickpaulinoSpectatorHi, 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, ErickMarch 28, 2019 at 7:23 pm #202374erickpaulinoSpectatorHello 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; };March 29, 2019 at 1:24 pm #202479Anshuman SahuKeymasterWell 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 . -
AuthorPosts
Viewing 13 posts - 1 through 13 (of 13 total)
- The topic ‘Skipping drip content for single purchase’ is closed to new replies.