Troubleshooting

This document outlines some common issues and how to solve them when using Reserved Stock Pro for WooCommerce.

How to flush database reservations

Technically you shouldn’t have to manually flush the reservations from the database since they are cleared automatically.

However if you are just testing and need flush (delete) the reservations from the database there’s two methods.

Products removed instantly from cart

We’ve seen this happen due to third-party plugins or themes when they are missing essential WooCommerce code.

Likely plugins causing the issue:

  • Side cart plugins
  • Mini cart plugins
  • product add-on plugins
  • product bundle plugins
  • Themes adding cart functionality

Once you identify the plugin, you should pass the following guide to the developers. Once they correct implement the WooCommerce code, then Reserved Stock Pro should work correct with their plugin too.

“Removed from cart” message showing incorrectly

Related to the WooCommerce Persistent Carts feature.

💡 What are Persistent Carts?
Persistent carts refers to saving the cart information in the database for logged in users. This means their cart contents will be available if they login to their account from a different device, or time. Depending on your use-case, this feature may not be needed at all.

Some users of the RSP (Reserved Stock Pro) plugin have encountered an issue where the “removed products” message reappear upon user login. Even though the product has previously been removed.

This problem is due to the way WooCommerce updates the “persistent” cart information stored in the user meta. Simply put, the saved cart information is not cleared/updated after using the woocommerce_remove_cart_item_from_session hook.

There are two manual workarounds available.

Related links

Workarounds

1. Disable Persistent Carts

The recommended temporary solution is to disable persistent carts. This will prevent the issue from occurring until WooCommerce releases a built-in fix. Disabling persistent carts will not affect the functionality of Reserved Stock Pro.

To disable persistent carts, add the following code to your theme’s functions.php file or read our guide on customizing WooCommerce with code snippets.

/**
 * Disable WooCommerce Persistent Cart.
 */
add_filter('woocommerce_persistent_cart_enabled', '__return_false');Code language: PHP (php)

2. Disable the “Removed from cart” message

If you which to remove the message entirely you can use the below snippet. There’s more snippet examples in our Developer Usage section.

/**
 * Configure the removed_from_cart_notice
 */
function custom_rsp_removed_from_cart_notice( $message, $product_id) {
	return false;
}
add_filter( 'reserved_stock_pro_filter_removed_from_cart_notice', 'custom_rsp_removed_from_cart_notice', 10, 2 );Code language: PHP (php)

FAQ

Q: Why can’t Reserved Stock Pro provide a fix for this issue?

A: The issue is under investigation and we’ll likely submit a new issue to WooCommerce.

Since the issue originates from WooCommerce’s codebase, it is best to wait for an official fix from WooCommerce. Implementing “hacky” solutions could lead to performance issues and compatibility problems during the checkout flow. It is important to maintain stable and predictable interactions with the cart functionality, which could be compromised by unofficial fixes.

Countdown timer not showing

If the countdown isn’t displaying correctly on your store, then it could be caused by a CSS conflict. The Reserved Stock countdown should always display as “sticky” and be visable when scrolling the store.

“Sticky” elements can fail if their parent elements are using overflow: hidden. In other words. If the overflow is hidden, then there’s nothing for the countdown to stick to. Therefore we need to find which element on your store has the CSS property of overflow: hidden; In most cases, it could be the body tag.

Try adding this custom CSS to change the overflow of the body tag.

body {
    overflow: initial;
}Code language: CSS (css)

Inspect your site to ensure the change doesn’t change cause any other issues. The countdown should now display in the browsers view!

If you can’t change the overflow on your theme then have a look at using custom placements for the Reserved Stock countdown with our developer hooks.

The countdown is more/less than my set minutes.

If the countdown in your customer’s browser looks incorrect (either more or less than expected).

How does it happen: The countdown works by counting how my seconds remain until the expiration date. This means the counting gets the current time every second. Creating a countdown in this way is standard practice. Javascript uses the current time of the browser/device.

In short, the incorrect countdown occurs when the viewing device has an incorrect time. Your computer’s clock is either ahead or behind the real-time.

You can check your computers time by at https://time.is/

Solution: Set your device time & date settings to automatically synchronize within Windows or MacOS date settings.

Was this page helpful?