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?

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.

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;
}

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
}

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?

Images by freepik

The post Step Up Your WooCommerce Website with Prepaid Subscriptions Package appeared first on WisdmLabs.



Source link

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.