Woocommerce Stock Management/Paypal issue - inventory not reducing

We use Woocommerce to sell products on my client’s site, running X 4.6.4. Stock management is enabled, and only recently stopped working properly.

When Paypal check out is used, the quantity of the product is not being reduced after the purchase is complete. The inventory is working properly with free products, and products that don’t use Paypal. So I believe we might have an issue with the API/IPN communications.

I have placed a test order to replicate the problem, and have created a log. I can send you that log.

This used to work correctly, but is now having a problem. I am not aware of all of the changes that have been made to the site, that may have caused this new problem. (I designed the site, but the client has done a lot of “do-it-yourself” work & updates, and is only getting me involved again, now that there is an issue.)

I have contacted Paypal Merchant Technical Support about this issue, and they said the following:

It would appear that the checkout is not passing a notify_url value. As a result, the payment completes, but there is not an IPN notification sent to the proper URL. It could also be tied to this, which displays at the top of the WooCommerce settings page for PayPal Standard:

It would appear that the last successful IPN message was on 9/21/17, so it appears that it may have happened late last week that there was a change.

Actually, the problem was reported to me by my client earlier than that, on 9/5/17. I pressed Paypal a little further, for a solution to the problem, and they said this:

Unfortunately, this is something that WooCommerce would have to assist with, as you are not able to change the information in the payment request directly. As I mentioned previously, it appears that the notify_url stopped being passed on 9/21. Since WooCommerce sends a unique IPN URL with each payment request, they would have to isolate why there is nothing being sent in the last few days.

I have not contacted Woocommerce, as there product is free, and they only support people who pay them. I guess I’d have to buy something random, so they would talk to me? I also suspect they will just blame you, as I can see in their “status” tab that some templates are out of date.

Note that I have upgraded this site to your stable X release of 4.6.4. I’m worried about upgrading to the most recent version, which may cause additional issues.

Any help you can provide is greatly appreciated!

Hey there,

The X version you’re using is not compatible with the latest WooCommerce version. You’re also using the latest Cornerstone version which is not compatible with the old version. Though this might not be the cause, you must ensure everything is up to date.

Please check for the following:

  1. Ensure everything is up to date according to our version compatibility list at https://theme.co/apex/forum/t/troubleshooting-version-compatibility/195. Please follow the best practices when updating your theme and plugins. See https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/62 for more details.

  2. Clear all caches including browser cache then deactivate your caching plugins and other optimization plugins.

  3. If you’re using a CDN, please clear the CDN’s cache and disable optimization services.

  4. Test for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

  5. Remove custom CSS, Javascript and templates.

We also need to know if this issue is caused by X. Please backup your site and switch to the default WP theme and check if the issue persists.

Thanks.

Thank you for this valuable info. The client has decided to delay this work, for fear that the required updates might crash the site at a critical time. We are waiting until next week.

I will report back with my results!

Sure, we’ll check that once ready.

I have completed the items you suggested, and the stock management is still not working correctly when Paypal is involved. (Remember that it does work correctly when Paypal is not involved.) Removing third party plugins and custom CSS did not change this result. Nor did changing to the default theme. Always still the same results.

A few notes:
I notice that Soliloquy automatically upgraded (with the theme, I assume) to 2.5.3.1 instead of the 2.4.4.3 shown on your compatibility list. I doubt this has any influence on my issue.

I followed Woocommerce’s suggestion of how to downgrade from 3.1.2 to 3.1.1:

  1. Created a database backup
  2. Deactivated and deleted Woocommerce 3.1.2
  3. Restored the database from backup created in Step 1. When doing this, I did receive the following error:

Error
SQL query:

– Database: b98b3220250148



– Table structure for table wp_dm406qxstx_commentmeta

CREATE TABLE wp_dm406qxstx_commentmeta (
meta_id BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
comment_id BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT ‘0’,
meta_key VARCHAR( 255 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
meta_value LONGTEXT COLLATE utf8mb4_unicode_ci,
PRIMARY KEY ( meta_id ) ,
KEY comment_id ( comment_id ) ,
KEY meta_key ( meta_key ( 191 ) )
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci AUTO_INCREMENT =777;

MySQL said:
#1050 - Table ‘wp_dm406qxstx_commentmeta’ already exists

  1. Then, I installed and activated woocommerce 3.1.1

The stock management problem persists. Please let me know what you suggest.

Thank you,
Angela

Hi there,

Sounds like the issue is isolated to Paypal addon’s, have you tried contacting the author? Maybe the ajax request is failing which made the process incomplete.

Soliloquy should have no problem with it, you can also try disabling it while testing the payment process again.

The error is because there are existing tables and you’re trying to create the same tables all over again. Your restore process (if you’re using automated restoration) should automatically drop table before creating one. You may contact a webmaster or developer to assist you with proper restoration.

Thanks!

So, I resolved this issue elsewhere, and thought I’d report back, in case anyone else has experienced the same issue.

This site is hosted at GoDaddy, using their Managed WP product. Once I deleted or renamed the object-cache.php file, the problem was resolved.

Crazy.

Glad this is now sorted out and thank you for sharing the solution.

Cheers.