Featured

What do you need help with?

Start typing.

 

How to troubleshoot double or unprocessed renewal payments in WooCommerce Subscriptions

How WooCommerce Subscriptions renewal payments can fail

WooCommerce Subscriptions renewal payments can show faulty behaviour by either not being processed or by being processed twice (or more). Here is what you can do when trying to troubleshoot this.

How renewal payments are managed

WordPress schedules all timed events using its cron service. WooCommerce Subscriptions uses its action scheduler which is based on WordPress cron. When payments fail or are being processed twice, here is what you can check.

Diagnostic steps

  • Put your site into debug mode. Try triggering a test renewal. Here is more information on our WooThemes documentation on how to test a WooCommerce Subscriptions renewal payment. Also check the scheduled action of WooCommerce Subscriptions carefully. Are there any double entries?
  • Install and activate: https://wordpress.org/plugins/wp-crontrol/ – this plugin allows you to check the status of cron jobs. Go to the Tools -> Cron Events menu to manage cron events. There, all cron jobs are listed. Look at the “Recurrence” column. Any cron that has “Now” in the “Recurrence” column has failed. “Now” means “I should run now, but cannot”, thus it indicates a cron not running / failed.
    Once the now vanishes and is replaced by dates in the future, you know your cron jobs are working normally again.
  • Sometimes the cord is simply not plugged in. Check whether cron is disabled in your wp-config.php you can do so manually or via a plugin.
  • A known issue can occur if the server date / time settings have been changed.

    WooCommerce Subscriptions uses the action scheduler by ProsPress which aligns itself with the creation date of the Subscription. Once the server time has been changed, the action scheduler sometimes aligns itself again, creating a double charge for the Subscription, as it falsely considers the Subscription to have two creation dates at that point. If you believe this is the case and you are getting double charges, please open a ticket with us at http://woothemes.com and let us know that the server time was changed.  

Troubleshooting steps

And as always, take a backup before you get to work.

Cannot save Custom Fields in WordPress backend

Sometimes custom fields fail to save. As a possible solution you can try and increase the max_input_vars which was introduced in PHP version 5.3.9. The default value for max_input_vars is 1000, which means that if your form has has more than 1000 inputs, any additional values will fail to save.

You can increase max_input_vars via your php.ini file:

max_input_vars = 3000

or via .htaccess document:

php_value max_input_vars 3000

And as always there is of course a plugin available that can help in checking your PHP version and editing your php.ini file. Here is one suggestion: https://wordpress.org/plugins/php-settings/

How to setup basic fields in WooCommerce Bookings

In order to be able to setup your WooCommerce Bookings product, you need to know the parameters you have available. Here is my own explanation of basic WooCommerce Bookings form fields in plain english. It is neither complete nor official, and yes there can be mistakes in it. If you find any fault in this, please let me know via the comments. The official documentation is can be found here.

I hope you still find it useful. I have put all WooCommerce Bookings field names in double quotation marks.

How long?
How much time is available for 1 Booking?

  • “Booking duration” defines the amount of time that is available for one booking.
    One unit of the defined amount of time here is called a Block.
  • A Block can have the unit of
    Month(s)
    Week(s)
    Day(s)
    Hour(s)
  • The Booking Duration can be set to fixed or variable.
    • Fixed = You predefine the available dates aka Blocks.
      Variable = your customer may choose a start date and the duration aka the amount of Blocks.

You define the When? via the rules you define in the “Availability” tab and “Global Availability”. I will come to this in a moment, but before I continue:

Keep in mind that Bookings only allows a 1-to-1 relationship, unless you enable Persons or set “Max bookings per Block” to more than one.
This means one Block allows one booking.

Independent of your Persons and “Max bookings per Block” setting: Only one Booking per Block may be added to cart in one go but you can put more then one Booking in your cart and check them all out in one purchase.

Many scenarios need a 1-to-x relationship. Imagine you want to sell a tour that has more than one seat and you need people to be able to book one Block multiple times, because they want to come in a group of six people. In that case you might have more of a ticket-sale scenario rather than a bookings scenario.

If this sounds like your use case than I recommend that you also check out our WooCommerce Box-Office plugin.

