Search

Step Up Your WooCommerce Website with Prepaid Subscriptions Package

Listen to this article

prepaid-subscriptions-package-blogIf there is something that irks me a lot after substandard internet, it is having to make payments for the internet service every month. I don’t like having to go through the hassle of an additional step to continue using a service I have subscribed for.

Solution – I make advance payments for a complete year in advance. It’s simple, economical (since the yearly plans are better) and I don’t have to keep worrying about discontinuity due to non-payment for services.

All my brainwaves for features in WooCommerce come from real life scenarios. Prepaid Subscriptions Package for WooCommerce is no different. My little ‘internet situation’ got me thinking of an option to allow customers to make advance payments for WooCommerce products for a particular subscription period.

What resulted from my thought was this post. Let’s delve into this concept further to understand it better.

Why would you need a Prepaid Subscriptions Package for WooCommerce?

The first question to answer would be why would an advance payment feature be required?

While having to make payments on a regular basis is not a hassle that comes with online payments, there are other issues pertinent with this particular system. For instance, a client of mine once complained that the subscription order did not get renewed due a failure in the automatic recurring payment.

Another pertinent issue that is often observed with the system is that even after payment has been made the payment status does not change due to technical failure.

In such cases, the admin will have to manually reactivate the subscription after the issue has been rectified. While this might be a feasible option for a small customer base it can pan out to be immensely time-consuming with a sizeable customer base. Also, this will add unnecessary overhead and might not always be a feasible option taking into consideration various time zones.

Apart from the technical glitches, functional reasons can also play an important role while including the prepaid subscriptions package or advance payment feature to your WooCommerce website. For instance, we recently published a blog post on creating a gifting website with WooCommerce in which gifting subscription-based products was discussed. In this scenario, a prepaid subscription package makes the most sense for the person sending the gift as all the payment issues will be taken care of without any hassles.

In all such scenarios, a Prepaid Subscriptions Package for WooCommerce comes into the picture!

How Will Prepaid Subscriptions Package Work for an End User?

  • Step 1: The customer will select a subscription plan for the product. At this point, the user will also be provided with an option to choose between periodic payments and a one-time advance payment.
  • Step 2: If the customer chooses the prepaid subscription package then the total price of the subscription will be calculated.
  • Step 3: The customer can then proceed to make the advance payment for the entire subscription period. The product or service will be provided to the customer until the end of the subscription period following which, the subscription will be discontinued until renewal.

prepaid-subscriptions-package-user-view

How Will Prepaid Subscriptions Package Work for an Admin?

Now if you’re wondering whether the process will change on the admin end then let me tell you that it won’t. However, it’s important to understand a few details from the website admin’s perspective to understand the system better.

A few customizations will be required to make this prepaid subscriptions package work seamlessly with the Subscriptions plugin for WooCommerce.

  • Step 1: The admin will have to provide an option in the front-end using which the customer can opt-in for the prepaid subscriptions package.
  • Step 2: If a customer chooses the advance payment mode then a custom functionality will have to be written to calculate the total cost of the subscription.
  • Step 3: After the customer has made a payment the a check will have to be made by the system periodically to verify the validity of the subscriptions. For example if the customer has opted for a monthly service spanning over six months, then a check will have to be made every month for six months. at the end of six months the subscription will be suspended if it is not renewed.

Developing the Feature

On the customization front, the following two functionalities will have to be developed.

Calculation of Subscription Cost

The total price of a subscription will have to be calculated if a customer opts for the prepaid subscription package. For example, let us consider you’re selling an online magazine as a subscription. Now if the subscription costs the customer $20 every month and the customer signs up for six months then the system must be able to calculate the total cost of the subscription which is $120.

The hooks used for the customization will be as follows based on your requirement.

add_filter('woocommerce_get_price','wdm_change_price', 10, 2);
add_filter('woocommerce_get_regular_price','wdm_change_price', 10, 2);
add_filter('woocommerce_get_sale_price','wdm_change_price', 10, 2);

Also, a function calculating the total cost will be as below.

function wdm_change_price($price, $product_id) {
   return $price*$subscription_length;
}

[space]

Verification and Renewal of Subscription

The next step would be to check if a prepaid subscriptions package was chosen for the product. If it was then the order status will be changed to ‘Processing’ and the payment status will be updated to ‘Complete’ until the end of the subscription.

add_action('scheduled_subscription_payment','wdm_chage_order_status',10,2);
function wdm_chage_order_status($user_id, $subscription_key ) {
  //If user has paid in advance change then renew subscription otherwise put subscription on hold
}

[space]

In a Nutshell

The prepaid subscriptions or advance payment feature in WooCommerce is beneficial to both the website owner as well as the admin. While on the customer end it makes the purchase process simpler and the subscription unhindered, it reduces overhead and ensures happy customer for the admin.

So, when are you adding this winning feature to your WooCommerce store?

[space]

[space]

[freepik]

[su_note note_color=”#EDEDED”]

Further Reading on WooCommerce Subscriptions: 

[/su_note]

Aparna Gawade

Aparna Gawade

Leave a Reply

Your email address will not be published. Required fields are marked *

Get The Latest Updates

Subscribe to our Newsletter

A key to unlock the world of open-source. We promise not to spam your inbox.

Suggested Reads

WordPress Development

Custom WordPress Solutions, for You

LearnDash Development

Custom LearnDash Solutions, for You

WooCommerce Development

Custom WooCommerce Solutions, for You

WordPress Plugins

Scale your WordPress Business

WooCommerce Plugins

Scale your WooCommerce Business

LearnDash Plugins

Scale your LearnDash Business

Label

Title

Subtext

Label

Title

Subtext

Join our 55,000+ Subscribers

    The Wisdm Digest delivers all the latest news, and resources from the world of open-source businesses to your inbox.

    Suggested Reads