I am trying to:
I have woocommerce subscriptions installed. Users submit a custom post type content by first registering for a subscription. The payment is received and the post content is set to "Pending". I have not customized any of this so this is how it works out of the box. I then review the post and publish.
However, when a subscription is renewed and the order is set to complete through Paypal IPN, the moment the order is set to complete, the associated post somehow gets a post_status set to "original" which is not a valid post status. This doesn't appear to happen to all posts as some order. So I have to regularly go into mysql and perform an update.
Woocommerce support is telling me it must be associated with the component that handles the listing, which is CRED. I have been unable to find plugin compatibility issues.
The CRED post form itself has the following "Post status when the payment status updates" settings:
Purchase processing - Pending Review
Purchase complete - No change
Purchase refunded - Draft
Purchase cancelled - Draft
Can you please help me with this. its been problematic for a while.
The "Purchase complete - No change" would be the setting of interest here.
No change means, it'd stay on the same state as the post was before the payment was made.
Now, in your case that seems to be Pending, and given "No Change" after the payment is made - the post would never be published unless you publish it manually (which you do).
You could choose here "Published" after payment successful if you want, or Pending if you want to additionally review it.
Now, when your clients re-purchase this, they'll likely not use the same form, but use an edit form, is this correct?
Or will they create a whole new post, with a new payment like it would be the first time they visit the site?
Knowing this will indicate in what Form to look for the settings to amend.
We also have a Documentation here about these settings, it might help further:
https://toolset.com/documentation/user-guides/front-end-forms/using-cred-commerce-to-add-payments-to-forms
Please let me know if this helps to resolve the issue, or not. I would then suggest trying to duplicate this site to a staging server, where we could analyse the problem without other plugins or theme involved.
Hi Beda, thanks for responding. The renewal is automatic. So they fill out the post form one time and submit payment. They never return to the form to manually renew. Next month the subscription auto-renews. Once payment is confirmed and completed in WooCommerce, the post changes status from "Publish" to "Original". I can reproduce this manually as well by marking a order in WooCommerce as complete. Obviously "Original" is not a valid post status in WordPress so the post wont display anywhere in WordPress. I have to perform a SQL update every time. I could create a Trigger to handle this but that's just a really bad work around as this shouldn't happen in the first place. I attached an image from phpMyAdmin showing the post in wp_posts.
Its very odd behavior and I have no idea how to troubleshoot it as it is caused either by Toolset, WooCommerce, or both. Hopefully that makes better sense.
Here is an image of the WooCommerce Orders. Once an order goes from Processing to Complete, this is when the post status changes from Publish to Original.
This was a response from WooCommerce on this issue previously:
-----
Thank you for contacting Prospress support! I understand you are seeing some interesting behavior with your listings integration with Subscriptions.
Subscriptions does not have built-in listing functionality, so the behavior you are seeing with publishing / unpublishing your listing posts will not have originated with Subscriptions, but rather with another plugin or custom code.
The part of the process you describe that originates with Subscriptions is the subscription - renewal order cycle. When a subscription renews, it goes On Hold. This is to prevent customers from being able to secure an endless subscription via continual failed payments. When a renewal order payment completes, the subscription status should change back to Active.
Based on your description, it sounds like the plugin or custom code that is handling your listings is hooked into the subscription renewal process in some way. It would be this plugin or code that is setting the post_status to "original." This is the code that would need to be modified to accomplish the desired flow you are hoping for with regards to the relationship between listing publishing and subscription status change / payment timing.
Do you know what is generating your listings functionality? Is it some other plugin, or is it custom code?
Hi Robert,
Thank you for sharing these details and since Beda won't be able to continue on this ticket, so I'll be following up here.
I'll need to perform some tests on my own website, with a similar set up to confirm this behavior.
Due to the complexity of this testing, it will take some time, but I'll share my findings as soon as it completes.
Thank you for your patience.
regards,
Waqar
Thanks Waqar for your help. Much appreciated. Yea its definitely a weird issue. At the moment I have to regularly perform SQL updates as subscriptions renew. Please let me know if I can provide anything.
Thanks,
Robert
Hi Robert,
Thank you for waiting.
I just wanted to update that I'm still performing some testing and troubleshooting around this issue and will be able to share my findings, by early next week.
Thank you for your patience.
regards,
Waqar
Thank you for the updates. Please let me know if I can help in any way.
Hi Robert,
Thank you for waiting while I performed some troubleshooting around this issue.
I was able to reproduce this behavior on my test website too, even without the "Subscriptions" module.
When the "Purchase complete" option is set to "No change" in a Toolset Form connected to a product, on order's completion it sets the target post's status to "original" which is not a valid post status and as a result, that post is no longer available.
I've shared these findings with the concerned team and will keep you updated with the progress through this ticket.
We appreciate your report and for now, a workaround can be to select the "Pending Review" for the "Purchase complete" option. This will mean that as an admin you'll have to closely monitor all posts for which payment completes, either the first time or as a successful renewal, but at least this will save you from having to run SQL queries, just to keep those posts available.
regards,
Waqar
Thanks so much Waqar for looking into that. I am so glad it wasn't just me. For now I was able to setup a cron job to update the table every hour. Its not elegant but sort of works for now. I look forward to hearing from you next on the issue.
You're very welcome Robert.
We've already added an entry for this in the known issues ( https://toolset.com/errata/posts-published-with-forms-disappear-after-completing-woocommerce-order/ ) and I'll let you know once a fix for this gets released.