When are bookings available?
Setting available dates and time.

  • “Max bookings per block” defines how many times a single block can be booked, before it becomes unavailable.
  • “Minimum block bookable” = first available date from now.
    Example:
    Today is the 1st and this value is set to one day.
    The first available Block is tomorrow.
    Example 2:
    Today is 3pm and this value is set to one hour.
    The first available Block is at 4pm today.
  • “Maximum block bookable” = last available date from now.
    Example:
    Today is the 1st and this value is set to one day.
    The last available Block is tomorrow.
    Example 2:
    Today is 3pm and this value is set to one hour.
    The last available Block is at 4pm today.
  • “All dates are” defines if the default availability of your Blocks is set to available or unavailable.
    If set to available use “Add Range” to block undesired dates and time
    If set to unavailable use “Add Range” to allow desired dates and time
  • “Check rules against” defines how availability is checked for multiple Bookings of the same Block. To Be Continued 🙂

WordPress WooCommerce troubleshooting flowchart for support

Every support case is the same, but different.

In an attempt to empower every one to be a little better when it comes to troubleshooting their WordPress / WooCommerce site: Here is a flow chart that displays the steps I take in many (not all) support tickets, when doing WooCommerce support.

Click on the button below the image to download a PDF version.

wcwp-troubleshooting-workflow-by-conschneider
Download

This flow chart is super beta and will be developed further by me.
Check back frequently or subscribe on the right via email to receive updates.

I hope you find it helpful.

Current version: 1.1
Last updated: June 17, 2016 at 8:52 am

What is WooCommerce Subscriptions staging site mode?

How WooCommerce Subscriptions knows it is a staging site

Upon activation of the plugin WooCommerce Subscriptions immediately copies the siteurl value in wc_subscription_siteurl. When you move your WordPress site, the value in siteurl must be changed. If there is a mismatch in both values, WooCommerce Subscriptions knows it has been moved, thus triggering its staging mode and setting all payments to manual.

Upon your first arrival in the dashboard of your staging site you then see this:

subscriptions-duplciate-site-warning

Mind you the payments are set to manual only via the database, it does not alter these settings:

Screen Shot 2016-04-28 at 11.56.54

The settings are located at: /wp-admin/admin.php?page=wc-settings&tab=subscription

How you know WooCommerce Subscriptions in in staging mode

You can also check your WooCommerce System status under /wp-admin/admin.php?page=wc-status
Find the Subscriptions Mode value there. If this is what you see, Subscriptions Mode: x Staging, then WooCommerce Subscriptions is in staging mode.

 

UsioiTyLUXweb

No WooCommerce Subscriptions payments will be processed by this staging site now.

How to stop WooCommerce Subscriptions notification emails

Keep in mind though that your staging system still is sending out all WooCommerce notification emails. If you want this to stop as well, you will need to use a plugin such as:

Do not forget to revert this after you have deployed back to live.

Payments on live site not processing after re-enabling payments

If you have deployed your WooCommerce Subscriptions staging site back to live and have trouble with payment processing, you should check the following values:

  • siteurl
  • wc_subscription_siteurl
  • wcs_ignore_duplicate_siteurl_notice

All three values must match, in order for your payments to process correctly again on your live site. If not you need to edit them manually, here is how.

  • Copy the url from siteurl: lets say http://www.conschneider.de
  • check the value stored in wc_subscription_siteurl
  • if the wc_subscription_siteurl is different to siteurl we need to change it. The correct value for this column is the siteurl
    but with _[wc_subscriptions_siteurl]_ inserted into the middle of the string (this is so that stuff doesn’t break on WPengine 😉 ).
    Set the value to http://www.[wc_subscriptions_siteurl]_conschneider.de
  • check the value stored in wcs_ignore_duplicate_siteurl_notice is also set to the same value as wc_subscriptions_siteurl. If not correct it the same way.

Be careful! Tampering with your database can render your site useless. Always make a full backup of your database (and files) beforehand!

Further read How does Subscriptions handle staging sites? on Woothemes.com.

Hosting Companies that use caching that may interfere with WooCommerce

A number of hosting companies use caching methods that are preconfigured on their servers to improve performance (and save cost).

If you run into trouble with your WooCommerce installation but fail to reproduce this locally or on a proven test system, chances are high that a server configuration you never ordered or heard off is causing this. Now please keep in mind that caching can but does not have to interfere with WooCommerce.

Here is a list of hosting companies that use caching methods per default.

This is not an official or proven list in any way. It reflects what I heard or have come across and only serves as a possible hint for when you are troubleshooting your WooCommerce shop. Always confirm whether or not caching is active on your machine by contacting the respective technical support.

WooCommerce Subscriptions testing payment gateways – test data

Testing payments is essential when working with WooCommerce Subscriptions. This ongoing (will be updated from time to time) post is a collection of links where you can find testing information for various payment gateways. They are in alphabetical order:

Last updated: May 10, 2016 at 11:28 am