Using Woocommerce Checkout Page With PmPro membership.


In this tutorial we will learn how to use woocommerce checkout page with PmPro memberships. This is usefull to the users who do not want to use PmPro checkout page and instead use woocommerce checkout page even for memberships.

Steps to do:

  • First please download this free plugin: Paid Memberships Pro – WooCommerce Add On, (its assumed that the PmPro plugin is already installed).
  • Now upload the plugin on the website and activate the plugin.
  • Now add this code in your function.php file (child theme), if not using a child theme then add the below code in your wplms-customizer.php file present in your wplms customizer plugin:
    function pmpro_woocommerce_redirect_checkout(){
      $id = get_option('pmpro_checkout_page_id');
      global $post;
      if($post->ID == $id && !empty($_REQUEST['level'])){
        global $wpdb;
        $product_id = $wpdb->get_var($wpdb->prepare("SELECT pm.post_id FROM {$wpdb->postmeta} as pm LEFT JOIN {$wpdb->posts} as p ON p.ID=pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %d AND p.post_status='publish'",'_membership_product_level',$_REQUEST['level']));
            $checkout_url = WC()->cart->get_checkout_url();
            if ( sizeof( WC()->cart->get_cart() ) > 0 ) {
              foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
                $_product = $values['data'];
                if ( $_product->id == $product_id )
                    $found = true;
              // if product not found, add it
              if ( ! $found )
                WC()->cart->add_to_cart( $product_id );
              wp_redirect( $checkout_url);  
              // if no products in cart, add it
              WC()->cart->add_to_cart( $product_id );
              wp_redirect( $checkout_url);  
  • Now go to wp-admin->products->add new and create a new product with the name of the membership, like if you have a membership named as gold then create a product gold membership and select it in the membership setting, refer: and publish the product.
  • similarly create one product for each membership you have created and make sure its not mandatory to connect any course to these products.
  • Now use the PmPro plugin normally and connect the memberships to the courses instead of the products.
  • When the user clicks on take this course button she will be redirected to the membership page.
  • When the user selects a membership then she will be redirected to the woocommerce checkout page to the corresponding membership product.
  • Once the product is purchased, the user will get the access to the course.


NOTE:  You have to create only one product for each membership, you cannot connect same membership with different products.


Please refer the video on this:

Was this article helpful?

Related Articles


  1. overd0se

    honestly, thats a really great feature, but unfortunately it doenst works for “non registered users”. Is there any Possibility to adding this feature for everybody?

    1. overd0se

      Seems linke a provider problem which I solved.
      But on the other hand there is issue with the checkout. Because if y user already have a membership/product/course in their cart they cant remove it unfortunately in the checkout.

      1. mderooij

        Totally agree with this. It would be better to forward the customer to the cart page instead of the checkout page. Is that possible?

  2. Hi

    I have below scenario,
    we want the user to buy the 4 existing courses.
    He will be able to choose between differen payment types A=lifetime access B= 9,95€/month with minimum 12 month subscription and auto renewal at the end and 30days test-period C= 39,95€/per month with option to cancel every month, also one 30 days testing period.
    If the user buys one of this, he should get automatically access to the courses.
    Then if we they wish to end the subscription and we need an option to do that manually and after it the user shouldn’t have access to the course anymore and the subscription should end.

    I installed the following plugins for that, which plugins can fulfill my scenario:
    – woocommerce
    – WooCommerce Stripe-Gateway
    – woocommerce subscription
    – WPLMS WooCommerce Subscription Integration
    – PMPRO Membership plugin
    – Paid Memberships Pro – WooCommerce Add On

Leave A Comment?