Plugin Author
flinnn
(@flinnn)
Hi kassilukraine,
thanks for reaching out.
I’m not sure if I understand correctly.
Do you want to auto complete donations (aka automatically set status of the order to completed): https://wcdp.jonh.eu/documentation/advanced/auto-complete-donations/ Or do you want to set the status of the project to fully funded (and disable new donations to this project) after the goal is reached?
Best,
Jonas
Hello Jonas.
Yes, I meant auto-complete donation. That is, when the entire amount is collected, the collection of donations should end (I checked and if you set the product to “out of stock”, then the donation form is hidden, except for the progress bar), but when I reach 100%, the status of the product does not change to finish the donation
Plugin Author
flinnn
(@flinnn)
Hi kassilukraine,
Donation Platform for WooCommerce does not yet offer such a feature. I’m constantly trying to improve the documentation. Why did you think that Donation Platform for WooCommerce offers this feature?
Best,
Jonas
@flinnn hey Jonas.
I find solutions for autocomplete
add_action('woocommerce_order_status_processing', 'auto_complete_processing_orders');
function auto_complete_processing_orders($order_id) {
if (!$order_id) {
return;
}
$order = wc_get_order($order_id);
if ($order->get_status() == 'processing') {
$order->update_status('completed', 'Complete auto.');
}
}
its work, maybe its help someone)