Skip Navigation

[Resolved] CRED Commerce Delete Post when Subscription is Cancelled

This thread is resolved. Here is a description of the problem and solution.

Problem:
Can CRED and CRED commerce change an order status?

Solution:
No. CRED and CRED Commerce will modify posts or users once the order status is modified, nto the other way around.

Relevant Documentation:
https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/
https://toolset.com/documentation/user-guides/charging-payments-with-cred-to-register-users/

This support ticket is created 7 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 4 replies, has 2 voices.

Last updated by ZM880 7 years, 4 months ago.

Assisted by: Beda.

Author
Posts
#468593

I am trying to:

Delete a CRED Commerce post when a "Subscription" is cancelled. It works great for when an "Order" is cancelled.

I am using the Subscriptio subscription plugin. Here is their Action & Filter reference - hidden link

Is this possible with CRED Commerce?

Thank you.

#468683

Since CRED is not involved in the cancellation of the Subscription (this is handled by that Plugin) it can also not know when to delete the post.

I think that plugin deactivates the Subscription when it's cancelled, so you could use their API hook "subscriptio_membership_deactivate"

With this hook you could delete the post using the WordPress API:
https://developer.wordpress.org/reference/functions/wp_delete_post/

#468793

Ok thanks.

Since I have the native setting from the CRED Commerce form of when "order status changes to cancelled, delete post" would it be possible to change the status of the orders that correspond to the subscription?

#468881

If that plugin modifies the Order status, CRED will take that into account.

Any available setting or action to perform once the order is modified, is available within the CRED GUI in the commerce section.

CRED does not modify orders, so no, you can not change the order status, but you can do things with a post, once the order status changes.

#470049

Thanks.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.