fsBuilds Offloading WooCommerce Checkout & Subscriptions to (Video) (Video)

Feb 8, 2024

Let the complexities of payments Management, Subscriptions and Payment Management to

Task to be completed: You want to utilize WooCommerce as well as WordPress as a CMS, but need to make use of a Merchant of Record to manage subscriptions, payments and the management of subscriptions.

In this post, we're featuring a build by Topher DeRosia showing the way to easily utilize 's javascript library in combination with  webhooks that enable subscriptions after a purchase is made, or disable subscription access when the payment is not successful while using WooCommerce as a CMS.

 Resources

Interested in trying the build your own way? We've compiled all those resources featured in the video to guide you along the route.

 Add a subscription to the Cart

PHP and Javascript    is_purchasable() && ( ! is_user_logged_in() || 'no' === wcs_get_product_limitation( $product ) ) )   return;   $user_id = get_current_user_id();  echo wp_kses_post( wc_get_stock_html( $product ) );  if ( $product->is_in_stock() ) : ?>       var QueryString = function ()   // This function is anonymous, is executed immediately and  // the return value is assigned to QueryString!  var query_string = ;  var query = window.location.search.substring(1);  var vars = query.split("&");  for (var i=0;i<vars.length;i++)   var pair = vars[i].split("=");  // If first entry with this name  if (typeof query_string[pair[0]] === "undefined")   query_string[pair[0]] = decodeURIComponent(pair[1]);  // If second entry with this name   else if (typeof query_string[pair[0]] === "string")   var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];  query_string[pair[0]] = arr;  // If third or later entry with this name   else   query_string[pair[0]].push(decodeURIComponent(pair[1]));      return query_string; ();     jQuery( document ).ready(function()    var s = ;   if(QueryString.product)   s =   'products' : [    'path':QueryString.product,  'quantity':1    ]       if(QueryString.email && QueryString.fname && QueryString.lname)   s.paymentContact = ;  s.paymentContact.email = QueryString.email;  s.paymentContact.firstName = QueryString.fname;  s.paymentContact.lastName = QueryString.lname;     if(QueryString.coupon)   s.coupon = QueryString.coupon;     if (s) .builder.push(s);  );           Subscribe Now With                 Expand

Subscription creation via Webhook

PHP and Javascript                Expand

Developer Documentation

Braden Steel

Braden Steel   Braden is the senior Product Marketing Manager of . If he's not busy bringing brand new products to market, he's spending his time writing fantasy stories.