Hello @bossert20voigt,
Yes you can set a target goal and a target date for individual campaign from the Crowdfunding plugin’s Settings > General
You can also set max/min price option on individual campaign submission form.
-
This reply was modified 6 years ago by
munayam.
Thread Starter
ThBo
(@bossert20voigt)
Hello,
yes i now them. But for example, there is a maximum price of 1000 and somebody fund 500. It is still possible to fund 600. In total then 1100.
Hello @bossert20voigt,
If you set the target goal from the plugin’s settings > general then the campaign will come to an end after the target goal is reached and it won’t receive further donation.
Thread Starter
ThBo
(@bossert20voigt)
yes it ends but overfunded! I want to prevent overfunding.
Look here:
https://ibb.co/DrQZgjJ
https://ibb.co/cDGdvnX
https://ibb.co/QXKKjc2
Thread Starter
ThBo
(@bossert20voigt)
Solution:
add_action( 'woocommerce_order_status_completed', 'nach_dem_Kauf', 10 , 1);
function nach_dem_Kauf($order_id) {
$order = wc_get_order( $order_id );
$items = $order->get_items();
foreach ( $items as $item ) {
$total = $item['total'];
$product = wc_get_product($item['product_id']);
$arr=get_post_meta($product->id, 'wpneo_funding_maximum_price');
$arr[0] = $arr[0] - $total;
'wpneo_funding_maximum_price', intval($arr[0]));
$product->update_meta_data( 'wpneo_funding_maximum_price', intval($arr[0]));
$product->save();
}
}
Hello there,
Yes, you are right. The campaign was overfunded. Glad to know that you have managed a solution already. Thanks a lot for sharing that too.
We will try to implement the solution in our future updates.
Regards
@mehedih
Don’t try, just include it. It looks like Themeum did not plan properly before developing this plugin.